Why don't you start off with a “single & small” Cassandra server as you usually do it with MySQL?

試著忘記壹切 提交于 2019-11-28 20:18:18

TL;DR;
You can even start with a single node, but you loose the highly available factor of c*.

Cassandra is built for systems that handle huge volumes of data, terabytes and in some cases petabytes. Many users typically switch from MySQL (and lots of other RDBMS) to Cassandra once they find that their current DB system can't handle the data load efficiently (querying gets slow, managing storage becomes challenging etc.)


Why 4-8GB gb of ram?

The 4-8 GB of ram is to do with the JVM and the size of ram on efficient garbage collection. The advice is stating not that you should start on 8 GB, but hat you shouldn't have more than 8GB

This doesn't mean to say that you cant use Cassandra to start up a single node on a very basic machine (some people actually have cassandra running on a raspberry pi).


Why do people recommend 3 nodes?

Availability is one of cassandra's main selling points. If you have 2 nodes with RF=2 then you cant perform writes if a single node goes down. If you have 3 nodes you can still perform both reads and writes.

The short answer is you absolutely can start with a single, small node.

What I think other people are getting at with suggesting you not do that is that you learn different things depending on how you configure your system.

A single node does not have high availability but if you're just starting to experiment with Cassandra then that's probably a non-issue. You won't get much exposure to how to do backups, how to tune things and obviously how to fail over...but in your case you likely don't care.

You will be able to learn about coding with and for Cassandra and if you're coming from a traditional RDBMS that's a much bigger and more important hurdle.

See if you like the data model. See if you like schema-free design. If you get past all that you can then worry about how to scale up.

WRT your other question: a single node Cassandra cluster, even running on a small machine, even if its sharing that machine with other services should be no more "dangerous" than running MySQL in a similar configuration.

People usually recommend starting out with atleast a 3 node cluster, (on dedicated servers) with lots & lots of RAM. 4GB or 8GB RAM is what they suggest to start with.

Cassandra hardware recommendations are usually for people who will have 100's of GB of data. You can get away with having less if you don't have a lot of data. You can tune the JVM down to only using a 512 MB or 1 GB heap in the cassandra-env.sh.

Can't we start off with Cassandra based apps just like MySQL. Starting with 1 or 2 VPS & adding more whenever there's a need?

Yes you can. But, if you want to get the most out of Cassandra you definitely want to start with at least two servers, three if you need be able to use QUORUM for consistency, and still support one node going down.

While I have never run a production system on servers that small, I have run a continuously available QA cluster on VM's with 4 GB RAM and 2 Cores. And for small data sizes I have seen others run clusters on as little as 2 GB of RAM.

The nice thing about Cassandra is that when you do need more, it is very easy to add new nodes to the cluster. And if you want to move your cluster to more powerful hardware, instead of just adding more, you can easily add the new bigger boxes, then remove the older small ones.

Update:
Here is a recent blog post about getting Cassandra to run with a 64 MB heap:

In response to the last part of your question

"Can't we start off with Cassandra based apps just like MySQL. Starting with 1 or 2 VPS & adding more whenever there's a need ?"

You could definitely start by writing apps on Cassandra. I built a banking application on top of cassandra and it worked well. I had a 6 node cluster and used Cassandra 1.1.Cassandra has tunable data consistency which varies from very strong consistency (transactions support) and eventual consistency.

You could definitely start with one VPS and scale up as you need. Cassandra is scalable and adding new nodes results in linear increase in performance.

For more you can watch this video :

http://www.youtube.com/watch?v=5qEoEAfAer8

Helpful links :

http://www.datastax.com/docs/1.1/initialize/cluster_init

http://www.datastax.com/2012/01/how-to-set-up-and-monitor-a-multi-node-cassandra-cluster-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!