Jetstream KV/ObjectStore as a database? #5468
-
With KV and Object storage available within Jetstream, how is everyone using these features when it comes to traditional database roles? In other words, are there scenarios that don't make sense to completely replace the Postgres tables and keep Jetstream as the primary source of truth? I love the reactivity of WS clients subscribing to changes in Jetstream objects. It seems to make sense for that reason, but I could see how other aspects would suffer like searching. If this doesn't ever make sense, are there projects out there that keep a DB in sync with Jetstream data? I'm just looking for some advice here before I spend too much time here and find out it was a terrible idea. Thanks for any feedback you can provide. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
My impression is that these are different use cases. If you want a db with live updates etc, check out surrealdb which is extremely ambitious and powerful. Or, at least just look at using a CDC tool, like Conduit, for streaming changes in Postgres to Nats, which you can then use to update clients. |
Beta Was this translation helpful? Give feedback.
-
nats has the query api, persistence and replication too. What's not to like in this for a small dataset where the replication volumes are not too high? Replicating a database or just talking about it, on the other hand is just a lot of pain. Sure jetstream is not build to have ACID or commit logs but it would be good to know just what the gaps are in using jestream for persistence. Maybe there are no WAL / recovery options? Many people seem to use Redis like what the OP intended with jestream & this question seems quite natural. I was wondering about it too. |
Beta Was this translation helpful? Give feedback.
-
It depends on your use cases and your querying needs: if you just need "no SQL" data store functionality (e.g. KV or Object store, or subject-based addressing in streams, or 'compare and set' rather than transactions for concurrency access control) then NATS JetStream does it. If you need full SQL query language with support for schemas, joins, transactions and isolation then that's the domain of full-blown databases like Postgre and others. |
Beta Was this translation helpful? Give feedback.
It depends on your use cases and your querying needs: if you just need "no SQL" data store functionality (e.g. KV or Object store, or subject-based addressing in streams, or 'compare and set' rather than transactions for concurrency access control) then NATS JetStream does it. If you need full SQL query language with support for schemas, joins, transactions and isolation then that's the domain of full-blown databases like Postgre and others.