Skip to content
  • Our Product
    • Namazu Elements
      • What is Elements?
      • Why open source?
      • Docs
        • Elements in Five Minutes or Less
        • RESTful APIs Library
        • Security Model
        • Accessing the Web UI (CMS)

    Our Product

    A logomark with three layered rhombuses adorning the lettermark that says Elements in bold all-caps sans-serif letters.
    • What is Namazu Elements? Discover our easy-to-use backend network solution built for online games. Rapidly enables full-scale multiplayer games or online solo adventures.
    • Why open source? Is there a truly open source server backend for connected games? There is now. Download and run a local copy of Namazu Elements and try it for yourself.
    Download Namazu Elements

    Get started

    • Quick start Read our Elements 5-minute quick start guide
    • Documentation Read our developer docs for learning more about Elements
    • RESTful APIs A full list of core API specs for working with the Elements framework
    • Security An overview of the server-authoritative security model of Elements
    • Accessing the CMS Manage your game with ease via the Namazu Elements CMS.

    Co-development Reimagined

    • Reduce your costs Would you rather outsource your backend development? Hire Namazu Studios to build your server backend with the power of Namazu Elements.
      Co-dev

    Recent Posts

    • The watercolor-styled Namazu Studios logo over a giant namazu lurking in the depth
      Namazu Studios Featured in San Diego Business Journal
      22 Sep 2025 Press
    • Namazu Elements 3.1 Released – Service Layer Fixes, Secure APIs, and Steam Bug Fix
      22 Apr 2025 Release Notes
  • Case Studies
  • About Us
  • News
  • Services
  • Book a call
namazu-studios-logo
Book a call

Getting Started

  • Elements in Five Minutes or Less
  • Ubuntu Linux Setup
  • Mac OS Setup
  • Setup for Windows
  • Accessing the Web UI (CMS)
  • General Concepts
  • N-Tier Architecture
  • Security Model

Namazu Elements Core

  • User Authentication / Sign In
    • What is a User?
    • User Authentication in Elements
    • Auth Schemes
      • Auth Schemes
      • OAuth2
      • OIDC
  • Features
    • Applications
    • Sessions
    • Users and Profiles
    • Digital Goods
    • Progress and Missions
    • Progress and Missions (3.4+)
    • Leaderboards
    • Matchmaking – Comprehensive Guide
    • Followers
    • Friends
    • Reward Issuance
    • Save Data
    • Metadata
    • Metadata (3.4+)
    • Queries
    • Web3
      • Wallets
      • Vaults
      • Omni Chain Support
      • Smart Contracts
        • Smart Contracts
  • Queries
    • Advanced Operators
    • Object Graph Navigation
    • Boolean Queries
    • Base Query Syntax
  • Advanced Operators
    • .name
    • .ref

Custom Code

  • Custom Code Overview
  • Introduction to Guice and Jakarta in Elements
  • Structuring your Element
  • Packaging an Element with Maven
  • Deploying an Element
  • Preparing for Code Generation
  • Properties
  • Websockets
  • RESTful APIs
  • Direct MongoDB Access (3.5+)

Releases

  • 3.5 Release Notes
  • 3.4 Release Notes
  • 3.3 Release Notes
  • 3.2 Release Notes
  • 3.1 Release Notes

Configuration

  • Matchmaking – Comprehensive Guide
  • Direct Database Access and Batch Configuration
  • Batch Samples
    • Mission Upload Bash Script Sample
    • Item Upload Bash Script Sample

RESTful APIs

  • RESTful APIs Library
  • Swagger and Swagger UI

Crossplay

  • Namazu Crossfire
  • Deploying Namazu Crossfire in Your Game
View Categories
  • Home
  • Docs
  • Getting Started
  • N-Tier Architecture

N-Tier Architecture

Est. read time: 3 min read



Elements uses the N-Tier Architecture style with three layers, including the Presentation Layer, Service Layer, and DAO Layer. #

Internally, Elements uses an N-tier architecture style consisting of three layers.

  • The Presentation Layer is a thinly defined layer of abstraction over the underlying Service Layer. RESTful APIs provide a translation between the Service layer and the Presentation layer. JSON-RPC APIs (experimental) are essentially calling service layer methods directly. The endpoint code simply unpacks the requests and translates that to the Service layer. The Presentation layer does nothing to enforce security.
  • The Service Layer (also sometimes called the Logic Layer) houses all the business logic of the system. This layer exists with multiple implementations of each service. All APIs labeled “service” (e.g. – dev.getelements.elements.sdk.service.smartcontract.evm) will always consider the context of the user making the request. In some cases, the Service layer implementation is configured to do nothing but throw exceptions.
  • The DAO Layer (also sometimes called the Data Layer) is the layer that provides access to the database through layers of abstraction. All APIs labeled “dao” (e.g. – namazu.elements.dao.user) are part of the DAO layer.

Presentation Layer #

The presentation layer is the layer closet to the client code. In the context of Elements, this is the Resource handling the cloud function invocation. Internally, Elements uses JAX-RS annotated methods at the presentation layer.

Service Layer #

The Service Layer houses the logic of the application. Each Service is a common interface through which client code makes calls. Depending on User Acccess Level, Elements will use a different implementation of the Service. Most services honor user access level. However, as the developer of the application, you should not worry about these details. When using the Scripting engine, invoking service layer code will typically enforce the appropriate permissions.

Warning

If a Service is not available for a particular access level, the Service will throw the appropriate exception indicating that the permission check failed.

Scoped Services #

A service that specifically honors User Access Levels is said to be scoped, which means it may have a reference to the currently logged-in user when processing the request. Useful information may be inferred from this scoping.

Unscoped Services #

A service that does not honor User Access Levels is said to be unscoped, meaning it will not have any reference to the currently logged-in user. Typically, unscoped services provide super-user access to the system. Alternatively, they may provide information that is available to all users without restriction.

Warning

When writing cloud functions, you should handle the service layer with care because it is unscoped and super-user access is provided.

DAO Layer #

The data layer has no user scope, and therefore provides unrestricted access to the database. The Data Layer abstracts the database details. The Data Layer performs operations such as querying, inserting, updating, and deleting.

Warning

As with unscoped services, Data Layer code provides raw access to the database without regard for any scoping rules. Therefore, special care must be taken to make use of this.

What are your Feelings
Still stuck? How can we help?

How can we help?

Updated on August 27, 2025
General ConceptsSecurity Model
Table of Contents
  • Elements uses the N-Tier Architecture style with three layers, including the Presentation Layer, Service Layer, and DAO Layer.
  • Presentation Layer
  • Service Layer
    • Scoped Services
    • Unscoped Services
  • DAO Layer
  • Documentation
  • Terms of Service
  • Privacy Policy
  • Contact us
  • Linkedin
  • Join our Discord

Namazu Studios LLC is powered by Namazu Elements, an Elemental Computing Inc. product.

Elements
  • Download
  • About Elements
  • Open source
  • Documentation
  • Support
About Namazu
  • Case Studies
  • About Us
  • News
Get in Touch
  • info@namazustudios.com
  • Book a call
  • (619) 862-2890
  • Linkedin
  • Discord

©2008-2025 Namazu Studios. All Rights Reserved.