Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor.js possible with Cassandra instead of MongDB? [closed]

I'm at the start of a project to create a customer support system. For this system I've looked at Meteor.js, which looks very interesting. The thing is that we want to build the rest of our system using Cassandra.

So my question is as follows; can meteor.js also be used with Cassandra instead of MongoDB? Are there any ready pieces of code to do this, or would we need to write a substantial amount of compatibility code ourselves?

like image 235
kramer65 Avatar asked Feb 10 '14 13:02

kramer65


2 Answers

You can use any database you want with Meteor, but you'll lose three of the seven key benefits of the framework:

Database Everywhere. Use the same transparent API to access your database from the client or the server.

Latency Compensation. On the client, use prefetching and model simulation to make it look like you have a zero-latency connection to the database.

Full Stack Reactivity. Make realtime the default. All layers, from database to template, should make an event-driven interface available.

I use Redis and Postgres with Meteor, in addition to MongoDB. I use Meteor Methods to expose functions on the client to create, read, update and delete records in other databases.

Official support for Redis and other databases is on the Meteor roadmap, currently targeted for version 1.1. Meteor is currently at version 0.7.0.1, so that's probably not going to happen soon.

If you want to integrate another datastore like Cassandra more tightly with Meteor, you would probably start with Meteor's mongo-livedata module.

like image 97
mb. Avatar answered Oct 31 '22 14:10

mb.


There have been a few attempts to use Meteor with other DBs, see meteor-sql for the most interesting I know of. Generally, it shouldn't be difficult to create a wrapper for your DB that covers querying and takes care of reactivity. It's a large bit of work, but fairly easy one.

The difficulty rises significantly when you also want to use your DB for user accounts. Meteor account system uses Mongo heavily, and is blends with the rest of the platform so much that it would be quite difficult to replace it. So you'd need a workaround: either low-level wrapper that would convert Mongo queries to Cassandra queries, or dual DB (Mongo for users, Cassandra for data), or something similar.

like image 39
Hubert OG Avatar answered Oct 31 '22 14:10

Hubert OG