Menu

I Built My Backend on SQLite. Then I Deleted It.

DEV Community: go·Abhishek Sharma·7 months ago
#TExfCJCD
#dev#class#code#highlight#strong
Reading 0:00
15s threshold

In Part 7 , I taught my server how to die gracefully. It felt production-ready. Auth, rate limiting, caching, clean shutdown — the API was doing real work.

I said Part 8 would be "Docker + Postgres." I was wrong. Postgres alone deserved its own post, because swapping the database under a running backend taught me more in a weekend than the three weeks before it.

Then I tried to run my tests in CI.

And everything broke.

The SQLite Honeymoon

When I started this project, SQLite was the obvious choice:

import _ "modernc.org/sqlite"

DB , err = sql . Open ( "sqlite" , "./data.db" )

One file. No server. No Docker. No connection strings. Pure Go driver — not even CGO. It felt like cheating. I built auth, entries, pagination, rate limiting, and caching all on top of a single .db file sitting next to my binary.

For 7 posts, SQLite carried this backend beautifully.

Then I wrote this in my GitHub Actions workflow:

- name : Run tests run : go test ./...

And the CI logs lit up red.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.