ThingsDB Documentation & Official Book
Explore the official ThingsDB technical documentation and 'Data as Code: The ThingsDB Book' by Jeroen van der Heijden.
Data as Code: The ThingsDB Book
Written by Jeroen van der Heijden, core developer of ThingsDB. Discover how to build distributed, event-driven backends without ORMs, external caches, or query translators.

What You'll Learn in The ThingsDB Book
1. Stored State & Schema
Understand the Stored-State-Distributed-Interpreter model. Define dynamic schemas with new_type() and set_type(), and mutate variables directly to a persistent, quorum-replicated event log.
2. Response Control & Wrap-Only Types
Master wrap_only properties to return dynamic calculated views and filtered responses without persisting redundant data or exposing internal state.
3. Real-Time Rooms & Event Streams
Utilize room(), emit(), and WebSocket listeners to broadcast state updates across connected client applications instantaneously.
4. Two-Way Bidirectional Relations
Create graph-like back-references between objects with automatic synchronization, eliminating orphaned pointers and manual linking.
5. Futures & Native Modules
Offload high-latency tasks asynchronously using future() and extend ThingsDB with Go or Python modules.
6. Full To-Do App Project
Follow a hands-on guide from Chapter 6 to 13 to build a production-grade multi-user application from schema design to frontend integration.