Tagged articles
GORM
23 articles · Page 1 of 1
This step‑by‑step guide walks you through installing Go, configuring the environment, structuring a project, using Gin to create CRUD endpoints, adding middleware, managing configuration, testing, generating Swagger docs, optimizing performance, and deploying the service with Docker or systemd.
DockerGORMGin
0 likes · 21 min read

This tutorial walks through creating a complete Go backend service using Gin and GORM, covering project setup, layered architecture, database initialization, user model definition, JWT‑based registration and login, pagination, middleware, routing, and deployment options, while also suggesting extensible features such as RBAC, Swagger, Redis caching, Docker, and micro‑service frameworks.
APIGORMGin
0 likes · 8 min read

The article explains why relying solely on the Go standard library is impractical, then presents a curated stack—Viper for config, Cobra + Viper for CLI, Uber Fx for DI, Echo for HTTP, GORM for ORM, Testify for testing, Asynq for background jobs, and Zerolog for logging—showing a real project layout, startup flow, and the stability benefits of this combination.
ECHOGORMGo
0 likes · 9 min read

The article shows how repetitive CRUD code in Gin can be refactored with Go 1.18 generics by defining a Creatable interface, writing a single generic CreateHandler, using factory functions and type constraints, and registering routes in one line, resulting in zero duplicate code and clearer responsibilities.
CRUDGORMGenerics
0 likes · 11 min read

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.
GORMGoRedis
0 likes · 11 min read

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

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.
GORMGoSharding
0 likes · 11 min read

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

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

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.
GORMGoORM
0 likes · 26 min read

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.
GORMconnection poolgolang
0 likes · 8 min read

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

This article walks through step‑by‑step how to create a simple CRUD service using Go's Gin framework with Gorm and MySQL, then shows the equivalent implementation with Java Spring Boot, MyBatis‑Plus and MySQL, comparing the two approaches and providing complete source code.
CRUDGORMGin
0 likes · 16 min read

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.
Database ConnectionGORMMySQL
0 likes · 9 min read

This tutorial walks through creating a lightweight Go ORM—covering a custom logger, converting structs to table metadata, implementing basic CRUD operations, handling transactions, and adding hook callbacks—while exposing the core Session data structure and providing a GitHub reference.
GORMGoORM
0 likes · 7 min read

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

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.
EnumGORMORM
0 likes · 5 min read

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.
GORMMetricsSQL
0 likes · 10 min read

This article demonstrates how to use the Go-based FunTester framework to conduct performance tests—select, insert, update, and delete—on MySQL through GORM, providing code examples and explaining the setup of the testing harness.
GORMGofun-tester
0 likes · 7 min read

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

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

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

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
