~/talk

Building Production Applications Using Go

Talkat GopherCon 2021 · 2021-12-05..12-08· [databases, serverless]
links:none on file
slides:none on file

Argues that using sqlite with Go can replace many client‑server setups: recommends go-sqlite3 (mattn) as the default driver, enables WAL journaling and sets busy_timeout=5000 and PRAGMA foreign_keys=ON, and uses in‑memory databases for testing. Reports single‑node point queries around 18µs vs ~900µs for same‑region Postgres, 10,000 tiny tests finish ~1.5s with a tailscale build while mattn’s global lock slows parallel tests to ~3s. Offers durability paths: simple hourly backups, lightstream to S3 for continuous WAL shipping, or rqlite/dqlite clusters.

AI-written summary · about

  1. 0:00Intro
  2. 0:17About me Ben Johnson
  3. 1:26Client/server & cloud databases
  4. 3:49What 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
  5. 6:35Connecting to SQLite import
  6. 7:27Configuring SQLite: Journal Mode • Journal mode configures how SQLite writes transactions . You almost always want it as "WAL" (write ahead log)
  7. 8:26Configuring 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.
  8. 9:09Configuring SQLite: Foreign keys • For historical reasons, foreign keys are not enforced by default. . Please use foreign keys.
  9. 10:00SQLite Type System
  10. 13:27Benchmarking SQLite tests
  11. 14:35Parallelizing in-memory SQLite
  12. 17:12The data durability spectrum How safe is your data?
  13. 19:07Improving data durability Trade-off of cost, complexity, & performance
  14. 20:14No 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
  15. 22:39Option #1: Regular backups Data durability in SQLite
  16. 23:59Litestream
  17. 26:28Clustered SQLite
  18. 28:17Performance between SQL databases How to choose?
  19. 29:12Benchmarking network latency point query performance 1000
  20. 31:48Horizontally scaling SQLite Thinking the unthinkable
  21. 37:02Conclusion Improved production experience
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.