SQL databases (Postgres, MySQL, SQLite) store data in tables with rows and columns. You define a schema upfront — names, types, relationships — and query with SQL. They are great when structure matters: accounts, orders, invoices, anything where totals must be exact and joins are common.
NoSQL is an umbrella, not one product. Document stores like MongoDB hold flexible JSON-like records. Key-value stores like Redis are blazing fast for cache and sessions. Wide-column databases like Cassandra target huge scale. Each trades strict structure for flexibility or speed in specific cases.
Default to Postgres unless you have a clear reason not to. It handles JSON too, scales well for most startups, and powers more production apps than hype-driven choices. SQLite is perfect for local tools, mobile offline storage, and prototypes — zero setup, one file.
Choose MongoDB when your data shape changes often and nested documents match how you think about the problem — content catalogs, product configs with wildly different fields. Choose Redis when milliseconds matter and losing a cache entry is fine. Choose neither because a blog post said SQL is dead.
Managed cloud databases (RDS, Cloud SQL, Supabase, PlanetScale) handle backups, patches, and failover. Run your own only if you enjoy 3 a.m. disk alerts. Migrations version your schema changes — tools like Flyway, Liquibase, or Prisma migrate keep prod in sync with code.
You can use more than one. Postgres for truth, Redis for speed, Elasticsearch for search — common pattern. Start simple, measure slow queries, add indexes, then split only when data proves you need to. Database choice is important but not permanent; bad schema design hurts on any engine.