Tagged articles
18 articles
Page 1 of 1
Code Wrench
Code Wrench
Dec 21, 2025 · Backend Development

Building a High‑Performance Go Database Access Layer for Microservices

This article dissects a production‑grade Go database access framework for microservices, covering unified interface abstraction, factory pattern for multi‑DB support, PostgreSQL array handling, read‑write splitting with load balancing, Redis cache protection, monitoring, and deployment considerations, with full code examples and open‑source links.

GORMGoMicroservices
0 likes · 11 min read
Building a High‑Performance Go Database Access Layer for Microservices
Code Wrench
Code Wrench
Sep 18, 2025 · Backend Development

Master GORM Plugins: Build an Asynchronous Audit Log Extension in Go

Learn how to extend GORM with custom plugins by implementing the Plugin interface, registering lifecycle callbacks, and creating an asynchronous audit‑log module that records Create, Update, Delete, and Query actions to a dedicated table, with configurable batch size, flush interval, and buffer settings.

GORMGoORM
0 likes · 10 min read
Master GORM Plugins: Build an Asynchronous Audit Log Extension in Go
Code Wrench
Code Wrench
Sep 17, 2025 · Databases

Mastering GORM Sharding: A Lightweight Go Plugin for Scalable Databases

This article explains why horizontal sharding becomes essential for billion‑row tables, introduces the non‑intrusive GORM Sharding plugin, walks through installation, configuration, and code examples, and evaluates its advantages, limitations, common issues, and suitable use cases for Go back‑end services.

GORMGoperformance
0 likes · 11 min read
Mastering GORM Sharding: A Lightweight Go Plugin for Scalable Databases
Code Wrench
Code Wrench
Sep 16, 2025 · Backend Development

Mastering GORM DBResolver: Read/Write Splitting and Load Balancing in Go

Learn how to use GORM's DBResolver plugin in Go to achieve efficient read/write separation and load balancing across master and replica databases, with detailed code examples, configuration tips, production best practices, and strategies for connection pooling, transaction consistency, and handling replication lag.

DBResolverGORMGo
0 likes · 8 min read
Mastering GORM DBResolver: Read/Write Splitting and Load Balancing in Go
Code Wrench
Code Wrench
Sep 14, 2025 · Backend Development

GORM Performance Hacks: Real-World Optimizations for High-Concurrency Go Apps

This article examines why GORM is popular in Go, outlines common performance pitfalls such as default transactions and N+1 queries, and provides practical optimization techniques—including disabling default transactions, selective field queries, batch processing, prepared statements, and indexing—illustrated with real‑world case studies for high‑concurrency and large‑scale data scenarios.

GORMGoORM
0 likes · 7 min read
GORM Performance Hacks: Real-World Optimizations for High-Concurrency Go Apps
Tencent Cloud Developer
Tencent Cloud Developer
Sep 3, 2025 · Databases

Deep Dive into GORM: Architecture, Internals, and Common Pitfalls

This article provides a comprehensive overview of Go's powerful GORM ORM library, covering its core concepts, architecture, internal logic, common pitfalls, practical tips, and advanced features such as soft deletes, transaction handling, batch operations, and integration with trpc-go, helping developers master GORM's inner workings.

Batch InsertGORMGo
0 likes · 26 min read
Deep Dive into GORM: Architecture, Internals, and Common Pitfalls
Code Wrench
Code Wrench
Jul 16, 2025 · Backend Development

Build Scalable Multi‑Tenant SQL Server Pools in Go with GORM Optimizations

This guide details a complete solution for building multi‑tenant SQL Server connection pools in Go microservices, covering YAML tenant configuration, a thread‑safe pool factory, Gin middleware integration, advanced GORM query techniques, high‑concurrency optimizations, monitoring, slow‑query logging, and circuit‑breaker safeguards.

Connection PoolGORMGolang
0 likes · 8 min read
Build Scalable Multi‑Tenant SQL Server Pools in Go with GORM Optimizations
FunTester
FunTester
Dec 30, 2024 · Backend Development

Top Go Frameworks and Libraries in 2024: Gin, Beego, Echo, Buffalo, and GORM

This article reviews five leading Go frameworks and libraries—Gin, Beego, Echo, Buffalo, and GORM—detailing their core features, typical use cases, and reasons to choose each, helping developers select the most suitable tools for modern backend and full‑stack development in 2024.

