Code Wrench
Author

Code Wrench

Focuses on code debugging, performance optimization, and real-world engineering, sharing efficient development tips and pitfall guides. We break down technical challenges in a down-to-earth style, helping you craft handy tools so every line of code becomes a problem‑solving weapon. 🔧💻

175
Articles
0
Likes
33
Views
0
Comments
Recent Articles

Latest from Code Wrench

100 recent articles max
Code Wrench
Code Wrench
Jan 22, 2026 · Backend Development

Mastering Consistent Hashing in Go: From Simple Modulo to Virtual Nodes

This article explains why naive modulo-based routing fails in distributed Go services, introduces the stable and scalable concept of consistent hashing, walks through a basic implementation, shows how virtual nodes improve balance, and outlines common use cases and pitfalls for production systems.

Golangvirtual nodes
0 likes · 10 min read
Mastering Consistent Hashing in Go: From Simple Modulo to Virtual Nodes
Code Wrench
Code Wrench
Jan 21, 2026 · Backend Development

Mastering Cache Eviction in Go: When and How to Use LRU

This article explains why naive cache eviction fails, why LRU is the go‑to strategy for many Go projects, and provides a production‑ready LRU implementation with detailed code, lock‑granularity tips, key design considerations, and scenarios where LRU is not suitable.

CacheGoLRU
0 likes · 9 min read
Mastering Cache Eviction in Go: When and How to Use LRU
Code Wrench
Code Wrench
Jan 20, 2026 · Backend Development

Mastering API Rate Limiting in Go: Practical Algorithms and Implementation

This article walks through real‑world Go rate‑limiting strategies—from naive checks to fixed, sliding, and token‑bucket algorithms—explaining their pitfalls, implementation details, performance trade‑offs, and practical tips for choosing and deploying the right solution in production services.

Golangalgorithmbackend
0 likes · 10 min read
Mastering API Rate Limiting in Go: Practical Algorithms and Implementation
Code Wrench
Code Wrench
Jan 19, 2026 · Backend Development

Why Go Projects Need Algorithms: Real‑World Practices and Pitfalls

This article explores how common engineering problems in Go projects—such as rate limiting, cache eviction, and task scheduling—are fundamentally algorithmic, explains why developers often overlook them, and shows where and how to apply practical algorithms to improve performance, stability, and scalability.

AlgorithmsCachingGolang
0 likes · 7 min read
Why Go Projects Need Algorithms: Real‑World Practices and Pitfalls
Code Wrench
Code Wrench
Jan 18, 2026 · Backend Development

How Go Powers a Smart Factory: Config, Tracing, and Event‑Driven Architecture

This article explains how a Go‑based smart factory evolves from a prototype to a production‑grade system by externalizing configuration with Viper, injecting Trace IDs for end‑to‑end observability, and adopting an event‑driven architecture to achieve flexible, maintainable, and scalable industrial automation.

Configuration ManagementEvent-Driven ArchitectureGo
0 likes · 13 min read
How Go Powers a Smart Factory: Config, Tracing, and Event‑Driven Architecture
Code Wrench
Code Wrench
Jan 17, 2026 · Backend Development

Building a Go-Powered Industrial Scheduling System with FSM, Saga, and WAL

This article demonstrates how to design and implement a miniature yet fully functional industrial intelligent scheduling system in Go, leveraging a workflow engine, priority queue, saga‑based transactions with FSM state management, concurrent station execution, and write‑ahead logging for reliable, real‑time factory automation.

FSMGoSaga
0 likes · 9 min read
Building a Go-Powered Industrial Scheduling System with FSM, Saga, and WAL
Code Wrench
Code Wrench
Jan 16, 2026 · Backend Development

Mastering Go Documentation: From godoc to Swagger and Sustainable Practices

This article explores Go's built-in documentation philosophy, explains how godoc, README, and Example sections each serve distinct roles, contrasts them with Swagger for API consumers, and provides a concrete, step-by-step guideline for establishing maintainable, evolution-ready documentation practices in real-world Go projects.

GoSwaggerbest practices
0 likes · 9 min read
Mastering Go Documentation: From godoc to Swagger and Sustainable Practices
Code Wrench
Code Wrench
Jan 14, 2026 · Backend Development

When to Choose NATS Over Kafka for Go Microservices: A Practical Guide

This article compares Kafka, RabbitMQ, and NATS for Go microservices, explains why Kafka is often over‑engineered for internal communication, and shows how NATS provides a lightweight, event‑driven alternative with concrete code examples and a clear selection matrix.

GoKafkaMessage Queue
0 likes · 9 min read
When to Choose NATS Over Kafka for Go Microservices: A Practical Guide
Code Wrench
Code Wrench
Jan 13, 2026 · Backend Development

Unlocking etcd: Deep Dive into Go’s Distributed Key‑Value Engine

This article offers a thorough source‑code walkthrough of etcd v3.5+, revealing how its Go‑based architecture implements the Raft consensus algorithm, MVCC storage with BoltDB, efficient network communication via rafthttp, and Go concurrency patterns, while providing practical operational insights for performance tuning and reliability.

GoMVCCRaft
0 likes · 12 min read
Unlocking etcd: Deep Dive into Go’s Distributed Key‑Value Engine
Code Wrench
Code Wrench
Jan 11, 2026 · Backend Development

Master Viper: Priority Lookup, Multi‑Source Merging & Concurrency Risks

This article delves into Viper’s internal architecture, explaining its layered storage and priority lookup mechanism, how it merges environment variables, config files, and defaults, and highlights concurrency safety concerns, offering practical guidelines and code snippets to avoid common pitfalls when using Viper in Go projects.

GoSource codeViper
0 likes · 9 min read
Master Viper: Priority Lookup, Multi‑Source Merging & Concurrency Risks