Databases Reference
In-Depth Information
the servers within a data center, as well as across multiple data centers. For example,
in the “Rack Aware” policy, the first replica is placed at the first node on the ring
that belongs in another data center, and the remaining replicas are placed at the first
nodes on the ring in the same rack as the first. Succeeding nodes on the ring should
alternate data centers to avoid hot spots.
1.3.4
Handling Dynamics
Dynamics handling in Cassandra is similar to that in Dynamo with slight modifica-
tions. Cassandra employs Scuttlebutt [ 34 ], an anti-entropy, gossiped-based protocol
for membership control. A node A considers a node B failed if A cannot reach
B(evenifB is still responsive to some other node C ). Also, instead of having
only two status values, “up” or “down,” Cassandra calculates a value that represents
a suspicion level for each node. The status of a node depends on a configurable
threshold.
1.3.5
Querying
Cassandra provides an API of methods to access data, which is built entirely on top
of Thrift, a software framework for scalable cross-language services development
( http://thrift.apache.org ) . Some important functions are below:
￿
insert./: insert a column given name and value
￿
get./: retrieve by column name for a key
￿
m u ltiget./: retrieve by column name for a set of keys
￿
get slice./: retrieve columns or super columns by column name or a range of
names for a key
￿
get range slice./: a subset of columns for a range of keys
￿
m u ltiget slice./: a subset of columns for a set of keys; similar to get range
slice./ but allow non-contiguous keys
For a social network, a read request usually involves reading data for multiple
users (the requesting user and its friends), requiring a m u ltiget./ call. If data
storage does not preserve social locality, this call may result in having to contact
multiple servers, which is less efficient than if only one single server is contacted to
return all the relevant data. We discuss this issue in detail in the next chapter.
 
Search WWH ::




Custom Search