funcArticles()[]Post
Practical guides on Go, backend engineering, PostgreSQL, microservices, cloud, performance, and testing.
30 articles
Designing a Production-Ready Go Backend: Architecture, Reliability and Operations
How the pieces of a production Go backend fit together: application architecture, reliability patterns, data, messaging, security, observability, and deployment — plus when to choose a monolith, modular monolith, or microservices.
Scaling PostgreSQL for Go Applications: Read Replicas, Connection Pools and Query Performance
A practical order of operations for scaling PostgreSQL under a growing Go service: query optimization first, then pooling, then read replicas — and why the order matters.
Advanced Go Concurrency: Worker Pools, Backpressure and Bounded Concurrency
Why unbounded goroutines don't scale: semaphore-based bounded concurrency, backpressure, errgroup, goroutine leaks, and a real benchmark comparing the two.
Database Transactions in Go: Isolation Levels, Locks and Real-World Failures
PostgreSQL transaction isolation levels in Go, explained through a real race condition: lost updates, SELECT FOR UPDATE, and why app-level locking isn't enough.
Kubernetes for Go Developers: Deploying a Production-Ready Go API
What actually happens when Kubernetes sends your Go process SIGTERM, and the Deployment, Service, probe, and resource config a production Go API needs.
Securing Go REST APIs: Authentication, Authorization and Common Attack Surfaces
Practical Go API security: authentication vs authorization, JWT and refresh tokens, object-level authorization, SQL injection, CORS, and a production checklist.
Circuit Breakers in Go: Preventing Cascading Failures
Implementing a circuit breaker in Go to stop cascading failures — closed/open/half-open states, and why combining it with retries incorrectly makes things worse.
Idempotent Consumers in Go: Handling Duplicate Messages Safely
Why message consumers must assume duplicate delivery, and how to implement deduplication in Go and PostgreSQL without a race condition.
Event-Driven Architecture with Go: Events, Consumers and Failure Handling
Designing event-driven Go services: commands vs events, consumer groups, ordering, and why every consumer must handle duplicate delivery.
Distributed Locks in Go: Redis, PostgreSQL and the Problems You Need to Understand
Implementing distributed locks in Go with Redis and PostgreSQL advisory locks — lock ownership, TTLs, fencing tokens, and why a naive SET-based lock is unsafe.
Load Testing a Go API: Finding the Real Bottleneck
Load testing a Go API with k6: throughput, p50/p95/p99 latency, and a systematic way to find whether the bottleneck is the app, the database, or the network.
Observability for Go Microservices: Logs, Metrics and Traces
The three pillars of observability for Go microservices — structured logs, Prometheus metrics, and distributed traces — and how they differ from monitoring.
Building Background Workers in Go with Goroutines and Channels
A production-oriented worker pool in Go: bounded concurrency, graceful shutdown, panic recovery, and why 'go process(job) for every job' is dangerous.
The Outbox Pattern with Go and PostgreSQL
Solving the dual-write problem between PostgreSQL and a message broker with the transactional outbox pattern, implemented in Go.
Idempotency in APIs: Preventing Duplicate Payments and Requests
Implementing idempotency keys in Go and PostgreSQL to prevent duplicate payments and orders when clients retry after a timeout.
Retries, Timeouts and Backoff in Go: Building Resilient Services
A practical HTTP client with timeouts, exponential backoff, and jitter — and why retries should never be applied blindly to every request.
Caching in Go: Redis, Cache-Aside and Cache Invalidation
A practical cache-aside implementation in Go with Redis: TTLs, cache stampedes, invalidation strategies, and when caching is the wrong call.
API Rate Limiting in Go: Token Bucket, Middleware and Distributed Limits
Rate limiting a Go API in practice: token bucket vs sliding window, an in-memory middleware implementation, and why it breaks across multiple replicas.
PostgreSQL Connection Pooling in Go: pgxpool Explained
How pgxpool connection pooling actually works in Go: MaxConns, MinConns, connection lifetimes, pool exhaustion, and why raising MaxConns isn't always the fix.
Building a Go API with Clean Architecture Without Overengineering
A practical take on Clean Architecture in Go: handler/service/repository separation, dependency direction, and knowing when to stop adding abstractions.
Testing Go Backend Applications: Unit, Integration and HTTP Tests
A practical testing strategy for Go backend services: table-driven unit tests, httptest for handlers, mocks for services, and integration tests against a real PostgreSQL database.
Profiling Go Applications with pprof
Profile CPU, memory, and goroutines in a running Go HTTP service with net/http/pprof, and learn to read the profiles to find real performance problems.
REST vs gRPC for Go Microservices
A practical comparison of REST/JSON and gRPC for Go microservices, with a decision matrix covering performance, streaming, debugging, and browser compatibility.
Go Microservices: A Practical Project Structure
A practical, minimal project structure for Go microservices: service boundaries, internal packages, configuration, migrations, and Docker — without over-engineering.
EXPLAIN ANALYZE in PostgreSQL: How to Find Slow Queries
How to read PostgreSQL EXPLAIN ANALYZE output to diagnose slow queries: sequential vs index vs bitmap scans, join strategies, row estimates, and buffers.
PostgreSQL Indexes: A Practical Guide for Backend Engineers
A practical guide to PostgreSQL indexing for backend engineers: B-tree, GIN, composite and partial indexes, selectivity, overhead, and when indexes hurt performance.
Building a Production-Ready REST API with Go
A clean, minimal-abstraction project structure for production Go REST APIs: routing, configuration, handlers, services, repositories, validation, error handling, logging, middleware, and health checks.
Graceful Shutdown in Go HTTP Servers
Implement graceful shutdown for Go HTTP servers: handling SIGTERM and SIGINT, draining active requests, shutdown timeouts, and Kubernetes readiness.
Go Interfaces: Design Small, Testable Components
Design small, focused Go interfaces for dependency injection, mocking, and testable backend code, with realistic service and repository examples.
Context in Go: Cancellation, Deadlines and Request Propagation
Understand Go's context.Context: cancellation, deadlines, timeouts and request-scoped propagation, with practical HTTP and database examples.