---
title: Where Your Authoritative Code Runs
description: "Namazu Elements is flexible about *where* [authoritative](https://namazustudios.com/glossary/authoritative/) logic lives. What matters is that the code: - runs in a trusted environment - validates events - applies permanent state changes There are two primary options. --- ## Option 1: Your Own…"
url: "https://namazustudios.com/docs/fundamentals/where-your-authoritative-code-runs/"
updated: "2026-08-13"
category: Fundamentals
---

# Where Your Authoritative Code Runs

Namazu Elements is flexible about *where* [authoritative](https://namazustudios.com/glossary/authoritative/) logic lives. What matters is that the code:

- runs in a trusted environment
- validates events
- applies permanent state changes

There are two primary options.

---

## Option 1: Your Own Game Server

In this model:

- your backend [Service](https://namazustudios.com/glossary/service/) receives requests from the client
- your code validates gameplay, purchases, or actions
- your server calls Elements APIs

This is a good fit when:

- you already have backend infrastructure
- you need tight integration with existing systems

---

## Option 2: Elements as Your Game Server

A **Custom [Element](https://namazustudios.com/glossary/element/)** is your own [Application](https://namazustudios.com/glossary/application/) running *inside Elements*.

Custom Elements:

- execute [authoritative](https://namazustudios.com/glossary/authoritative/) logic
- can own request handling
- can maintain realtime connections
- can be written as plugins or libraries
- can be developed and deployed independently
- can interact directly with Elements systems

Multiple Custom Elements can be loaded at the same time, allowing functionality to be composed.

---

## Example: Payment Processing

A payment processor can ship a Custom [Element](https://namazustudios.com/glossary/element/) that:

- validates purchase receipts
- verifies transactions with external services
- issues digital goods through Elements

This allows game developers to:

- avoid writing purchase validation logic
- avoid operating their own backend for that purpose
- rely on a trusted, reusable integration

---

## Architectural Flexibility

If you're starting a project from scratch and don't have any restrictions on what you're using for your gameplay logic, it may be easier to write the entirety of your [Application](https://namazustudios.com/glossary/application/) directly in Elements due to:

- its direct connections to other Custom Elements and the Elements Core systems
- preconfigured database connection
- ease of deployment

However, many production setups use both:

- a lightweight game server for gameplay validation
- Custom Elements for shared or third‑party logic (payments, promotions, analytics)

Elements does not require you to choose only one approach.