BackendBeegoBuffalo
0 likes · 15 min read
Top Go Frameworks and Libraries in 2024: Gin, Beego, Echo, Buffalo, and GORM
MaGe Linux Operations
MaGe Linux Operations
Jan 7, 2024 · Backend Development

Mastering MySQL Connections in Go: From Raw SQL to GORM ORM

Learn how to connect Go applications to MySQL using the native driver and the GORM ORM, covering driver installation, basic connection code, database configuration, query execution, and best practices for model definition and handling common pitfalls.

Backend DevelopmentDatabase ConnectionGORM
0 likes · 9 min read
Mastering MySQL Connections in Go: From Raw SQL to GORM ORM
MaGe Linux Operations
MaGe Linux Operations
Dec 4, 2023 · Backend Development

Explore the Complete Gin-Based Backend Project Structure and Core Code

This guide walks through the automatically generated Gin framework project, detailing the directory layout—including API, model, service, config, database, migrations, public assets, routers, runtime, and utils—while providing sample commands and code snippets that illustrate how to initialize, define interfaces, and perform CRUD operations with GORM.

GORMGinProject Structure
0 likes · 6 min read
Explore the Complete Gin-Based Backend Project Structure and Core Code
MaGe Linux Operations
MaGe Linux Operations
Nov 28, 2023 · Backend Development

Mastering Enums in GORM: A Step-by-Step Guide for Go Developers

This tutorial explains how to add enum types to GORM models in Go, covering definition of enum values, model integration, CRUD operations using enums, and alternative approaches such as string fields, custom types, and GORM's built‑in enum tag to enhance type safety and database reliability.

GORMORMdatabase
0 likes · 5 min read
Mastering Enums in GORM: A Step-by-Step Guide for Go Developers
37 Interactive Technology Team
37 Interactive Technology Team
Feb 10, 2023 · Backend Development

Analysis of Golang SQL Connection Pool Mechanism and Usage

The article examines Go’s database/sql connection pool implementation, showing how reusing connections cuts latency, explains idle/in‑use/closed state transitions, details configuration parameters such as MaxIdleConns and MaxOpenConns, demonstrates metric collection via Gorm DBStats for monitoring, and provides a stress‑test illustrating the impact of proper tuning.

Connection PoolGORMGolang
0 likes · 10 min read
Analysis of Golang SQL Connection Pool Mechanism and Usage
FunTester
FunTester
Jan 11, 2022 · Backend Development

Mastering GORM: A Beginner’s Guide to Go ORM CRUD Operations

This article walks through setting up GORM in a Go project, covering dependency management, database initialization, model definition, and practical examples of select, insert, update, delete, raw SQL execution, and transaction handling with detailed code snippets.

BackendCRUDGORM
0 likes · 9 min read
Mastering GORM: A Beginner’s Guide to Go ORM CRUD Operations
Sohu Tech Products
Sohu Tech Products
May 5, 2021 · Backend Development

Implementing Optimistic Locking in Go with GORM

This article explains how to implement optimistic locking in Go using GORM by adding a version field, writing raw SQL updates, creating a reusable wrapper function with retry logic, and leveraging interfaces and type assertions to handle concurrency safely.

GORMGooptimistic lock
0 likes · 7 min read
Implementing Optimistic Locking in Go with GORM
Ops Development Stories
Ops Development Stories
Apr 2, 2021 · Information Security

Mastering Casbin: Build Secure RBAC in Go with Gin and Gorm

This article explains what Casbin is, how its PERM model works, and provides a step‑by‑step guide to integrate Casbin’s RBAC authorization into a Go project using Gin, Gorm, and a MySQL adapter, including model configuration, policy storage, middleware enforcement, and verification.

CasbinGORMGin
0 likes · 13 min read
Mastering Casbin: Build Secure RBAC in Go with Gin and Gorm
360 Tech Engineering
360 Tech Engineering
Jun 1, 2020 · Backend Development

Building a Food Recommendation API with Domain‑Driven Design in Go

This tutorial walks through a complete Golang implementation of a food‑recommendation API using Domain‑Driven Design (DDD), covering the four DDD layers, entity and repository definitions, persistence setup with Gorm, application services, HTTP interfaces, middleware, and how to run the service.

APIBackendDDD
0 likes · 28 min read
Building a Food Recommendation API with Domain‑Driven Design in Go