Commit Graph

1 Commits

Author SHA1 Message Date
Tyler Cloutier 81120b983c Add Deep Database Style (#4925)
## Summary

Adds `docs/DEEP_DATABASE_STYLE.md`, a style guide for the **deep core**
of the SpacetimeDB database (datastore, commitlog, snapshotting,
replication).

[**Read the rendered
document**](https://github.com/clockworklabs/SpacetimeDB/blob/tyler/programming-standards/docs/DEEP_DATABASE_STYLE.md)

The document is organized around seven principles:

1. Work towards zero dependencies
2. Work towards deterministic simulation testing
3. Work towards thread-per-core
4. Work towards `no_std`
5. Think in terms of persistent data structures
6. Think in terms of pipelining
7. Think in terms of unreliable processes

A short style section follows the principles, covering assertions,
bounded loops and queues, error handling, control flow, naming, and
formatting. Inspired by [TIGER
STYLE](https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/TIGER_STYLE.md),
narrowed and adapted for Rust and our principles.

This is a seed document. It will grow as we make the principles
operational in code and as the practices that serve them become clearer
with use.

## Test plan

- [ ] Read the document and review the principles
- [ ] Discuss any principle the team disagrees with before merging

---------

Co-authored-by: Alessandro Asoni <alessandro@clockworklabs.io>
2026-05-29 01:00:48 +00:00