Repository navigation
Storage Architecture
SecureAutoSmartLocks (SASL) uses a hybrid persistence architecture built around two complementary storage mechanisms:
- YAML — the primary persistent repository for lock records.
- Persistent Data Container (PDC) — stores lock-related metadata alongside Minecraft world data.
The architecture is designed to keep lock records accessible to the plugin while also maintaining data associated with the world and its chunks.
Since Colossus 2.8.2, storage operations are organized around the Repository Pattern through LockRepository and its YAML implementation, YamlLockRepository.
This separation provides a clearer boundary between lock-management logic and the underlying storage implementation.
LockRepository defines the repository abstraction used by SASL to access persistent lock data.
Instead of requiring every subsystem to work directly with YAML files, the repository provides a centralized access layer.
Its purpose is to separate:
- Lock-management operations.
- Persistent record access.
- The concrete storage implementation.
This reduces direct coupling between the plugin's core logic and its YAML-backed persistence.
YamlLockRepository is the current repository implementation.
It handles persistent lock records using YAML storage.
The repository acts as the primary access point for the plugin's YAML-backed lock data.
Important: The Repository Pattern does not mean SASL currently supports multiple database providers. YAML remains the implemented repository backend in Colossus 2.8.2.
YAML is the primary persistent record store used by SASL.
It provides a human-readable format that can be inspected and edited with ordinary text editors.
YAML offers several practical advantages for a Minecraft plugin:
- Human-readable configuration and data.
- No external database server required.
- Straightforward backup and file-based administration.
- Simple deployment for small and medium-sized servers.
- No additional database service to configure or maintain.
For servers that prefer a lightweight, file-based setup, YAML is a convenient storage choice.
However, convenience does not mean unlimited scalability.
YAML is useful for SASL's current storage model, but it has limitations that become increasingly relevant as persistent data grows.
As more locks are registered, the persistent YAML data can become larger.
A growing file means more data may need to be read, parsed, serialized, or written during storage operations.
The impact depends on the amount of stored data and the server's hardware.
There is no verified universal lock-count threshold at which YAML becomes unsuitable.
YAML is a structured text format.
Unlike a database engine that can retrieve individual records through indexed queries, a conventional YAML-backed repository generally needs to process structured file content to load or update its data.
As the stored dataset grows, parsing and serialization can become more expensive.
A file-based persistence design can require rewriting a substantial portion of the stored dataset when records change.
This is different from a database that can update individual rows or records.
The practical cost depends on how the repository batches and schedules its writes.
SASL's asynchronous I/O infrastructure and configured save delay help organize storage work, but they do not eliminate the underlying limitations of file-based persistence.
YAML does not provide database-style transaction management or built-in multi-user concurrency control.
The plugin must coordinate its own access to persistent data and manage the relationship between in-memory state and file operations.
This responsibility belongs to SASL's storage implementation rather than to YAML itself.
YAML does not provide native database indexes, SQL queries, relational joins, or query planning.
When the plugin needs to locate records, the repository must handle that work through its own data structures and logic.
As the dataset grows, this can become less efficient than a storage engine designed for indexed record access.
SASL also uses Minecraft's Persistent Data Container system.
PDC allows the plugin to associate persistent metadata with supported Minecraft data holders.
In SASL, PDC complements the YAML repository rather than replacing it.
The architecture uses PDC for lock-related data associated with world and chunk storage.
Colossus 2.8.0 introduced chunk-level PDC support for both BlockEntity and non-BlockEntity blocks.
This expanded persistence beyond blocks that expose a traditional TileState.
Colossus 2.8.2 further introduced paged PDC handling.
Paged PDC organizes stored metadata into pages rather than treating the entire dataset as one undivided structure.
This provides a more manageable structure for processing PDC data.
It is particularly relevant to recovery and validation operations that need to inspect stored chunk metadata.
| Storage | Primary responsibility |
|---|---|
| YAML | Primary persistent lock repository |
| PDC | Lock-related metadata associated with Minecraft world and chunk data |
These mechanisms serve complementary purposes.
PDC should not be described as a complete replacement for locks.yml, and YAML should not be described as the only location where SASL stores persistent lock-related information.
Persistence is not only about saving data. SASL also needs to reconcile stored information with the state of the Minecraft world.
This is where the storage architecture connects with other Core Engine components.
Phoenix handles chunk-load recovery and reconstruction workflows.
Its responsibilities include:
- Processing stored chunk-level PDC data.
- Validating relevant block and chunk information.
- Reconciling recovered records with
LockRepository. - Updating runtime state and caches.
- Processing recovery work in batches.
Phoenix uses asynchronous parsing where applicable, while Bukkit world operations remain on the main server thread.
Its recovery process is therefore not entirely asynchronous.
Argus monitors lock integrity and evaluates suspicious or potentially stale records.
It uses information from the storage and runtime systems to identify records that may require further evaluation.
A lock reaching the configured expiration age is marked as VULNERABLE; this does not mean that the record is immediately deleted.
Executioner handles final purge and removal workflows.
It processes removal work in batches, with batch sizes adjusted according to server TPS and available JVM heap.
This allows purge processing to respond to runtime conditions, but it does not guarantee zero performance impact.
SASL includes asynchronous I/O infrastructure to avoid unnecessarily performing file-related work on the main server thread.
The io-threads setting controls the configured I/O thread count.
| Setting | Behavior |
|---|---|
io-threads: -1 |
Automatic thread-count detection |
save-delay: 500 |
Configured save delay in milliseconds |
The automatic setting detects an appropriate thread count; it should not be interpreted as a guarantee that every available CPU core will always be used.
The save delay helps coordinate persistence work. It does not guarantee that every write is immediate or that storage operations have no performance cost.
YAML remains the implemented storage backend in Colossus 2.8.2.
SQL and MariaDB support are planned considerations for the subsequent 2.8.3 development cycle.
A database-backed implementation could provide capabilities better suited to larger datasets, including:
- Indexed record lookups.
- More granular record updates.
- Database transaction support.
- More advanced querying.
- Better options for centralized storage.
However, adding a database is not simply a matter of changing the file extension.
It requires a proper storage implementation, connection management, schema design, data migration, error handling, and compatibility testing.
The existing LockRepository abstraction provides a useful architectural boundary for future storage implementations, but it does not mean those implementations already exist.
Current status:
- YAML repository: Implemented.
- PDC integration: Implemented.
- Paged PDC: Implemented.
- SQL backend: Not implemented in Colossus 2.8.2.
- MariaDB backend: Not implemented in Colossus 2.8.2.
Lock Management
|
v
LockRepository
|
v
YamlLockRepository
|
v
locks.yml
Minecraft World Data
|
v
PDC
|
v
Chunk-Level Pages
|
v
Phoenix Recovery
|
v
LockRepository / Runtime State
This is a conceptual representation of the responsibilities and relationships, not a claim that every operation follows one identical execution path.
The current architecture provides a functional file-based persistence system with complementary PDC storage.
However, YAML has practical limits when persistent datasets become large or when more advanced querying and record-level updates are required.
The planned 2.8.3 development direction includes SQL and MariaDB support.
The objective is to extend the storage architecture without unnecessarily coupling the rest of SASL to a specific persistence provider.
Until that work is implemented and tested, YAML remains the official repository backend.