Celebrating SpaceTimeDB 1.0 and timeseries databases as unique source of truth
Nice to see a project like SpacetimeDB reaching 1.0. On top the niceties it provides, what hits a string with me is the fundamental view shift of your database.
If you think about your databases at any point in time, it is very likely that it is designed so it represents a snapshot of a state at moment X, aka “How things are like at moment X”.
But that does not give you much information beyond just that.
You’re loosing a lot of history and insights. How did you get to this state? How much does this piece of state change? How can I revert the state to moment Y?
We get (some) of this capability with analytics, which usually evolves in parallel of your core system, and you’re left with the burden of trying to conciliate and manage two different data sources and prey for the numbers being right.
So, shifting your unique source of truth to a list of events, as in a timeseries database (and kinda Git too isn’t it?), can actually make sense.
A piece of state at moment X is a function of:
- The last occurrences of a set of events
- An aggregation on occurrences of events over time
So, it can always be derived from your events list. It even unlocks many time-related usecases, by design. Rollback, undo and redo, replay…
With one source of truth.
This approach is not specific nor limited to a restricted set of domains. This is just data. Any domain can be modeled to data.
If this is not conceptually simple, I don’t know what is.