mvbl fst
mvbl fst

Reputation: 5263

MySQL app with Cassandra in mind

I am planning to make a web app which will eventually use Cassandra. But now that I don't have it and don't have server(s) to run it from, I'd like to start by using MySQL.

The question is, is it possible to structure data and queries in such a way that it would be fairly easy to later port it to Cassandra? Main idea, I guess, would be writing MySQL queries that would be possible to change to same Cassandra queries.

Maybe you have a better suggestion?

Upvotes: 2

Views: 757

Answers (1)

Chad Birch
Chad Birch

Reputation: 74588

Well, for the easiest transition, you probably just need to use MySQL as a key-value store. Cassandra allows a little more complexity than straight key-value (basically, it allows sub-keys), but that's going to be tricky to do in MySQL without making your eventual conversion efforts a lot harder.

So to use MySQL as a key-value store, that means you just create one table with two columns, key (which should be the primary key on the table) and value. value is probably going to need to be of type text, if you intend to store large amounts of data in it, but key could just be a varchar(255), unless you need large keys for some reason.

Then you just store any data under a key, and retrieve it back with its key, that's it. That'll be very simple to convert to Cassandra later.

Out of curiosity, why are you planning on using Cassandra?

Upvotes: 2

Related Questions