11 ms·
What is the primary use case for rethinkdb (vs other databases) ?
by tarr11 9y ago
What is the primary use case for rethinkdb (vs other databases) ?
- nailer 9y agoIt's a place to store data. - The data can be structured - It can also have relations - The query language is JS, and allows both 'shape of data' and functional queries - There's live change feeds (which means the DB, being the source of truth, takes the role of initiating change messages) - RethinkDB has an excellent reputation for being able to get the data back after you save it. Basically it's like Mongo but not (insert adjective). We've been using it in production for 2 years at CertSimple and have been very happy. Previous experience is Mongo, GAE data store, and various ORMs pointed at SQL. The docs are great, the defaults are safe, and doing new things is easy.
- krisives 9y agoWait, RethinkDB stores data?
- drdaeman 9y ago> RethinkDB has an excellent reputation for being able to get the data back Uh. It's not always true, although not in the sense you've meant it (no complaints about storage reliability). I don't know if my setup is broken or I did something stupid, but for me rethinkdb-dump saturates the CPU to the max and the only thing that keeps the machine from choking to death with LA1 going over 100 is resource limit on the database container. Trying to back things up results in random connection drops and timeouts. I gave up on trying to back up the database online. And that's a very small database (75GB on disk, 12GB as uncompressed JSON, 2.5GB as a tarball), on a reasonably powerful machine. It's a single node, though - I thought I'd "upgrade" to a cluster at some point but it's way too early.
- chillydawg 9y agoIt's good for really easy changefeeds. Eg in a multiplayer game scenario you might have several people touching rows in a table. Any client can construct a query filtering on their particular subset and trivially just say .Changes() and then get a fast, reasonably-robust changefeed with an image-then-deltas type interface. It's not particularly low latency and the latency is quite variable - so if you're timing requirements are of the millisecond order, look elsewhere.
- jasondc 9y agoDefinitely valuable, as an aside, changefeeds are now in mongodb too: https://emptysqua.re/blog/driver-features-for-mongodb-3-6/#change-streams https://emptysqua.re/blog/driver-features-for-mongodb-3-6/#c...
- traverseda 9y agoand postgres!
- Deimorz 9y agoDo you mean using LISTEN/NOTIFY, or some other method?
- williamstein 9y agoProbably LISTEN/NOTIFY. I explain in detail how I migrated from RethinkDB to PostgreSQL using LISTEN/NOTIFY + tons of additional work here http://blog.sagemath.com/2017/02/09/rethinkdb-vs-postgres.html http://blog.sagemath.com/2017/02/09/rethinkdb-vs-postgres.ht... I've continued working on this codebase, even pushing commits this week like this one: https://github.com/sagemathinc/cocalc/commit/c20a62446b6e43cd56300d6f07808c76fd2d239b https://github.com/sagemathinc/cocalc/commit/c20a62446b6e43c...
- Deimorz 9y agoHaha, I actually just finished skimming through that exact blog post because it was one of the first things that came up when I searched for "postgresql changefeed" to see if there was some other functionality for doing it that I didn't know about. I'll definitely need to go back and read it more thoroughly later and take a look through your code, thanks for the links.
- chillydawg 9y agoYou could do it with pglogical, if you're feeling particularly adventurous.
- traverseda 9y agoThere isn't one. But there also isn't really a primary use case for postgres, as compared to mysql. It's just a pretty pleasant to use nosql database. Easy clustering, first-class changefeeds, a somewhat-confusing query-system, runs in the current working-dir by default means it's dead-simple to set up for development. No fire-and-forget write. Reminds me a bit of firebase, but free and open-source. If you're in a position where changefeeds or nosql are important, you should probably give rethinkdb a look.
- slap_shot 9y agoI think it's very tough to describe the "use case" for RethinkDB (I used it in production two years and have expressed that I don't think RethinkDB did exceedingly well at any particular use case to warrant being used over other solutions). It might be easier to list the differentiators in roughly the order they were introduced: JSON document storage ReQL Query Language JOINs Easy Deployment Administrative UI for monitoring, sharding, querying data Change feeds High Availability
- api 9y agoWe use it here (ZeroTier). Pros: - Very easy and robust clustering (Raft-based, automatic fail-over). This is huge for us. - Streaming change feeds. This one is also huge. Makes any kind of real-time, reactive, or event driven programming very easy and IMHO is something that should exist in every database. - It's kind of half SQL. It's a NoSQL document store but encourages a relational design and supports many relational queries. - Rational and pretty easy to understand query language. It's much cleaner than Mongo. - Easy to deploy and configure. - It passed the Jepsen tests before Mongo did and overall has a solid history of not losing data. Cons: - It's a CPU hog, at least when compared with PostgreSQL. - It's also an I/O hog, though we sponsored some improvements that are getting merged in the next version that will reduce this and also make table commit a configurable parameter. You'll be able to have fully and partially (long flush delay) in-memory tables for highly ephemeral data.
- CodesInChaos 9y agoHow do you handle the lack of transactions / atomic updates affecting more than one document?
- api 9y agoOur data model generally doesn't require this. We're actually okay with less guarantees than RethinkDB provides. AFIAK NoSQL stores in general are a bad choice if you need this. You should use a SQL database.
- manigandham 9y agoTo be clear, nosql vs sql doesnt mean much - use the right type of database for the scenario: relational, document, graph, key/value, etc. They all have various support for transactions with relational usually the most comprehensive.
- traverseda 9y agoNot OP, but I admit that's not a problem I've ever had. I've done a lot of webapps supporting data-science pipelines, and I've built some major components of those pipelines. It's not something I've felt the need for when I've used postgres. What do you use that for?
- fastball 9y agohttps://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis https://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis?
- chx 9y agoThat site is a gem: https://kkovacs.eu/cool-but-obscure-unix-tools https://kkovacs.eu/cool-but-obscure-unix-tools
- ubuntuftw 9y agoFor me, the real draw was how easy it is to setup a cluster with high availability and automatic failover. Having used MySQL in production on a mission critical web app for years, failing over between data centers and setting up replication again every time there was some kind of hiccup got very old very fast.
- overcast 9y agoIt's what MongoDB should have been. A relational document database, with changefeeds.