Database Reference
In-Depth Information
Proof Is in the Pudding
So what do we actually use this scalable, distributed, resilient data store for? Like
most consumer-facing companies, we need to store data about our users: names,
phone numbers, e-mail addresses, and the like. We also store data about the jour-
neys our users are making and various other facets of taking taxi rides. This all
comes under the umbrella of simple entity data. For our entity data we generally
use ColumnFamilys with well-known columns, mapping an entity to a row and
fields to columns (see Listing 12.3 ). It's pretty simple stuff, and for developers
who are new to Cassandra, ColumnFamilys with predefined columns and appro-
priate secondary indexes provide a close analog to more familiar relational DBs.
This helps to soften the learning curve somewhat and enables developers who are
new to Cassandra to be productive, writing services that take advantage of it fairly
quickly.
Listing 12.3 Example Customer Record from Customers ColumnFamily
Click here to view code image
126007613634425612:
createdTimestamp: 1370465412
email: dominic@cruft.co
givenName: Dominic
familyName: Wong
locale: en_GB
phone: +447911111111
However, this isn't the only data we store. If it were, it would be pretty hard to
justify moving from MySQL to Cassandra and all the work that migration entails.
From the very beginning, we've tried to gather and record as much data about our
system as we can. Every time a passenger taps to hail a taxi, every time a driver ac-
cepts payment, every time a customer registers a new card, every time something
even vaguely interesting happens in our system, we record that event for future
reference. It's our belief that within all of this data valuable insights can be un-
covered, so we need to gather as much of that data as possible to give to our team
of data geeks to reveal the hidden patterns and knowledge. This invaluable know-
ledge can then be fed back in to improve our service for passengers and drivers
alike. This data gluttony means that we need a storage solution that can handle
ever-growing volumes of data in a sustainable way.
 
Search WWH ::




Custom Search