Is RethinkDB the next DB singing on Meteor?

Just came across this great blog post from the RethinkDB Team:

http://rethinkdb.com/blog/realtime-web/

As far as my very limited understanding of the Meteor core goes, this must be a hell of a lot simpler to integrate than any other non-realtime database system out there. Not to mention SQL. Sure, the Mongo integration works (quite well actually with oplog tailing), but this seems to make all the brilliant efforts obsolete (Sorry, @glasser :wink: ).

Does anybody know of any recent community or even MDG efforts to get this flying?

3 Likes

There was a previous discussion on RethinkDB integration on the google group, https://groups.google.com/forum/#!msg/meteor-talk/TiehBRnJIWc/nazZKKravkIJ, and one (abandoned) attempt https://github.com/tuhinc/rethink-livedata

Indeed, the latests developments of RethinkDB makes it a perfect fit for Meteor. RethinkDB even indicated that they have talked with MDG when they designed their API. But what makes the integration of any non-MongoDB database with meteor especially difficult lies in the 3rd principle of the platform:

Database Everywhere. You can use the same methods to access your database from the client or the server.

Which basically means that we have to re-implement a full database on the client (minimongo, miniredis, minirethink, etc.), which is non-trivial. I wrote a suggestion about that a few months ago but didn’t had a chance to work on it since then.

So you are right, the RethinkDB changefeed API drastically simplify the server driver (no more oplog+pulling fallback) but the tricky part is the wire protocol (livedata) and the client “mini” database.

4 Likes

Oh yes, I remember reading that discussion last year. Great write, @mquandalle !

I absolutely agree we need some form of a general API for this. Let’s just not use the term “ORM”. We’re going to start a gunfire with that. :wink: But it seems there is no way around some sort of ‘mapping’, unless we want mini-* APIS for every DB to come. On the other hand, you might loose all the DB-specific features with such a mapping. It seems to be a dilemma… :confused:

I come from MySQL, I am difficult for relation/linking/embed of many collections on Mongodb.
I thinks that the RethinkDB is good, if have Meteor package for this.
+1

Maybe this conversation should be about how support for databases get implemented.

I have always wondered if MDG’s full stack DB approach is the best way to go instead of adopting a database language like LINQ or similar that de-couples the query language from the underlying database implementation.

While not perfect, one nice benefit of this approach might be that an app could target different backends based on unique repository features.

You might also rethink whether the client and server DBs necessarily have to be the same. Not sure if that would be good or bad.

I know I am glossing over some serious implementation details (so don’t shoot me) but I guess the question is “where do you want the complexity?”

Treating each DB as a full stack affair vs separating the DB implementation from the backend repository.

I sense some urgency from the community for MDG to support DBs other than Mongo and Redis, something relational. MySql, Sql Server, Oracle etc.

Was just pondering how building a separate full stack for each would be faster or easier to get to this end game vs building this common query language translation layer.

Just a thought.

2 Likes

Yes I believe we want to “de-couples the query language from the underlying database implementation”, and in a way this is already what we do. Indeed we use the same query language on the client and the server, but with different drivers/backends (in-memory vs polling vs oplog). Note that the query language we use in meteor is similar to mongoDB but not identical, for instance .fetch() or .observe() methods of a cursor do not exists in mongoDB. With that in mind, one approach we could take to integrate RethinkDB would be to translate minimongo queries into rql on the server, and to keep using minimongo on the client.

The question is more “What query language should we use?”. Interfacing the current query language (that’s is heavily inspired by mongoDB) to anything else (redis, rethinkdb, sqllite, neo4j, etc.), is somewhat tricky. But I’m not sure what the desired language would be here.

2 Likes

Exactly a month, RethinkDB 2.0 realtime capabilities has been released and would fit perfectly with Meteor! It’s probably a good timing for getting it works if anyone is interested.
https://news.ycombinator.com/item?id=9374927

1 Like

We should jump on this now.

Look great if happen :smile:

Bah never mind, their change-feeds STILL don’t support joins.

2 Likes

Hi – can you provide a link to explain this? I’m quite curious…thanks

1 Like

It’s happening! Go, @slava! :thumbsup: :thumbsup: :thumbsup:

11 Likes

wooooooooooooot

I am interested. :sunny:

Wow. This is awesome.

When they get reactive joins, then its go-time.

1 Like

Everyone in the Meteor community should go to their Github right now and spam that they want join support on changefeeds.

Here it is! Go +1 this thread!

Here’s the detailed article of new features they came out with on 2.0.

Change-feeds is what drives their realtime data pushes and it only works on certain queries. Changefeeds has been upgraded to support some more kinds of queries but JOINS is still in the works.

1 Like

A first version of the integration package has been released. Gotta start learning some ReQL now.

https://atmospherejs.com/simple/rethink

1 Like

@slava Super exciting, thanks for making this. Any word on what phase this is in (ie. alpha, beta, production-ready, full-api support, etc)