Articles

Tech Articles

In-depth articles on AI, web development, cloud native, and indie hacking.

@admin·10 min read·Cloud Native

PostgreSQL Triggers and Stored Functions

Some logic is more efficient in the database, including automatic auditing, cascading updates, and data validation. But overusing triggers makes behavior implicit and hard to debug. This article explains how PostgreSQL triggers and functions work, when to use them, when not to, and why triggers demand restraint.

#DevOps♥ 1120 comments
@admin·9 min read·Web Development

Real-Time Web: An In-Depth Comparison of SSE and WebSocket

Choosing between SSE and WebSocket for server push? This article explains their fundamental differences, ideal use cases, proxy and firewall compatibility, connection limits, and provides clear guidance on when to use each.

#Next.js #TypeScript♥ 1130 comments
@admin·9 min read·Cloud Native

Background Job Queue Design: Move Slow Work Out of the Request

Sending emails, generating reports, and processing uploads time out inside a request—move them to a background queue. This article covers the queue core (enqueue/worker/retry/monitoring), tech selection (BullMQ/Sidekiq/Celery), delayed and scheduled jobs, idempotency, and how to decide “what should be async.”

#DevOps♥ 1140 comments
@admin·10 min read·Cloud Native

Read Replicas and Read/Write Splitting

Read-heavy and write-light? Add read replicas to spread reads across databases while the primary handles writes. This article covers primary-replica architecture, application- and proxy-level routing, replication-lag consistency traps, and when read replicas are or are not appropriate.

#DevOps♥ 1150 comments
@admin·12 min read·Web Development

React Context Performance Pitfalls and Optimization

Context is easy to use, but when its value changes, every consumer rerenders. In high-frequency scenarios, that is a performance killer. This article explains Context rerendering, why putting all state into one Context is an anti-pattern, how to split it, and when to switch to Zustand.

#Next.js #React♥ 1160 comments
@admin·12 min read·Cloud Native

PostgreSQL Locks and Deadlocks

Locks preserve correctness during concurrent writes, but poor locking causes delays and deadlocks. This article explains PostgreSQL row, table, and advisory locks, automatic deadlock detection, concurrency control with SELECT FOR UPDATE, and ways to reduce contention through short transactions, consistent lock ordering, and optimistic locking.

#DevOps♥ 1170 comments