Database Reference
In-Depth Information
which we will explore later in the chapter. Instead, Cassandra creates a tombstone , which
encodes the knowledge that a certain value was deleted at a certain time. Understanding
tombstones is crucial to avoiding certain performance-killing Cassandra anti-patterns.
With a solid understanding of how Cassandra distributes data and a keen eye on how
those mechanisms affect our work as application developers, you'll be fully prepared to
build highly scalable, efficient, and fault-tolerant applications using Cassandra. In this
chapter, you will study:
• How Cassandra distributes data in a multi-node cluster
• How Cassandra replicates data
• The difference between immediate consistency and eventual consistency
• The tradeoff between consistency and availability
• How and when to tune consistency
• How Cassandra resolves conflicting writes
• How to provide your own timestamp when writing data
• How and why Cassandra uses tombstones for data deletion
• Writing expiring data using TTLs
Note
A Word About Examples
In the preceding chapters, we've consistently used hands-on examples in the MyStatus ap-
plication to demonstrate the features of Cassandra under discussion. In this chapter, we
will be covering concepts whose effects are largely transparent to an application under
normal circumstances. For that reason, much of the material in this chapter will consider
specific scenarios—usually adverse ones—in a multi-node cluster, which can't be easily
demonstrated using the single-node development cluster you set up in Chapter 1 , Getting
Up and Running with Cassandra .
The material in this chapter isn't entirely hands-off: you'll get a chance to play with
timestamps and TTLs and observe their effects in the cqlsh console. But most of this
chapter is devoted to developing a mental model of how your data behaves in a production
environment, so you'll need to use your imagination a bit, amply aided by diagrams and il-
lustrations.
Search WWH ::




Custom Search