express-cassandra | Cassandra ORM/ODM/OGM for Node.js with optional support

 by   masumsoft JavaScript Version: 2.9.0 License: LGPL-3.0

kandi X-RAY | express-cassandra Summary

kandi X-RAY | express-cassandra Summary

express-cassandra is a JavaScript library typically used in Big Data, MongoDB applications. express-cassandra has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has low support. You can install using 'npm i tyb-express-cassandra' or download it from GitHub, npm.

Express-Cassandra is a Cassandra ORM/ODM/OGM for NodeJS with Elassandra & JanusGraph Support. No more hassling with raw cql queries from your nodejs web frameworks. Express-Cassandra automatically loads your models and provides you with object oriented mapping to your cassandra tables like a standard ORM/ODM. Built in support for Elassandra and JanusGraph allows you to automatically manage synced elasticsearch and janusgraph indexes stored in cassandra. Express-cassandra enables your nodejs app to manage a highly available distributed data store capable of handling large dataset with powerful query features powered by cassandra, elasticsearch and janusgraph combined. Express-cassandra empowers you to manage and query this truely distributed datastore with search, analytics and graph computing functionality from nodejs like you are just dealing with javascript objects and methods. Models are written as javascript modules and they automatically create the underlying db tables, indexes, materialized views, graphs etc. Afterwards you can save, update, delete and query your data using supported model methods. It's decoupled nature allows you to use it with many popular node frameworks without much hassle. If you are using elassandra, then saved data in cassandra automatically syncs with elasticsearch indexes defined in your schema. You can then do any query elasticsearch indexes support. If you are using janusgraph, then you can easily manage your graphs and graph indexes. Creating vertices and edges become simple function calls. You can then do any graph query the tinkerpop3 gremlin query language supports.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              express-cassandra has a low active ecosystem.
              It has 188 star(s) with 66 fork(s). There are 14 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 30 open issues and 176 have been closed. On average issues are closed in 98 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of express-cassandra is 2.9.0

            kandi-Quality Quality

              express-cassandra has 0 bugs and 0 code smells.

            kandi-Security Security

              express-cassandra has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              express-cassandra code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              express-cassandra is licensed under the LGPL-3.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              express-cassandra releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of express-cassandra
            Get all kandi verified functions for this library.

            express-cassandra Key Features

            No Key Features are available at this moment for express-cassandra.

            express-cassandra Examples and Code Snippets

            No Code Snippets are available at this moment for express-cassandra.

            Community Discussions

            QUESTION

            Unable to execute a timeseries query using a timeuuid as the primary key
            Asked 2019-Sep-19 at 18:26

            My goal is to do a sum of the messages_sent and emails_sent per each DISTINCT provider_id value for a given time range (fromDate < stats_date_id < toDate), but without specifying a provider_id. In other words, I need to know about any and all Providers within the specified time range and to sum their messages_sent and emails_sent.

            I have a Cassandra table using an express-cassandra schema (in Node.js) as follows:

            ...

            ANSWER

            Answered 2019-Sep-19 at 18:26

            So while not having used Express-Cassandra, I can tell you that running a range query on your partition key is a hard "no." The reason for this, is that Cassandra can't determine a single node for that query, so it has to poll every node. As that's essentially a full scan of your table across multiple nodes, it throws that error to prevent you from running a bad query.

            However, you can run a range query on a clustering key, provided that you are filtering on all of the keys prior to it. In your case, if I'm reading this right, your PRIMARY KEY looks like:

            PRIMARY KEY (stats_date_id, created_at)

            That primary key definition is going to be problematic for two reasons:

            1. stats_date_id is a TimeUUID. This is great for data distribution. But it sucks for query flexibility. In fact, you will need to provide that exact TimeUUID value to return data for a specific partition. As a TimeUUID has millisecond precision, you'll need to know the exact time to query down to the millisecond. Maybe you have the ability to do that, but usually that doesn't make for a good partition key.

            2. Any rows underneath that partition (created_at) will have to share that exact time, which usually leads to a lot of 1:1 cardinality ratios for partition:clustering keys.

            My advice on fixing this, is to partition on a date column that has a slightly lower level of cardinality. Think about how many provider messages are usually saved within a certain timeframe. Also pick something that won't store too many provider messages together, as you don't want unbound partition growth (Cassandra has a hard limit of 2 billion cells per partition).

            Maybe something like: PRIMARY KEY (week,created_at)

            So then your CQL queries could look something like:

            Source https://stackoverflow.com/questions/58004388

            QUESTION

            All cassandra materialized views unconfigured table
            Asked 2019-Apr-25 at 09:10

            So I have the following setup, I have a 8 servers on a local network, each of them running cassandra. 2 of the servers are seed nodes and rest are just regular nodes. If I run nodetool status, everything shows up correctly and all nodes are UN.

            I have a express.js application that is running express-cassandra. It has plenty of tables and materialized views (70 in total), I have to restart the express server multiple times, for the cassandra keyspace to be populated with the tables, otherwise it will just stop populating at some point. After the tables are created, I can access all standard tables just fine, but when I try to access any of the materialized view tables, I keep getting error about unconfigured table - InvalidRequest: Error from server: code=2200 [Invalid query] message="unconfigured table ...

            Also, if I run my application, all queries to the materialized views fails.

            It seems like the database creation process keeps corrupting (due to the reason I have to restart express server to make sure that all tables are created). If I just start the express.js server and leave it running, it will stop creating tables at around 20 tables (I left it running for around 2 hours without any table created). If I restart it, it will again create few tables, and then again stop. And so on, until I have created all tables.

            Also, when I try to do repair on that keyspace (which is created by express-cassandra), I keep getting failure to connect to one of the nodes, although nodetool status shows it's up.

            ...

            ANSWER

            Answered 2019-Apr-25 at 09:10

            Posting an answer here, just so if anyone else receives similar issue is aware what is causing that.

            I had an issue with materialized view name - it was too long. Unfortunately express-cassandra does not provide any information about materialized view length in meaningful way.

            Did not try the exact length but it was greater than 70 characters.

            Source https://stackoverflow.com/questions/54108534

            QUESTION

            Error with multi-node cassandra setup + connection
            Asked 2019-Apr-25 at 09:06

            So I'm trying to setup multi-node cassandra cluster.

            I've setup 3 cassandra nodes on 3 different servers. In all of the three cassandra.yaml files, I've defined the same one seed node. After clearing the data and restarting the services one by one, I can see them showing up and the nodetool status shows UN for all entries. Now I use express-cassandra for connecting to the cassandra, and that works just fine, but it only works for the first few queries and afterwards, it just crashes with the following error -

            Error during find query on DB -> ResponseError: Server failure during read query at consistency ONE (1 responses were required but only 0 replicas responded, 2 failed)

            It does not matter on which read query it fails, but it's up for like 10 seconds and then it dies. Sometimes it dies on queries which were successful on previous run. Also, I'm just wondering, why it says that 2 failed, if there are 3 nodes (one seed node)?

            I noticed, that express-cassandra notified that the Replication factor has been changed and to run the nodetool repair, but there I keep getting the following error message -

            Validation failed in /xxx.xxx.xxx.xxx (progress: 0%) [2018-07-02 08:10:33,447] Some repair failed

            Where xxx.xxx.xxx.xxx is one of the three node IP addresses. I tried to run the nodetool repair on each of the nodes, but I keep getting identical errors on each of the servers.

            These are my express-cassandra setup properties (xxx.xxx.xxx.xxx is my seed ip address):

            ...

            ANSWER

            Answered 2019-Apr-25 at 09:06

            Providing an answer here, just in case anyone else struggles.

            The issue was related to the NetworkTopologyStrategy. I switched to SimpleStrategy, and it started to work.

            I had just one DC.

            Not sure, what exactly was causing the issue, but if anyone is aware, feel free to add it in comment, and I'll update the answer.

            Source https://stackoverflow.com/questions/51131162

            QUESTION

            Querying Cassandra with UUID from NodeJS
            Asked 2018-Nov-17 at 17:01

            Thank you for taking the time to look at my issue. My team and I just started dabbling with NodeJS and this is the first time we have run into a problem that we cannot find a solution for ourselves thus far.

            Simply put, we have a Controller that needs to query Cassandra with a UUID primary key.

            Controller:

            ...

            ANSWER

            Answered 2017-Mar-21 at 09:02

            Uuid type should be queried without quotes (").

            I'm not a NodeJS specialist, but maybe you should use cassandra type uuid?

            There's Datastax article on uuid:

            http://docs.datastax.com/en/developer/nodejs-driver/latest/features/datatypes/uuids/

            Source https://stackoverflow.com/questions/42905893

            QUESTION

            Express-Cassandra OperationTimedOutError while creating tables
            Asked 2018-Mar-10 at 10:05

            I am using express-Cassandra ORM and DB operation with Cassandra.

            Env: version: 2.1.1 nodejs 8.9.1 cassandra : 3.9 Cent OS: 6.0

            Facing this issue, when running nodejs while initializing models in Cassandra and I need to restart nodejs multiple time to initialize all the modules.

            Getting timeout error: cause: { apollo.model.tablecreation.dbindexcreate: Error while creating index on DB Table -> NoHostAvailableError: All host(s) tried for query failed. First host tried, 127.0.0.1:9042: OperationTimedOutError: The host 127.0.0.1:9042 did not reply before timeout 12000 ms. See innerErrors

            So after restart mulitpel time I am able to complete cassandra initialisation.

            and How can I resolve this or how can I find where are more logs and what is this inner error?

            Thanks, James

            ...

            ANSWER

            Answered 2018-Mar-10 at 10:05

            You may need to use socketOptions.readTimeout in your clientOptions like the following:

            Source https://stackoverflow.com/questions/49156978

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install express-cassandra

            For apache cassandra version 4.x, 3.x or datastax enterprise. For elassandra version 5.5.x. For janusgraph version 0.2.x. For older cassandra 2.x (no longer supported). Please note that if you use the legacy cassandra 2.x compliant version then please use the corresponding README.md file for that version. The following documentation is for version 4.x, 3.x and datastax enterprise 6.x/5.x only. The materialized view support and several other part of the documentation is strictly applicable for cassandra 4.x/3.x or dse 6.x/5.x and will not work in earlier versions of cassandra.

            Support

            This module internally uses cassandra-driver.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i express-cassandra

          • CLONE
          • HTTPS

            https://github.com/masumsoft/express-cassandra.git

          • CLI

            gh repo clone masumsoft/express-cassandra

          • sshUrl

            git@github.com:masumsoft/express-cassandra.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link