sklinkert/go-ddd
Opinionated Domain Driven Design Template for Go
Thành tựu nổi bật
Những danh hiệu mới nhất của dự án
#1 Repository của tuần
#1 Repository của tuần
#2 Repository của tuần
🏗️ Template Go-DDD: Xây dựng service Go theo chuẩn DDD & CQRS ngay từ đầu
go-ddd cung cấp một bộ khung xây dựng backend Go theo chuẩn Domain-Driven Design, CQRS, Onion architecture, kèm pipeline idempotent và tooling đồng bộ schema.
go-ddd là một template opinionated giúp bạn xây dựng nhanh các dịch vụ Go bán sản phẩm (production-grade), nơi business rules, infrastructure và lớp giao tiếp được tách biệt rõ rệt. Dự án mẫu marketplace minh họa cách mô hình hóa Seller, Product, cùng các aggregate, value object và validation rule.
✨ Điểm nổi bật
- Onion architecture: Tách biệt domain, application, infrastructure và interface rõ rệt.
- CQRS command/query: Tách biệt luồng ghi (command) và đọc (query) để tối ưu hiệu năng.
- Pipeline idempotent: Retry-safe command handlers tránh ghi trùng lặp.
- Migration discipline: SQL migrations,
migrate.govàsqlcgiữ schema và code đồng bộ. - Testcontainers: Cung cấp Postgres disposable trong test.
- Soft delete: Xóa mềm bằng cột
deleted_atđể hỗ trợ khôi phục dữ liệu. - Domain-first validation: Validation diễn ra ở tầng domain, không phải ở database.
💡 Vì sao đáng chú ý
Khác với các template chung, go-ddd không chỉ là khung cấu trúc — mà còn đưa ra các nguyên tắc thiết kế sâu như việc set default value ở domain layer thay vì database, đọc lại dữ liệu sau khi ghi để tránh stale data, và phân biệt rõ find (có thể trả về null) vs get (bắt buộc có giá trị). Đây là lựa chọn lý tưởng cho nhóm muốn áp dụng DDD thực sự vào dự án Go mà không cần phải thiết kế lại từ đầu.
#Go #DDD #CQRS #OnionArchitecture #TiniX
Dự án tương tự
Khám phá các dự án và mô hình AI khác có sự tương đồng.
Full Modular Monolith application with Domain-Driven Design approach.
Navigate the complex landscape of .NET software architecture with our step-by-step, story-like guide. Unpack the interplay between modular monoliths, microservices, domain-driven design, and various architectural patterns. Go beyond the one-size-fits-all solutions and understand how to blend these approaches based on your unique needs.
Get up and running with Inkling, Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
Clean Architecture Solution Template: A proven Clean Architecture Template for ASP.NET Core 10
📚 A curated list of awesome articles, videos, and other resources to learn and practice software architecture, patterns, and principles.
Web Application ASP.NET 9 using Clean Architecture, DDD, CQRS, Event Sourcing and a lot of good practices
A comprehensive Domain-Driven Design example with problem space strategic analysis and various tactical patterns.