Skip to content

funcArticles()[]Post

Practical guides on Go, backend engineering, PostgreSQL, microservices, cloud, performance, and testing.

30 articles

Architecture

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.

16 min
PostgreSQL

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.

13 min
Go

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.

13 min
PostgreSQL

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.

13 min
Cloud

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.

13 min
Security

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.

14 min
Microservices

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.

12 min
Distributed Systems

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.

12 min
Microservices

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.

13 min
Distributed Systems

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.

13 min
Performance

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.

13 min
Microservices

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.

12 min
Go

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.

12 min
Microservices

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.

13 min
Backend

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.

12 min
Microservices

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.

11 min
Backend

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.

12 min
Backend

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.

12 min
PostgreSQL

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.

11 min
Backend

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.

13 min
Testing

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.

11 min
Performance

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.

10 min
Microservices

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.

10 min
Microservices

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.

10 min
PostgreSQL

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.

11 min
PostgreSQL

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.

11 min
Backend

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.

12 min
Go

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.

9 min
Go

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.

9 min
Go

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.

10 min