This boilerplate serves as a solid foundation for building robust, scalable, and maintainable microservice applications using the Go programming language.
Microservice architecture enhances scalability and flexibility in modern applications. A microservice boilerplate is a standardized template that streamlines development by providing essential components like directory structures, build tools, testing frameworks, and logging integrations. Using a boilerplate allows developers to focus on business logic, ensuring consistency and efficiency across services. This approach accelerates development, enforces standards, and reduces errors, facilitating robust and scalable software solutions.
Warning
Pet and owner were shown in the project only as an example.
- Scalability: While a monolithic application may not scale as easily as a microservice, this example provides best practices and patterns to help you scale your application efficiently as it grows.
- Ease of Deployment: Application deployment and management become easier with a single deployable unit compared to a distributed microservices architecture.
- Enhance Scalability: Allow individual services to scale independently based on demand.
- Increase Flexibility: Enable developers to use different technologies and languages for different services.
- Improve Resilience: Isolate failures to prevent them from affecting the entire system.
- Accelerate Development: Allow multiple teams to work concurrently on different services, speeding up the development process. Simplify Maintenance: Make it easier to update and maintain services due to their smaller and more focused nature.
- Promote Reusability: Encourage the creation of reusable services that can be leveraged across different projects.
- Facilitate Deployment: Support continuous delivery and deployment by enabling services to be deployed independently.
How to use are Swagger, Gorm and Gorm Gen mentioned in the boilerplate.
When go-air used for hot reload on separate applications in same time, it uses too much system features like memory. What's more, you may not even get any positive results from the work of the containers when the number of container is increased.
graph TD;
PetServiceApp-->id1[(Database)];
OwnerServiceApp-->id1[(Database)];
graph TD;
App-->PetService
App-->OwnerService
PetService-->id1[(Database)];
OwnerService-->id1[(Database)];
Run the app as development mode
make dev
Run the app as production mode
make prod
Generate the swagger document
make swagger
Gorm Gen
make gorm
Generate client and server codes from proto
make proto