Week 6 - Databases in Cloud Computing Flashcards

(21 cards)

1
Q

Which of the following is NOT a NoSQL database?
A. MySQL.
B. Redis.
C. MongoDB.
D. Cassandra.

A

A. MySQL.

B. Redis. (key-value store NoSQL)
C. MongoDB. (document store NoSQL)
D. Cassandra. (a columnar NoSQL)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following is a NoSQL database type?
A. SQL.
B. Document store database.
C. JSON.
D. All of the above.

A

B. Document store database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following statement is WRONG?

A. NoSQL databases require schemas before you can add data.

B. NoSQL databases are built to allow the insertion of data without a predefined schema.

C. Transaction properties (ACID) in the traditional relational databases are not suitable
to be a set of properties to describe distributed NoSQL databases.

D. All of the above.

A

A. NoSQL databases require schemas before you can add data. (NoSQL databases
don’t require schemas)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

______ stores are used to store information about networks, such as social connections.

A. Key-value
B. Wide-column
C. Document
D. Graph

A

D. Graph

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

NoSQL databases are used MAINLY for handling large volumes of ______ data.

A. Unstructured
B. Structured
C. Both structured and unstructured
D. None of the above

A

A. Unstructured

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In NoSQL databases, where the implementation options consider CAP (Consistency,
Availability, and Partition Tolerance) criteria, which one of the following options is not
possible to be satisfied?

A. CA.
B. AP.
C. CP.
D. CAP

A

D. CAP. (NoSQL databases cannot achieve all three criteria at the same time according
to CAP Theorem.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the differences betwee NoSQL and SQL

A

Data Strucure: Tables with rows and col (SQL), Document based, kv, column family or graph based NoSQL)

Schema: needs rigid schema (SQL), Flexible schema (NoSQL)

Scalability: Vertically scalable - new hardware (SQL), horizontally scalable - new servers (NoSQL)

Data Integrity: ACID for SQL, Base for NoSQL

Query Language: SQL for SQL, and it varies for NoSQL

Performance: Efficient for complex queries and transactions (SQL), Better for large scale data and fast r/w (NoSQL)

Use Case: Best for transactional systems e.g. banking, ERP, etc (SQL), Ideal for big data, data lakes and real time web apps (NoSQL)’

Examples: MySQL, Postgress, Oracle, MS, Server (SQL), MongoDB, Cassandra, Neo4j, CouchDB (NoSQL)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the ACID properties? Name each of them

A

A set of properties of db transactions intended to guarantee validity even in the event of errors and power failures.

Atomicity: Each transaction treated as a single unit which either succeeds or fails.

Consistency: Ensures a transaction can only bring the db from one valid state to another, preventing db corruption by illegal transaction.

Isolation: Ensures concurrent executions’ of transactions leaves the DB in the same state as if the transactions were exec’d sequentially.

Durability: once a transaction is committed it will remain committed in the event of a system failure, recorded in non volatile memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the CAP Theorem?

A

That no distributed data store to simultaneously provide more than two out of the following 3 guarantees:

Consistency: Every read receives the most recent write or an error

Availability: Every request receives a (non-error) response - without the guarantee that it contains the most recent write.

Partition Tolerance: The system continues to operate despite an arbitrary number of messages being dropped or delayed by the network between nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the Base properties?

A

Basically Available: basic reading and writing operations are available as much as possible but without consistency guarantees (write may not persist)

Soft State: Without consistency guarentees after some time we only have some probability of knowing the state since it may not have converged yet.

Eventually Consistent: If the system is functioning we wait long enough after any given set of inputs we will eventually be able to know what the state of the database is and so any further reads will be consistent with our expectations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which two CAP characteristics do the following DB’s support?

Cassandra
HBase
MongoDB

A

AP
CP
CP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Based on the CAP theorem, select the most suitable focus for these applications

1 - Banking system
2 - Social Media Platform
3 - Search Engine
4 - Airlines Seat Reservation System

A

1 - CA
2 - AP
3 - AP
4 - CP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the 4 types of NoSQL dbs

A

Key Value Stores - Key is string and values can be different types, Redis

Document Stores - Similar to key value stores, but value is a document (nested values) MongoDB

Wide-Column (Column Family) Stores - collection of rows and columns, where each row has a unique key and each column has a name value and timestamp, Cassandra

Graph DB - Nodes and relationships (Edges) are the basis of graph databases, Neo4j

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is an AP database?

A

Availability and Partition Tolerance

  • Each client can always R/W
  • The system works well despite the physical partitions
  • clients may have inconsistent views on data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a CP database?

A

Consistency and Partition Tolerance

  • All clients always have the same view on the data
  • The system works well despite physical partitions
  • Clients sometimes may not be able to access data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a CA database?

A

Consistency and Availability

  • All clients always have the same view on the data
  • Each client can always read and write
  • The system may not tolerance to failure and reconfiguration
17
Q

What are the two most popular partitioning methods used in distributed DBMS and explain their main characteristics.

A

Vertical Partitioning:
- Each partition holds a subset of the fields for items in the data store
- frequent fields are place in on vertical partition (e.g. ProductName)

Horizontal Partitioning
- Each partition (aka shard) is a separate data store (a subset of the entire database)

18
Q

What is an example of a Key Value Store?

A

key is a string while value can be different types
- Redis

19
Q

What is an example of a Document store?

A

Similar to key value store, but value is a document (nested vaues)

  • MongoDB
20
Q

What is an example of a Wide-Column (Column-Family) stores?

A
  • A column family is a collection of rows and columns, where each row has a unique key and each column has a name, value, and timestamp
  • Cassandra, Hbase
21
Q

What is an example of a Graph Database?

A

Nodes and relationships (edges) are thee bases of graph databases
- neo4j