DEV Community

Ahmed Rakan
Ahmed Rakan

Posted on

Understanding the System 3: Databases

In the third episode of my “Understanding the System” series, we dive into one of the most essential building blocks of modern software systems: Databases.

Whether you're building a startup product, scaling a SaaS platform, or trying to optimize performance, how you handle data will either set you up for long-term success — or become a bottleneck. In this video, I break down the core concepts, failure points, and scaling strategies you need to understand to make smart database decisions.


🧱 Relational vs Non-Relational Databases

We start by understanding the two main types of databases:

  • Relational (SQL): Uses structured tables and schemas. Best for consistent, transactional data like financial systems and user accounts. Think PostgreSQL or MySQL.
  • Non-Relational (NoSQL): Flexible, schema-less data. Ideal for large-scale, fast-changing data like logs or analytics. Think MongoDB, Redis, or Cassandra.

💡 When to pick which? If you need strong consistency and well-structured data, go SQL. If you need speed and flexibility, NoSQL may be better.


⚙️ Core Concepts Every Engineer Should Know

  • ACID Transactions: These guarantee reliable data operations.
  • Normalization: Reduces redundancy in SQL databases.
  • ORMs (Object Relational Mappers): Helpful but may introduce performance issues (like the N+1 problem).
  • Caching: Improve performance by reducing direct DB hits (using Redis or Memcached).
  • Profiling Queries: Know where your bottlenecks are before scaling.

📈 Scaling Databases

As traffic grows, databases can become a bottleneck. The video explains:

  • Indexes: To speed up reads.
  • Replication: For high availability.
  • Sharding: Splitting data across machines.
  • CAP Theorem: The trade-off between consistency, availability, and partition tolerance.

🧪 Failure Modes and Migrations

I also touch on what can go wrong — from deadlocks to query spikes — and how to handle schema migrations safely using tools and versioning.


🎥 Watch the Full Breakdown

This blog is just a surface-level summary. The video goes into visuals, examples, and detailed explanations that help you understand databases from a system design perspective.

👉 Watch on YouTube (https://www.youtube.com/watch?v=tq68X1fv7vM)
🔔 Don’t forget to like, subscribe, and leave your thoughts in the comments.

Top comments (0)