Databases Flashcards

1
Q

What are snapshots?

A

An automated copy of the data in a database is made at regular intervals (every hour). A challenge however is that when snapshots are being taken, the data will be slow. Also, you will lose data that was created after the last snapshot,

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

What are transaction logs?

A

Transaction logs are used to record the fact that a transaction is set to occur as well as the information needed by the database server to recover the data back to a consistent state.

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

What is a standby?

A

A standby database is where you have another database with synchronous replication and a snapshot is taken from that DB. This is the first scenario where your database does not go down if the data center crashes as you can switch to the standby DB.

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

How can you increase availability?

A

Have multiple standbys in multiple AZs and multiple zones.

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

What is Recovery Point Objective (RPO) and Recover Time Objective (RTO) in the context of DB database failure?

A

RPO is the maximum acceptable time period of data loss. RTO is the maximum acceptable downtime.

E.g. you are running an app on a VM instance storing it’s data on a persitent data storage. You take snapshots every 48 hours and can manually bring it back up in 45 mins frmo the snapshot. Your RPO is 48 hours and RTO is 45 mins.

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

What is data consistency?

A

Synchronous data in multiple database instances

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

What does strong consistency mean and what does it mean for data speed?

A

Strong consistency means synchronous replication to all replicas. Because of constant replication, the data speed will be slow.

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

What does eventual consistency mean and when is it used?

A

Asynchroous replication. There’s a small lag of a few seconds before the change is made in all replicas. This is used when scalability is more important than data integrity e.g. for social media posts, a small lag doesn’t matter that much.

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

What is read-after-write consistency?

A

Inserts of data are immediately replicated but updates have eventual consistency

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

What are the 5 key considerations for choosing a database?

A

Fixed Schema or Schemaless?
Latency
Volume of transactions
Storage volume of data
What level of Atomicity and Consistency do you need in the data.

Atomicity is when there are more than 1 operation for a business event to take place like booking a seat on a flight. One operation is withdrawing funds and the other is reserving the seat. You shouldn’t have one without the other.

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

What are key characteristics of a relational database?

A

Has a predefined schema with tables and relationships between the tables.

Strong transactional capabilities e.g. ideal for banking apps.

Used for Online Transaction Processing and Online Analytics Processing

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

What are Azures relational database services?

A

Azure Managed SQL

Azure Managed MySQL

Azure Managed PostgreSQL

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

What is Azure’s analytics managed service?

A

Azure Synapse Analytics: A distributed data warehouse that provides big data analytics, data warehousing and data integration. Can run complex queries.

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

What is the key difference between OLAP and OLTP?

A

OLTP stores data in rows. This is because all the microtransactions can happen together in 1 row, they’re stored together.

OLAP stored data in columns which allows for high compressibility and better storage efficiency. Another difference is that you can store columns of data across different nodes or databases. This means you can execute simultaneous queries across different nodes.

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

What is the difference between relational and NoSQL databases? What is Azure’s NoSQL DB service called?

A

NoSQL has a flexible schema. There’s usually a trade off between “strong consistency and SQL features” to achieve “scalability and high performance”. E.g. Amazon’s ecom website is built on a NoSQL DB. Similar to social networks.

Azure’s NoSQL DB is Azure Cosmos DB.

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