Hasty Briefsbeta

Bilingual

Do you even need a database?

6 hours ago
  • #database
  • #benchmark
  • #performance
  • Databases are fundamentally files on a filesystem, and the key decision is whether to use a database's files or your own custom files.
  • For many early-stage applications, using custom files (like JSONL) with simple strategies (e.g., linear scans, in-memory maps, or binary search) can be sufficient and performant, often exceeding typical traffic needs.
  • Benchmark results show that in-memory maps offer the highest throughput (~97k-169k req/s), binary search on disk provides fast reads without loading all data into RAM (~40k req/s), and SQLite delivers consistent performance (~25k req/s) with SQL capabilities.
  • Most applications, unless they have tens of millions of daily active users or specific needs like complex queries, joins, or multi-process writes, may not require a full database initially.
  • SQLite can handle significant scale (e.g., ~90 million DAU) and serves as a practical upgrade path, while custom file approaches allow easy migration later if needed.