You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Rana Aich <ra...@yahoo.com> on 2010/07/01 22:33:46 UTC

How to import data from MYSQL to Cassandra

Hi,

Can someone please please throw some light how can I import the Data from mysql into Cassandra cluster.

- Is there any tool available?
OR
- Do I have to write my own Client using Thrift that will read the export file (*.sql) and insert the record in the database.

Thanks

raich



Re: How to import data from MYSQL to Cassandra

Posted by Paul Prescod <pa...@prescod.net>.
As Paul said, you need to re-build your data in a Cassandra-friendly
manner. Reading SQL files does not seem a very efficient way to do
that though. Most databases can output in much simpler formats, like
CSV. But then, why export at all? If the MySQL instance and the
Cassandra instance are both addressable over the same network, you
could just write a program that reads data from one, reorganizes it
and writes it to the other.

On Thu, Jul 1, 2010 at 1:33 PM, Rana Aich <ra...@yahoo.com> wrote:
> Hi,
>
> Can someone please please throw some light how can I import the Data from mysql into Cassandra cluster.
>
> - Is there any tool available?
> OR
> - Do I have to write my own Client using Thrift that will read the export file (*.sql) and insert the record in the database.
>
> Thanks
>
> raich
>
>
>

Re: How to import data from MYSQL to Cassandra

Posted by Paul Brown <pa...@gmail.com>.
On Jul 1, 2010, at 1:33 PM, Rana Aich wrote:
> Can someone please please throw some light how can I import the Data from mysql into Cassandra cluster.
> - Is there any tool available?
> OR
> - Do I have to write my own Client using Thrift that will read the export file (*.sql) and insert the record in the database.

None of the above.

With Cassandra, you need to store the data you want to retrieve, so your "import" is really an operation where you extract the data you have in your MySQL database, synthesize new data to be stored in Cassandra, and push that data into Cassandra using the client of your choice.

You need to go through the exercise of deciding what you want to retrieve, how to lay that out in a cluster, and then mapping your existing data onto that new model.

-- Paul