Skip to content
ML SystemPart 3: DataChapter 3
Data CH.03 ~30 min

Data Strategies

SQL vs NoSQL, Sharding, Replication, and ACID.

SQLNoSQLShardingReplicationACID
  • Understand ACID principles and their importance in financial systems.
  • Analyze when to implement sharding on a database.
  • Compare different NoSQL types (Document, Key-Value, Graph).
  • Design a data storage strategy that combines SQL and NoSQL.

01 Relational Databases (RDBMS) & ACID Viz

Definition

ACID

A standard for transactions that guarantees every database operation runs safely and consistently.

  • **Atomicity**: Transactions must succeed completely or fail completely.
  • **Consistency**: The database moves from one valid state to another valid state.
  • **Isolation**: Transactions running simultaneously do not interfere with each other.
  • **Durability**: Once data is stored, it remains even if the system crashes.

Normalization

The process of organizing data to reduce redundancy.

02 SQL Scaling Techniques: Replication & Sharding

Various techniques for scaling SQL databases.
TechniqueDescriptionWhen to Use
ReplicationCopy data to many serversHigh read traffic (read-heavy)
FederationSplit DB by functionSystem has clear modules (User, Product)
ShardingSplit tables horizontallyA single table is too large for one disk
DenormalizationAdd data duplicationNeed super-fast read performance

Various techniques for scaling SQL databases.

The Danger of Sharding

Sharding adds immense complexity to your application code. Do this only if other techniques (like replication or query optimization) are no longer sufficient.

03 The World of NoSQL: Flexibility & Massive Scale

  • **Key-Value**: Very fast, suitable for cache or sessions.
  • **Document**: Flexible, suitable for product data or user profiles.
  • **Wide-Column**: Good for large data (big data) that grows continuously.
  • **Graph**: Best for data with complex interconnections (social media).

Deeper InsightMost modern systems use both (Polyglot Persistence). Click to collapse

Key Takeaways

  1. 1ACID is the gold standard for transaction security in SQL databases.
  2. 2Replication improves read performance, while Sharding improves storage capacity.
  3. 3NoSQL offers easier horizontal scalability compared to SQL.
  4. 4The BASE pattern in NoSQL allows the system to continue functioning even if data is not fully synced.

CH.03

Chapter Complete

Up next:Efficiency

Chapter Progress

Reading
Exercise

Interact with the visualization

Quiz

Data Strategy Quiz

Test your understanding of relational databases, NoSQL, replication, and sharding.

Ready to test your knowledge?

5 questionsRandomized from pool70% to pass