iluwatar / iluwatar/java-design-patterns
Microservice pattern: Shared database
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 94.7k
- Forks
- 27.4k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 10
Description
Description:
The Microservices - Shared Database design pattern involves multiple microservices sharing a single database schema. This pattern can be used to manage distributed data transactions and maintain data consistency across different microservices.
Main elements of the pattern:
- Shared Database: A single database is shared among multiple microservices.
- Data Consistency: Ensuring data consistency and integrity across microservices.
- Transaction Management: Handling distributed transactions efficiently.
- Service Independence: Maintaining the autonomy of each microservice while sharing a common data source.
- Database Schema Design: Careful design of the database schema to avoid tight coupling between microservices.
- Security: Implementing robust security measures to protect the shared data.
- Scalability: Ensuring that the shared database can handle the load from multiple microservices.
References:
- Project Contribution Guidelines
- Microservices Architecture Patterns - Microservices.io
- "Building Microservices" by Sam Newman
- Martin Fowler's Blog on Microservices
- Spring Cloud Documentation
Acceptance Criteria:
- Create a new package for the Microservices - Shared Database design pattern within the project.
- Implement a working example demonstrating the shared database pattern with at least two microservices.
- Ensure that the example includes:
- A shared database schema
- Transaction management across microservices
- Data consistency mechanisms
- Include unit tests and integration tests to validate the functionality.
- Provide comprehensive documentation explaining the implementation, including code comments and a README file in the package.
- Ensure the implementation adheres to the project's contribution guidelines and coding standards.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the project contribution guidelines and the referenced Microservices.io, Building Microservices, Martin Fowler, and Spring Cloud materials. Then inspect the repository's existing Java design-pattern examples to determine the appropriate package structure; done means a documented shared-database example with at least two microservices, tests, schema, transaction and consistency coverage, and a README.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, databases, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100