Blog topic
Building software
Notes from building websites and tools.
8 postsNewest first
Building software
RPC vs REST: what's the difference, and which should you use?
RPC calls a named procedure on a server; REST sends requests to resources through HTTP's uniform interface. A side-by-side comparison with gRPC and JSON-RPC examples, from Fielding, RFC 9110 and the specs.
Beginner10 min read
- API
- RPC
- REST
- gRPC
- JSON-RPC
- HTTP
Building software
WebSocket vs SSE vs polling: how each works and when to use it
Polling sends a new request each round, SSE holds one response open for server events, WebSocket upgrades to two-way frames. Reconnects, proxies and firewalls.
Intermediate9 min read
- WebSocket
- Server-Sent Events
- SSE
- Long Polling
- HTTP
- Reverse Proxy
- nginx
Building software
How do OAuth 2.0 and OpenID Connect differ?
OAuth 2.0 gets an app an access token to call an API; OpenID Connect adds an ID token that says who signed in. The code flow with PKCE, request by request.
Intermediate7 min read
- OAuth 2.0
- OpenID Connect
- PKCE
- Authentication
- Authorization
- Tokens
Building software
How do Docker and Kubernetes differ, and when do you need Kubernetes?
Docker builds images and runs containers on one host. Kubernetes runs them across many nodes, schedules Pods, keeps replica counts and exposes Services.
Beginner5 min read
- Docker
- Kubernetes
- Containers
- Docker Compose
- OCI
- DevOps
Building software
What is a database index, and why is my query slow?
An index is a separate structure that lets PostgreSQL find rows without reading the whole table. B-trees, Seq Scan vs Index Scan, EXPLAIN ANALYZE, write costs.
Intermediate10 min read
- PostgreSQL
- Database
- Index
- B-tree
- EXPLAIN
- Query Performance
Building software
JWT or session cookies: which should you use?
A session cookie keeps state on the server; a JWT carries signed claims. Compared on revocation, browser storage, XSS, CSRF and the cookie attributes to set.
Intermediate7 min read
- JWT
- Cookies
- Sessions
- XSS
- CSRF
- Web Security
Building software
How do offline-first apps keep working without a connection?
Offline-first apps write to a local database first and sync through a queue. One save step by step, plus retries and conflicts, from Android, Flutter and MDN.
Intermediate9 min read
- offline-first
- sync
- IndexedDB
- Service Worker
- WorkManager
- Flutter
- HTTP
Building software
How do HTTP/1.1, HTTP/2 and HTTP/3 differ?
All three share the semantics in RFC 9110. HTTP/1.1 sends text over TCP, HTTP/2 sends binary frames over one TCP connection, HTTP/3 runs on QUIC over UDP.
Intermediate9 min read
- HTTP
- HTTP/2
- HTTP/3
- QUIC
- TCP
- TLS
- Firewalls