1

We've got a relatively low-traffic site (~1K pageviews/day) hosted on a single server, and expect it to grow significantly over the next few years.

I'm thinking of moving over to Rackspace CloudServer or EC2 and firing up 3 nodes (all on CentOS):

  • 2 x Web (Apache) - with loadbalancer
  • 1 x MySQL (for the Wordpress powered part)

The question is where to put Cassandra right now...

Should it sit on each Web node, or the MySQL node?

My thought right now is to put it on Web nodes. It's my understanding that Cassandra has the benefits of fault-tolerance (i.e. if we take a node down, the site is still operational). So even with only 2 nodes, we'd have that benefit as opposed to just putting it on the MySQL node.

Also, as we scale up and add another node, a cassandra instance can come along with it and the php can always run its queries on localhost. Is this a good idea?

2 Answers 2

0

One way to look at it would be identify what resources each app consumes and balance their usage across the nodes.

  • MySQL: Memory, Disk I/O, CPU
  • Apache: Memory, CPU
  • Cassandra: Memory, Disk I/O

From the above "back of a fag packet" i'd start with the premise Cassandra and Apache share, MySQL alone, and then pick holes in & refine that approach from that starting point.

2

Something to keep in mind, if you run Cassandra you'll want to decide between keeping everything inside the JVM and growing it as needed, or dropping in JNA and allowing your row cache to live in system memory.

Best practice these days is to run with JNA, because it also allows you to take snapshots with no memory footprint (since JNA permits java to set hard links), but once you start sharing non-JVM system memory between cassandra and other applications, you are likely to start crying silently to yourself in unguarded moments. If you can, consider running cassandra on separate machines.

But if not -- you only get fault tolerance in Cassandra if you have more than one node and your replication factor and consistency levels of reads and writes are properly calculated. For a three-node ring, if your main concern is fault-tolerance/data availability, I would set replication factor to 3 and your consistency level to ONE for reads and writes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .