Building a personal API with Go and DynamoDB

I’ve been wanting a single API to back all of my personal projects for a while. Something lightweight, cheap to run, and fast enough that I never think about it. The answer was a Go binary on Lambda with DynamoDB as the data store.

Why Go on Lambda

Go compiles to a single binary with no runtime dependencies. Cold starts on Lambda are measured in single-digit milliseconds. Compare that to Python or Node where you’re paying for interpreter startup and dependency loading every time. Lambda is often 2-3s+ and upwards of 7s.

The DynamoDB single-table design keeps things simple. One table, partition key overloading, and a GSI for queries I actually need. No ORM, no migrations, just PutItem and Query.

The routing layer

I kept routing dead simple. A small handler map in main.go that dispatches based on the API Gateway event path. No framework, no middleware chain. If I need auth later I’ll add it, but for a personal API that serves public data, it’s unnecessary complexity.

What it powers

Right now the API backs:

  • The reading page on my blog (live book data)
  • Lift data from the Strong app (manual export from the app with auto-import)
  • Link bookmarks
  • Status updates
  • Webhooks
  • Diary endpoint
  • General logging endpoint

All of these are just different partition key prefixes in the same DynamoDB table. Reads are fast, writes are cheap, and I never think about scaling.

The whole thing deploys via GitHub Actions - push to main, build the binary, zip it, upload to Lambda. Super cheap and simple.