Cassandra Node.js ORM best practices
Asked Answered
R

3

6

Currently we're using cassandra with cassandra-driver, doing standard queries and accessing "raw" results in our DAL and BL layers. Our application should support millions of users, each request in average dose 3 reads from the DB, we have about 30 models.

We are thinking about using some kind of ORM library, map the models our own and handle each raw in a representative object, or simple functions to handle the get, set and creation for each model(raw data). Our use cases are manly for encapsulating the handling of "raw" data structure, avoiding code duplications, preventing schema structure mistakes and enforcing validations. We manly wonder about the impact on performance, future flexibility and lack of ORM lib/framworks popularity.

It will be helpful to get best practices (and references) in this subject, as we don't really know what's the impact using ORM layer over cassandra.

Recite answered 9/2, 2016 at 11:31 Comment(0)
A
2

Depending on how soon you need this, I'd like to point you to this ticket on the DataStax Node.js driver JIRA https://datastax-oss.atlassian.net/browse/NODEJS-144

Shortly said, we are planning to add support for a mapper directly in the driver and in the future determine how to best integrate with other Node.js mappers.

Aggression answered 10/2, 2016 at 6:36 Comment(1)
It'll be very helpful to have a one integrated in the driver, but this issue is not highly important for us. My question was more about if to use the mapper is a good idea in the first place, it would be helpful if you could address the subject as well.Recite
O
2

You may want to have a look at express-cassandra, a NodeJS ORM that supports many popular Node frameworks.

It automatically loads your models, creates the appropriate tables in cassandra if needed and binds several convenient CRUD operations for your models. It supports latest cassandra 3 features too.

Disclaimer: I'm the author of this node module.

Overlying answered 28/2, 2016 at 10:25 Comment(0)
P
1

Cassandra-co is an actively maintained modern ORM for Cassandra and node.js used at scale in production.

Disclaimer: I'm the author

Phalansterian answered 14/6, 2016 at 16:26 Comment(2)
have you abandoned the project? I was interested in same question but no new commits for last 6 years.Ultramontanism
@Ultramontanism yes, sadly, because I'm not using it anymore. Feel free to fork it.Phalansterian

© 2022 - 2024 — McMap. All rights reserved.