How to export data from Cassandra to mongodb?

I am using Apache (Kafka-Storm-Cassandra) for realtime processing. The problem I'm running into is that I can't use aggregated queries directly on Cassandra (Datastax can be used, but it's a paid service). I've also considered using mongodb, but that's not good for more frequent writing. So, I'm going to do all my calculations in the storm and store it in Cassandra and move it hourly or so that mongodb does my further analytics.

Is this the correct approach or are there any better options to achieve this?

Also, How can I export data directly from Cassandra to mongodb prefebly using JAVA?

      

Thanks in advance!

+3


source to share


1 answer


Without knowing your full requirement, the number of inserts / updates that are impossible to predict is a good or bad approach. Mongo is less preferable for heavy recordings, but it can support a good one. from inserts. It is so important how many letters you have per unit of time and based on this you can make a decision.

I've seen Mongo take up to 1000-2000 writes per second with a weighted average of 4-5ms on server class machines. Sure, Cassandra beats it on margin, but if you need to do any aggregation then Mongo has the best framework and possibilities.

Flat csv can be used for export and import. Cassandra can export data to csv and MongoDB can import data from csv with export / import options.



Check MongoImport and for export from cassandra, an example might be,

copy employee (emp_id, dept, designation, emp_name, salary)
 to 'employee.csv';

      

+4


source







All Articles