Database Reference
In-Depth Information
5. Deployment and Provisioning
Now that you have done a little development on the application and you have it
working in a development environment, it's time to think about what your produc-
tion environment is going to look like. In this chapter, we will cover the different
aspects of deploying Cassandra to production. These include choosing a replic-
ation factor and a placement strategy and understanding the various partitioners
available with Cassandra.
Keyspace Creation
When creating your keyspace, you need to decide on a few things: your data center
layout and your replication strategy. Your data center layout is part of a greater
set of considerations that get bundled into the category of replication strategy. In
short, you need to answer these questions: How many copies of your data do you
want, and where do you want to keep them? Much of this depends on your applic-
ation and your usage patterns. We will examine some of those considerations in
this chapter.
Replication Factor
Before we dive into making decisions about data center layout and strategy, we
should outline what replication means. Replication is simply the process of storing
copies of data in more than one place. This is done to ensure reliability and fault
tolerance. The replication factor refers to the number of copies of each row that are
stored. So if you have a replication factor of 3 in data center us-east, that means
you have three copies of each row. It is important to note that you don't have a
master set of data and then two additional copies. There is no primary or master
concept with Cassandra. Having three copies of the data means that you have three
copies of the data that are equally valued by the cluster.
There is really only one main rule that applies to setting a replication factor.
That rule is that the replication factor should not exceed the number of nodes in
the cluster. If the replication factor exceeds the number of nodes, writes are rejec-
ted. Reads continue to be served if the consistency level of the request can be met.
The key takeaway here is not to paint yourself into a corner by trying to be too
safe and having too many copies of your data before your data center has grown
to a size where it can handle the replication factor.
Search WWH ::




Custom Search