# Thoughts & Stories: Backend

> Sharing my experiences, learnings, and adventures in tech and beyond.

URL: https://www.matthewswong.com/en/blog/category/backend/

- [Integer vs Decimal Money Postgres: Two ERPs, Two Answers](https://www.matthewswong.com/en/blog/integer-rupiah-vs-numeric-decimal-postgres-erp/)
- [Envoy AI Gateway Is Now Agent Router: What 1.2 Changes](https://www.matthewswong.com/en/blog/envoy-ai-gateway-becomes-agent-router-1-2/)
- [Sync vs Async Microservices Communication: How to Choose](https://www.matthewswong.com/en/blog/sync-vs-async-microservices-communication/)
- [Database Partitioning vs Sharding: What Is the Difference?](https://www.matthewswong.com/en/blog/database-partitioning-vs-sharding/)
- [Latency vs Throughput: Differences, Trade-offs and Tuning](https://www.matthewswong.com/en/blog/latency-vs-throughput-explained/)
- [Bloom Filter Explained: Where It Fits in System Design](https://www.matthewswong.com/en/blog/bloom-filter-explained-system-design/)
- [Service Discovery in Microservices: How It Works](https://www.matthewswong.com/en/blog/service-discovery-microservices-explained/)
- [Leader Election in Distributed Systems: Leases and Fencing](https://www.matthewswong.com/en/blog/leader-election-distributed-systems/)
- [Pub/Sub vs Message Queue: Differences and When to Use Each](https://www.matthewswong.com/en/blog/pub-sub-vs-message-queue/)
- [Raft Consensus Algorithm Explained: Elections and Logs](https://www.matthewswong.com/en/blog/raft-consensus-algorithm-explained/)
- [Backpressure in Distributed Systems: Stop a Fast Producer](https://www.matthewswong.com/en/blog/backpressure-distributed-systems-explained/)
- [Bulkhead Pattern Explained: Isolate Failures in Backend Systems](https://www.matthewswong.com/en/blog/bulkhead-pattern-fault-isolation/)
- [Retry with Exponential Backoff and Jitter in TypeScript](https://www.matthewswong.com/en/blog/retry-exponential-backoff-jitter/)
- [ACID vs BASE: Database Consistency Models and When It Matters](https://www.matthewswong.com/en/blog/acid-vs-base-database-consistency/)
- [Transaction Isolation Levels Explained in PostgreSQL](https://www.matthewswong.com/en/blog/database-transaction-isolation-levels-explained/)
- [Design a Distributed Key-Value Store, Dynamo-Style](https://www.matthewswong.com/en/blog/design-key-value-store-from-scratch/)
- [Design a Flash Sale System That Never Oversells Stock](https://www.matthewswong.com/en/blog/design-flash-sale-inventory-system/)
- [Eventual Consistency Explained: When Is Stale Data Acceptable?](https://www.matthewswong.com/en/blog/eventual-consistency-explained/)
- [Two-Phase Commit vs Saga: Distributed Transactions Compared](https://www.matthewswong.com/en/blog/two-phase-commit-vs-saga/)
- [Design a Payment System: Ledger, Idempotency, Reconciliation](https://www.matthewswong.com/en/blog/design-payment-system-ledger-reconciliation/)
- [Design a Web Crawler: URL Frontier, robots.txt and Dedup](https://www.matthewswong.com/en/blog/design-web-crawler-system-design/)
- [Design a Distributed Job Scheduler That Runs Each Job Once](https://www.matthewswong.com/en/blog/design-distributed-job-scheduler/)
- [Distributed ID Generator: Snowflake vs UUIDv7 vs ULID](https://www.matthewswong.com/en/blog/distributed-id-generator-snowflake-uuid/)
- [Geohash vs Quadtree: How Nearby Driver Search Works](https://www.matthewswong.com/en/blog/geohash-quadtree-nearby-search-design/)
- [Design a Chat App Like WhatsApp: Real-Time System Design](https://www.matthewswong.com/en/blog/design-chat-application-system-design/)
- [News Feed System Design: Fan-Out on Write vs Fan-Out on Read](https://www.matthewswong.com/en/blog/design-news-feed-fan-out-on-write-vs-read/)
- [Design Search Autocomplete (Typeahead): Tries, Redis, Postgres](https://www.matthewswong.com/en/blog/design-search-autocomplete-typeahead/)
- [How to Design a Scalable Notification System (Push, Email, SMS)](https://www.matthewswong.com/en/blog/design-notification-system-architecture/)
- [Design a URL Shortener Like bit.ly: System Design Guide](https://www.matthewswong.com/en/blog/design-url-shortener-system-design/)
- [Token Bucket vs Sliding Window: Rate Limiting Algorithms](https://www.matthewswong.com/en/blog/rate-limiting-algorithms-token-bucket-sliding-window/)
- [Cache-Aside vs Write-Through vs Write-Back: Which Fits?](https://www.matthewswong.com/en/blog/cache-aside-vs-write-through-caching/)
- [Cache Invalidation Strategies: TTL, Events and Versioned Keys](https://www.matthewswong.com/en/blog/cache-invalidation-strategies/)
- [Database Indexing Explained: How B-Trees Work in Postgres](https://www.matthewswong.com/en/blog/database-indexing-b-tree-explained/)
- [Database Replication Explained: Leader-Follower, Sync vs Async](https://www.matthewswong.com/en/blog/database-replication-leader-follower/)
- [Read Replicas Return Stale Data: Handling Replication Lag](https://www.matthewswong.com/en/blog/read-replicas-replication-lag-pitfalls/)
- [SQL vs NoSQL: How to Choose a Database for a New System](https://www.matthewswong.com/en/blog/sql-vs-nosql-how-to-choose/)
- [CAP Theorem Explained: How It Shapes Your Database Choice](https://www.matthewswong.com/en/blog/cap-theorem-explained-practical-examples/)
- [Consistent Hashing Explained: Hash Ring and Virtual Nodes](https://www.matthewswong.com/en/blog/consistent-hashing-explained/)
- [A2A Protocol Tutorial: v1.0 Agent Cards, Tasks and Bindings](https://www.matthewswong.com/en/blog/a2a-protocol-v1-agent-cards-guide/)
- [Durable AI Agents With Temporal: Survive Crashes and Waits](https://www.matthewswong.com/en/blog/durable-ai-agents-temporal-workflows/)
- [MCP 2026-07-28 Spec Migration: Stateless Guide for Servers](https://www.matthewswong.com/en/blog/mcp-2026-07-28-stateless-spec-migration/)
- [OpenAI Assistants API Shutdown Migration to the Responses API](https://www.matthewswong.com/en/blog/openai-assistants-api-shutdown-migration/)
- [Durable Execution for AI Agents: Surviving Hours-Long Runs](https://www.matthewswong.com/en/blog/durable-execution-ai-agent-workflows/)
- [My ERP Approval npm Library Passed 1,200 Weekly Downloads](https://www.matthewswong.com/en/blog/hierarchical-approval-1200-weekly-downloads/)
- [PaaS Postgres Connection Limits: Surviving max_connections](https://www.matthewswong.com/en/blog/paas-postgres-connection-limits-survival/)
- [Reviewing AI-Written Postgres Migrations Before They Run](https://www.matthewswong.com/en/blog/ai-database-migration-safety-review/)
- [Deploy a NestJS ERP API to a Managed PaaS: Probes, Migrations](https://www.matthewswong.com/en/blog/deploy-nestjs-erp-api-paas-guide/)
- [Epson TM-T82 Network Printing: Port 9100 Troubleshooting](https://www.matthewswong.com/en/blog/epson-tm-t82-network-printing-troubleshooting/)
- [Build an MCP Server in TypeScript: A Guide](https://www.matthewswong.com/en/blog/build-mcp-server-typescript-guide/)
- [MCP Primitives: Tools, Resources, and Prompts](https://www.matthewswong.com/en/blog/mcp-tools-resources-prompts-primitives/)
- [AI Agents for ERP Development: Real Use Cases](https://www.matthewswong.com/en/blog/ai-agents-erp-development-use-cases/)
- [MCP Transports: stdio vs Streamable HTTP](https://www.matthewswong.com/en/blog/mcp-transports-stdio-vs-http/)
- [Marketplace Price Monitoring SaaS: Tokopedia and Shopee](https://www.matthewswong.com/en/blog/marketplace-price-monitoring-saas-tokopedia-shopee/)
- [Multi-Tenant SaaS Architecture With Postgres RLS](https://www.matthewswong.com/en/blog/multi-tenant-saas-postgres-rls-indonesia/)
- [SaaS Recurring Billing in Indonesia: Midtrans and Xendit](https://www.matthewswong.com/en/blog/saas-recurring-billing-midtrans-xendit-qris-indonesia/)
- [WhatsApp Invoice Reminder SaaS: Build It for Indonesia](https://www.matthewswong.com/en/blog/whatsapp-invoice-reminder-saas-indonesia/)
- [Distributed Locking with Redis Redlock in Node.js](https://www.matthewswong.com/en/blog/distributed-locking-redis-redlock-nodejs/)
- [Turso and libSQL: Edge SQLite with Embedded Replicas](https://www.matthewswong.com/en/blog/turso-libsql-edge-sqlite/)
- [DuckDB: In-Process OLAP Analytics on Parquet, CSV, and S3](https://www.matthewswong.com/en/blog/duckdb-in-process-analytics/)
- [Run TypeScript Natively in Node.js: Type Stripping](https://www.matthewswong.com/en/blog/nodejs-native-typescript-type-stripping/)
- [PostgreSQL 18: Async I/O, uuidv7 and Skip Scan Explained](https://www.matthewswong.com/en/blog/postgresql-18-async-io-performance/)
- [HTTP QUERY Method: The Safe GET With a Body (RFC 10008)](https://www.matthewswong.com/en/blog/http-query-method-rfc-10008/)
- [Integrating Midtrans Snap Payments into a Next.js App](https://www.matthewswong.com/en/blog/midtrans-payment-gateway-integration-nextjs/)
- [Dynamic QRIS Payment Integration in Node.js: The Complete Guide](https://www.matthewswong.com/en/blog/qris-dynamic-payment-integration-nodejs/)
- [Integrating Shopee and Tokopedia Seller APIs](https://www.matthewswong.com/en/blog/tokopedia-shopee-marketplace-api-integration/)
- [Integrating the Official WhatsApp Business Cloud API in Indonesia](https://www.matthewswong.com/en/blog/whatsapp-business-api-integration-indonesia/)
- [Xendit vs Midtrans: Which Payment Gateway to Pick in Indonesia](https://www.matthewswong.com/en/blog/xendit-vs-midtrans-payment-gateway-indonesia/)
- [Bun vs Node.js as a Production Runtime in 2026](https://www.matthewswong.com/en/blog/bun-vs-nodejs-production-runtime/)
- [Drizzle ORM vs Prisma for TypeScript Backends](https://www.matthewswong.com/en/blog/drizzle-orm-vs-prisma-typescript/)
- [The Expand/Contract Pattern for Safe Schema Migrations](https://www.matthewswong.com/en/blog/expand-contract-schema-migration-pattern/)
- [Hono: One API Codebase for Workers, Bun, and Node](https://www.matthewswong.com/en/blog/hono-edge-api-framework-guide/)
- [The Idempotent Consumer Pattern for Message Queues](https://www.matthewswong.com/en/blog/idempotent-consumer-pattern-message-queue/)
- [NATS JetStream vs Kafka for Teams That Do Not Need Kafka's Scale](https://www.matthewswong.com/en/blog/nats-jetstream-vs-kafka-lightweight/)
- [Request-Scoped Providers in NestJS: DI Gotchas](https://www.matthewswong.com/en/blog/nestjs-request-scoped-providers-di-gotchas/)
- [End-to-End Type Safety with openapi-typescript](https://www.matthewswong.com/en/blog/openapi-typescript-end-to-end-types/)
- [Distributed Tracing in NestJS with OpenTelemetry Auto-Instrumentation](https://www.matthewswong.com/en/blog/opentelemetry-tracing-nestjs-auto-instrumentation/)
- [PgBouncer Pooling Modes: Session vs Transaction vs Statement](https://www.matthewswong.com/en/blog/pgbouncer-connection-pooling-modes/)
- [Reading PostgreSQL EXPLAIN ANALYZE Like a Pro](https://www.matthewswong.com/en/blog/postgres-explain-analyze-reading-query-plans/)
- [PostgreSQL Generated Columns for Computed Data](https://www.matthewswong.com/en/blog/postgres-generated-columns-computed-data/)
- [Zero-Downtime PostgreSQL Major Upgrades with Logical Replication](https://www.matthewswong.com/en/blog/postgres-logical-replication-zero-downtime-upgrade/)
- [A Reliable Job Queue in PostgreSQL with SKIP LOCKED](https://www.matthewswong.com/en/blog/postgres-skip-locked-job-queue/)
- [Server-Sent Events vs WebSockets for Realtime](https://www.matthewswong.com/en/blog/server-sent-events-vs-websockets-realtime/)
- [Running SQLite in Production with Litestream](https://www.matthewswong.com/en/blog/sqlite-litestream-replication-production/)
- [Valkey vs Redis: Should You Migrate After the Fork?](https://www.matthewswong.com/en/blog/valkey-vs-redis-fork-migration/)
- [Why My ERP Cash Book Is a Derived Postgres UNION View](https://www.matthewswong.com/en/blog/derived-cash-book-union-view-postgres/)
- [Why We Store Money as Integer Rupiah, Never Float](https://www.matthewswong.com/en/blog/integer-money-idr-avoid-float-errors/)
- [Idempotency Keys That Stop a POS From Double-Charging](https://www.matthewswong.com/en/blog/pos-payment-settlement-idempotency-keys/)
- [Inventory Truth: A Stock Movement Ledger, Not a Column](https://www.matthewswong.com/en/blog/stock-movement-source-of-truth-vs-cached-qty/)
- [NestJS Health Checks with Terminus for Kubernetes & Docker](https://www.matthewswong.com/en/blog/nestjs-terminus-health-checks/)
- [NestJS Custom Decorators: Metadata, Reflector & Guards](https://www.matthewswong.com/en/blog/nestjs-custom-decorators-metadata-reflection/)
- [Testing NestJS Applications: Unit, Integration, E2E Guide](https://www.matthewswong.com/en/blog/testing-nestjs-applications-guide/)
- [The Transactional Outbox Pattern with PostgreSQL](https://www.matthewswong.com/en/blog/transactional-outbox-pattern-postgres/)
- [Saga Pattern in NestJS: Distributed Transactions Without 2PC](https://www.matthewswong.com/en/blog/saga-pattern-distributed-transactions-nestjs/)
- [PostgreSQL Row-Level Security for Multi-Tenant SaaS](https://www.matthewswong.com/en/blog/postgres-row-level-security-multitenant/)
- [Zero-Downtime Database Migrations with Prisma](https://www.matthewswong.com/en/blog/zero-downtime-database-migrations-prisma/)
- [Feature Flags in NestJS: Progressive Rollouts and Kill Switches](https://www.matthewswong.com/en/blog/feature-flags-nestjs-progressive-rollout/)
- [Designing Reliable Webhooks: Retries, Signing, and Replay](https://www.matthewswong.com/en/blog/webhooks-reliable-delivery-design/)
- [I Built an npm Library for ERP Hierarchical Approval Workflows](https://www.matthewswong.com/en/blog/hierarchical-approval-npm-library/)
- [PostgreSQL Indexing in Practice: B-tree, GIN, and Partial Indexes](https://www.matthewswong.com/en/blog/postgres-indexing-practical-guide/)
- [Idempotency Keys: Designing APIs That Survive Retries](https://www.matthewswong.com/en/blog/idempotency-keys-api-design/)
- [Reliable Background Jobs with BullMQ and NestJS](https://www.matthewswong.com/en/blog/background-jobs-bullmq-nestjs/)
- [Indonesia SNAP API & QRIS Cross-Border: Developer Guide to Open Banking Integration](https://www.matthewswong.com/en/blog/indonesia-open-banking-snap-api-qris-developer-guide/)

---

- HTML version: https://www.matthewswong.com/en/blog/category/backend/
- Bahasa Indonesia: https://www.matthewswong.com/id/blog/category/backend/
- Site index for agents: https://www.matthewswong.com/llms.txt
- Sitemap: https://www.matthewswong.com/sitemap.xml
- API description (OpenAPI): https://www.matthewswong.com/openapi.json
