Column Family DBs

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/71

flashcard set

Earn XP

Description and Tags

Week

72 Terms

1
New cards

What is a column family DB?

A NoSQL DB that organizes data into column families instead of relational rows

2
New cards

What’s another name for it?

No. The terms are similar but the construction is very different

3
New cards

What is the smallest unit of storage?

A column, similar to an RDBMS cell

4
New cards

What are a column’s 3 elements?

1. Name (e.g. LastName),

2. Value/datum (e.g. Able),

3. Timestamp recording when the value was stored

5
New cards

What is a super column?

A set of grouped columns

6
New cards

What is a column family?

A group of columns arranged in rows.

Similar to a relational table

7
New cards

What identifies each row?

A Row, Key, similar to a primary key

8
New cards

Must every row have the same number of columns?

No. Rows can have different columns

9
New cards

What is a keyspace?

Contains all column families and provides the set of valid row key values

10
New cards

What is a super column family?

Like a column family, but built from super columns instead of columns

11
New cards

How many hierarchy levels can a super column family have?

Only one extra level of grouping, no deeper

12
New cards

How many hierarchy levels can a super column family have?

Only one extra level of grouping, no deeper

13
New cards

Can rows skip supercolumns?

Yes. Rows can include or omit any supercolumn

14
New cards

What is a keyspace?

The top-level data structure. One per application. Contains column families and row keys. Analogous to the database/schema

15
New cards

What does a row key do?

Uniquely identifies a row. Also partitions and orders the data

16
New cards

Why does the row key matter for distribution?

The DB is distributed, so the row key decides which storage server holds the data

17
New cards

What does a column store?

A single data value: name, value, timestamp

18
New cards

What is a column family, component-wise?

A collection of related columns, analogous to a table

19
New cards

How do column families differ from tables?

Columns vary by row, are kept in a predefined order, and are versioned by timestamp

20
New cards

Why are timestamps needed?

Column family DBs are BASE, not ACID, so timestamps help achieve eventual consistency

21
New cards

Column family ≈ what in key-value DBs?

The namespace

22
New cards

Column family ≈ what in an RDBMS?

A table

23
New cards

What’s similar to document DBs?

Queries can select subsets of row’s data, and columns (fields) can be added as needed

24
New cards

What similar to relational DBs?

Unique row identifiers, tabular data, and keyspace ≈ database

25
New cards

What do column family DBs NOT support?

Typed columns, transactions, joins, subqueries

26
New cards

What do they use instead of joins?

Denormalization

27
New cards

No JOINs or subqueries: what’s the solution?

Denormalize and use query-driven modeling

28
New cards

What is query-driven modeling?

One table per type of query. Duplicate data so each query is answered from one table

29
New cards

What’s the read/write tradeoff?

Writes are expensive. Reads are very fast

30
New cards

What’s the core philosophy?

Trade storage space and write-time work for blazing fast reads

31
New cards

No transactions: what’s the solution?

Lightweight transactions, batches, idempotency

32
New cards

What is idempotency?

Running the same operation multiple times doesn’t corrupt the DB. Lets you retry safely after a network failure

33
New cards

What level of atomicity is supported?

Changes to a single row in a single table are atomic. No multi-table transactions (e.g. bank transfers across tables)

34
New cards

What is a lightweight transaction?

Check before writing, like Cassandra’s CompareAndSwap

35
New cards

What is a logged batch?

An entire batch that’s atomic: all or nothing

36
New cards

What’s the transaction philosophy?

Prioritize high availability and speed over instant global consistency, per CAP

37
New cards

No typed columns: what’s the solution?

Flexible metadata and modern CQL

38
New cards

How are new columns added?

Just add them. No type checking, so it’s fast

39
New cards

Do unused columns take up space?

No

40
New cards

What are the 2 architecture types?

Multiple node types (HBase) and peer-to-peer (Cassandra)

41
New cards

What node types does HBase use?

Name nodes, data nodes, region servers, master, and Zookeeper (coordination)

42
New cards

What’s the weakness of HBase’s architecture?

Zookeeper can be a single point of failure, and it needs more administration

43
New cards

What’s the upside of multiple node types?

Servers can be specialized for tasks. Built on the Hadoop framework

44
New cards

How does Cassandra’s peer-to-peer work?

All nodes run the same software. No master node

45
New cards

Benefits of peer-to-peer?

Simplicity, no single point of failure (SPF), scalability

46
New cards

What is gossiping?

A node sends messages containing info about other nodes

47
New cards

What is anti-entropy?

Keeps replicas up to date using hashes of the data, for data integrity

48
New cards

What is a hinted handoff?

The proxy node holds a write while the target node is unavailable, then delivers it later

49
New cards

What is HBase?

An open-sourced, distributed, scalable, versioned, non-relational big data store

50
New cards

What is HBase modeled after?

Google’s Bigtable

51
New cards

What does HBase run on?

Hadoop and HDFS

52
New cards

HBase consistency?

Strictly consistent read and writes

53
New cards

HBase sharding?

Automatic and configurable

54
New cards

Failover?

Automatic failover between RegionServers

55
New cards

What speeds up real-time queries?

Block cache and Bloom filters

56
New cards

What other HBase features should I know?

Supports MapReduce jobs, Java API, server-side filters (predicate push-down), Thrift and REST gateways, JRuby shell, metrics export

57
New cards

What is Cassandra?

A free, open-source, distributed wide-column store for large data across many commodity servers

58
New cards

Can it span datacenters?

Yes, clusters can span multiple datacenters

59
New cards

What query language does it use?

CQL (Cassandra Query Language)

60
New cards

What are Cassandra’s key features?

High availability, eventual consistency, asynchronous masterless replication, fault tolerance, scalability

61
New cards

What’s Cassandra’s main claim?

No single point of failure

62
New cards

What are hosted versions?

AstraDB, Amazon Keyspaces

63
New cards

Keyspace ≈ ?

Database/schema. Also defines the replication strategy and factor across datacenters

64
New cards

Column family ≈ ?

Table, but columns are dynamic and rows can vary

65
New cards

What’s in a Cassandra column?

A typed key-value pair: name, value, internal timestamp

66
New cards

How is data placed on nodes?

Each node gets a token, Data is hashed to the matching node

67
New cards

What is the replication factor (RF)?

The number of distinct nodes each piece of data is stored on

68
New cards

Why is placement topology-aware?

For fault tolerance

69
New cards

How are nodes connected within a datacenter?

A Clos network, specifically a 2-tier Fat Tree (Spine-Leaf)

70
New cards

What is a CQL?

A simple interface for accessing Cassandra

71
New cards

Which language drivers exist?

Java (JDBC), Python (DBAPI2), Node.js (DataStax), Go (gocql), C++

72
New cards

Where is replication defined?

At the keyspace level