Title: 544
Tags: lec26

Q: What is the open source system most similar to Google's BigTable?
A: HBase

Q: How do HBase and Cassandra handle replication differently for N-times replicated data?
A: A row in HBase will belong to a single RegionServer, but that RegionServer will store that data in a N-times replicated HDFS file.
A row in Cassandra will belong to N different workers, each of which will store it in a single local file system (the local FS does not replicate it).
In other words: HBase replicates at the file system level, Cassandra replicates at the database level.

Q: HBase and BigTable are "versioned sparse tables" -- what does this mean?
A: There is not a fixed number of columns, and different rows can have different columns.  Looking up a cell is more like using a dictionary, something like table["row:column"].
Each cell may also have multiple versions, and if we want a specific one, we can use table["row:column:version"].
If we look at every possible combination of rows/columns in the table, many correspond to cells with no values -- in a normal database, these missing values would be represented as NULL and representing those NULLs would take a little storage/memory space.  In versioned sparse tables, no space is used to represent the missing values (hence "sparse").

Q: What happens to the regions an HBase RegionServer was responsible for if that server dies?
A: All of that dead server's files (which contain region data) should still be safely stored in HDFS, so other healthy RegionServers can be assigned to take over these regions.

Q: What is a Cassandra keyspace, and where is the data it contains stored?
A: A collection of tables.  Every keyspace has data spread across all workers in the cluster.

Q: Why might you want all data for a particular user to live in a single row in an HBase table?
A: A single row will belong to a single RegionServer, meaning requests for that users data will go to one server instead of many.

Q: At what granularity can a user specify the replication factor, in both HDFS and Cassandra?
A: HDFS: the user specifies replication per file
Cassandra: the user specifies replication per keyspace

Q: What is the primary key in a Cassandra table?
A: The combination of the partition key and cluster key.

Q: What about a row determines which Cassandra workers are responsible for that row?
A: The value in the partition key

Q: What determines the sort order of rows within a partition?
A: The values in the cluster key column(s)

Q: For what kinds of columns are the same values shared across many rows of data?
A: Two cases:
1. partition key
2. static column

Q: What are two systems that inspired the design of Cassandra?
A: Dynamo (from Amazon)
BigTable (from Google)
Both these published papers, but not source code.  Facebook designed Cassandra using the ideas in the papers, then open-sourced Cassandra.