Overview
Syllabus
Intro
About me Ben Johnson
Client/server & cloud databases
What applications are good for SQLite? • Originally used by embedded software • Improvements in concurrency have made it more general purpose . Great for read-heavy workloads • Small to moderate request loads (100's of requests/sec) . Honestly, most applications are good candidates
Connecting to SQLite import
Configuring SQLite: Journal Mode • Journal mode configures how SQLite writes transactions . You almost always want it as "WAL" (write ahead log)
Configuring SQLite: Busy timeout • Busy timeout sets how long write transactions will wait to start . If unset, writes will fail immediately if another write is running . I find that 5 seconds is a good amount of time.
Configuring SQLite: Foreign keys • For historical reasons, foreign keys are not enforced by default. . Please use foreign keys.
SQLite Type System
Benchmarking SQLite tests
Parallelizing in-memory SQLite
The data durability spectrum How safe is your data?
Improving data durability Trade-off of cost, complexity, & performance
No data loss is good ...but not all data loss is catastrophic . GitLab lost 6 hours of data in 2017 .Postgres primary replica configuration • Data deleted by operator error
Option #1: Regular backups Data durability in SQLite
Litestream
Clustered SQLite
Performance between SQL databases How to choose?
Benchmarking network latency point query performance 1000
Horizontally scaling SQLite Thinking the unthinkable
Conclusion Improved production experience
Taught by
Gopher Academy