Databases Flashcards
Database functionality to consider when choosing
- Scale
- Operations
- Replication
- Transactions
Themes associated with SCALE
- Vertical scaling
- Horizontal scaling
- Sharding
Themes associated with OPERATIONS (cost of operating a database)
- HW breakdowns
- SW upgrades
- EOL (End of Life)
- Tweaking
- Rebuild indexes
Themes associated with REPLICATION
- Read only replicas
- Disaster recovery replicas
Themes associated with TRANSACTIONS
- ACID
- CAP theorem
NoSQL vs SQL
todo
SQL DBs on the market (2020)
- Google’s Cloud Spanner “no compromise database”
NoSQL DBs on the market (2020)
todo
Google’s Cloud Spanner
Pros
- Relational semantics w/ Schemas, ACID transactions, SQL
- Horizontal scale (99.999% SLA) –> grow to arbitrarily large number of instances
Cons
- hard to “lift and shift” for migration
- application is responsible for a lot
more info: https://www.youtube.com/watch?v=rRVmg5t6TZs
RDBMS
Relational Database Management System
RDBMSs use SQL (and variants of SQL) to manage data in large tables.
e.g. MySQL, PostreSQL, Oracle DB, SQL Server
ORM
Object-relational mapping
A programming technique for converting data between incompatible type systems using object-oriented programming languages.
It’s the idea of being able to write queries (e.g. SELECT * FROM users WHERE email = ‘test@test.com’;) using the ORM paradigm of your preferred programming language (INSTEAD of using SQL)
“ORM” generally refers to a library qhich implements this technique.
https://blog.bitsrc.io/what-is-an-orm-and-why-you-should-use-it-b2b6f75f5e2a
Google Cloud Platform DB Options
In-Memory
- Cloud Memorystore (managed redis)
Non-relational
- Cloud Datastore/Cloud Firestore (serverless, document database service)
- Cloud Bigtable (Wide-column database service)
Relational
- Cloud SQL (Managed MySQL & PostgreSQL)
- Cloud Spanner (Scalable relational database service)
Object
- Cloud Storage (Object storage, data lake)
Warehouse
- BigQuery (Enterprise data warehouse)
Bigtable (Google Cloud)
non-relational cloud DB offered by google cloud. Super high throughput, low latency reads & writes
Good for IoT data, streaming data, time series data, backend store for graph stores.
- *Scaling: Horizontally scalable
- *Replication: eventually consistent
- *Queryability: point lookup or table scan