Originally published at Shipped Code .
Most app developers meet the database through an ORM. JPA, SQLAlchemy, Room or Drift hides it well until a list screen gets slow, a duplicate account appears or a migration fails on release day. The database knowledge that prevents those 3 problems is a short list, and you can learn it in the order below.
TL;DR. The 20% you use every day:
Model data with primary keys, foreign keys and constraints, so the database rejects bad rows.
Write joins and aggregates by hand, and log the SQL your ORM sends.
Read EXPLAIN ANALYZE and add the index your query needs.
Know what a transaction guarantees and which isolation level your code runs at.
Change the schema only through versioned migrations.
Apply the same rules to SQLite on the phone (Room, Drift).
Keep psql and one GUI client at hand.
Read replicas, sharding and a NoSQL primary store can wait until you measure a need for them.
What you'll learn:
what each of the 7 skills prevents, with one small schema you can…