-
How to create a microservices project in Spring Boot, using Spring Boot Cloud, and related dependencies.
-
How to create Multi module Maven project, and knowing parent child modules relationships.
-
How to Add and reuse a self developed module in future projects by injecting it as a dependency.
-
- Ensure that the Java entity field types match the database column types exactly.
- For ID fields, verify whether the database column is
String
or a numeric type (likeBIGINT
,INT
, etc.) and adjust the entity class field type accordingly. - When using
@Id
along with@GeneratedValue
for primary keys, ensure the data type is compatible with the chosen - generation strategy (e.g.,
AUTO
,IDENTITY
, orSEQUENCE
generators are commonly paired with numeric types, notString
).
-
- How to Configure Spring Data JPA and Hibernate for database connection settings and entity mappings.
- Make sure that the
hibernate.dialect
matches the database (e.g.,PostgreSQL
,MySQL
, etc.).
-
Validate the schema mapping using Hibernate auto-generation features (e.g.,
spring.jpa.hibernate.ddl-auto=validate
during development). -
How to catch Exceptions
-
- In this project I preferred using numerical IDs for primary keys where possible to leverage
@GeneratedValue
effectively with sequence. - Researching how to make
String
as an ID, using other strategies strategy (e.g., UUID generator).
- In this project I preferred using numerical IDs for primary keys where possible to leverage
-
Adding logging for debugging and following issues that may happen.
-
In this project I have used PostgreSQL, and MongoDB for different Microservices.
-
HTTP has been used as the communication pattern between microservices, at first restTemplate was used , then Open Feign was used to abstract clients and reduce redundancy, repeated, and hard to manage configurations.
-
At first communication between services was done manually by referring to the host and PORT, but since that introduce challenges in real-world projects, Eureka Server was used as Server discovery
-
To Efficiently distribute the requests between many instance of the same service, a load balancer (using Round Robin) was implemented by utilizing @LoadBalanced annotation.
Utilizing Docker and docker-compose to add required dependencies (PostgreSQL, zipking, etc) , establishing network between these services, and exposing ports to be connected to from the app.