ADO Lecture II 2024-26
ADO Lecture II 2024-26
Lecture II
MBA(DSDA) 2024-26, SCIT
ADO
Journey From
RDBMS to NoSQL (I)
ADO
• BigTable (Google)
• Amazon DynamoDB
• Hbase (Apache)
• Cassandra (Facebook)
BigTable
Column Store
A column store database can also be referred to as :
• Column database
• Column family database
• Column oriented database
• Wide column store database
• Wide column store
• Columnar database
• Columnar store
Column Store
A Schema in RDBMS
Column Store
A Schema in RDBMS
Column Store
Column Store
• Columns store databases use a concept called
a keyspace. A keyspace is kind of like a schema
in the relational model. The keyspace contains
all the column families (kind of like tables in
the relational model), which contain rows,
which contain columns.(Instance)
• For example, a keyspace can have column
families AuthorProfile, MemberProfile, Article,
Blog, and Question.
Column Store
Column Store
Column Store
Column Store Keyspace
Column Store
Column Store
• A column family consists of multiple rows.
• Each row can contain a different number of columns
to the other rows. And the columns don’t have to
match the columns in the other rows (i.e. they can
have different column names, data types, etc).
• Each column is contained to its row. It doesn’t span
all rows like in a relational database. Each column
contains a name/value pair, along with a timestamp.
Note that this example uses Unix/Epoch time for the
timestamp.
Column Store
Each Row
Column Store
• Row Key. Each row has a unique key, which is a
unique identifier for that row.
• Column. Each column contains a name, a value,
and timestamp.
• Name. This is the name of the name/value pair.
• Value. This is the value of the name/value pair.
• Timestamp. This provides the date and time that
the data was inserted. This can be used to
determine the most recent version of data.
Column Store
Each Row
Column Store
Keyspace
Column Store
KeySpace
Column Store
Super Column
StudentDetails={
Student1:{
username:{firstname:”Abc”,lastname:”wxy”}
address:{city:”Hinjewadi”,postcode:”411057”}
}
Student2:{
username:{firstname:”Def”,lastname:”xyz”}
account:{bank:”SBI”,accounted:”2212340005”}
}
Studentk:{
username:{firstname:”Def”,lastname:”xyz”}
account:{bank:”SBI”,accounted:”2212340005”}
marksheet:{sub1:40, sub2:98, ………, subN:75}
}
}
Column Store
Column Store
How to write the following for Column Store
Database?
rr
Column Store
How to write the following for Column Store
Database?
Contact
Rowkey::1 ContactID: 1X2B Cell-Phone: 9867 Email1: x@abc
234A ts: 123456780 ts: 123456789 Ts: 123456790
SSTable is: very simple, but also a very useful way to exchange large, sorted data
segments.
BigTable
Bigtable : Building Blocks
• Random writes are fast when the SSTable is in
memory.
• If the table is immutable then an on-disk
SSTable is also fast to read from
BigTable
Bigtable : Building Blocks
1. On-disk SSTable indexes are always loaded into
memory
2. All writes go directly to the MemTable index
3. Reads check the MemTable first and then the
SSTable indexes
4. Periodically, the MemTable is flushed to disk as an
SSTable
5. Periodically, on-disk SSTables are "collapsed
together"
BigTable
Bigtable : Building Blocks
• Bigtable relies on a highly-available and
persistent distributed lock service called
Chubby.
• A Chubby service consists of five active
replicas, one of which is elected to be the
master and actively serve requests.
BigTable
Bigtable : Building Blocks
• Bigtable uses Chubby for a variety of tasks:
– to ensure that there is at most one active master at
any time;
– To store the bootstrap location of Bigtable data
– To discover tablet servers and finalize tablet server
deaths
– To store Bigtable schema information (the column
family information for each table);
– and to store access control lists.
BigTable
Bigtable : Building Blocks
• If Chubby becomes unavailable for an
extended period of time, Bigtable becomes
unavailable.
BigTable
Bigtable : Building Blocks
• Time-series data, such as CPU and memory usage over time for
multiple servers.
• Marketing data, such as purchase histories and customer preferences.
• Financial data, such as transaction histories, stock prices, and
currency exchange rates.
• Internet of Things data, such as usage reports from energy meters
and home appliances.
• Graph data, such as information about how users are connected to
one another.
Cloud BigTable
https://cloud.google.com/bigtable/
Practice Question