> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sentrystudios.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Core Infrastructure

> Architectural overview of Sentry Studios' asynchronous execution model, Folia region-threading, and storage engines.

Sentry Studios utilizes a unified, high-performance architectural foundation across all resources. Engineered specifically for high-intensity Minecraft networks, our core systems are built upon three primary pillars:

> **Zero-Tick Impact**
>
> 100% off-thread database I/O and asynchronous data fetching protect your main tick loop.

> **Folia-Native Schedulers**
>
> Native support for regional multi-threading through internal `FoliaUtil` scheduling adapters.

> **Protocol-Level Interception**
>
> Deep Netty pipeline interception for sub-millisecond PvP hit-registration and packet filtering.

***

## High-Performance Execution Model

Vanilla Minecraft and legacy Bukkit servers execute game mechanics, file writes, and database calls synchronously on a single main thread. When a database query hangs or an inventory file is read, the entire server freezes (TPS drop).

Sentry Studios circumvents this bottleneck by decoupling data operations from the tick loop:

```mermaid theme={null}
sequenceDiagram
    autonumber
    actor Player as In-Game Player
    participant Main as Server Tick Thread
    participant Scheduler as Folia / Async Worker Pool
    participant Cache as Memory L1 Cache (ConcurrentMap)
    participant DB as Persistent Storage (H2 / MySQL)

    Player->>Main: Triggers Action (e.g. /wipe, /lore, /settings)
    Main->>Cache: Instant Memory Lookup (<0.05ms)
    alt Cache Hit
        Cache-->>Main: Immediate In-Memory State
        Main-->>Player: Instant GUI Render / Sound Feedback
    else Cache Miss / Write Action
        Main->>Scheduler: Dispatches Asynchronous Task
        Note over Scheduler,DB: Off Main Thread (Zero TPS Impact)
        Scheduler->>DB: Executes Non-Blocking I/O Operation
        DB-->>Scheduler: Query Results / Write Confirmation
        Scheduler->>Cache: Updates L1 Memory State
        Scheduler->>Main: Syncs Back to Entity Region
        Main-->>Player: Action Finalized & Visuals Applied
    end
```

**Asynchronous I/O Engine**

Heavy operations—such as zip file compression during inventory backups, historical audit lookups, and Discord webhook dispatching—run exclusively on dedicated thread pools.

**High-Speed In-Memory Cache**

Active player settings and lore registries are cached in non-blocking, concurrent data structures (`ConcurrentHashMap`). When a player opens `/settings` or `/lore`, the GUI renders in under `0.1ms` without making a single database call.

**Folia Region Compatibility**

Folia splits the Minecraft world into independent ticked regions. Sentry plugins automatically detect Folia environments at runtime and dynamically route entity and world operations through region-specific schedulers.

***

## Enterprise Data Management

We provide flexible, production-tested storage abstractions that adapt seamlessly to your deployment size:

> **Embedded H2 Storage (Recommended for Single Servers)**
>
> Our default engine for standalone servers. H2 is an ultra-fast, embedded SQL database that runs in-process. Unlike SQLite, H2 supports superior concurrent read locks and is fully resilient against sudden process terminations.

> **Clustered MySQL 8.0+ / MariaDB (Recommended for Networks)**
>
> For multi-server networks connected via BungeeCord or Velocity, all Sentry plugins support centralized MySQL connection pooling. Player settings toggles and custom lore registries sync seamlessly across all proxy-connected nodes in real time.

> **Automated Schema Migrations**
>
> Database schemas and table indexes are checked and auto-migrated on startup. You will never need to manually execute SQL scripts to upgrade Sentry plugins between releases.

***

## Next Steps

> **[Quick Start Guide](https://docs.sentrystudios.org/overview/quickstart.md)**
>
> Deploy and verify your first Sentry plugin in under 5 minutes.

> **[Formatting & Styling Engine](https://docs.sentrystudios.org/core-concepts/configuration-and-formatting.md)**
>
> Master our MiniMessage, Hex gradient, and Small Caps text formatting.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.