[英]Microservices Implementation in Mysql (Relational database structure)
We have an existing project build with Mysql and Java struts.我们有一个使用 Mysql 和 Java struts 构建的现有项目。 We have to implement the new section(Let's say a CRM) in the project.我们必须在项目中实施新部分(假设是 CRM)。 The current project project we are having Mysql database and it is having around 160 tables and all these tables having connection between each other (Foreign Key relations).当前的项目项目我们有 Mysql 数据库,它有大约 160 个表,所有这些表之间都有连接(外键关系)。
The new Project we are planning to implement using Spring boot Microservices, and on using this with the existing database we are facing some issue on structuring microservices our application.我们计划使用 Spring boot 微服务实施的新项目,并且在将其与现有数据库一起使用时,我们在构建应用程序的微服务方面面临一些问题。
When we are proceeding with microservices we have two options to manage entities当我们继续使用微服务时,我们有两种选择来管理实体
Let us know if we have any other project structure that we can use in our project since our database is in mysql and each tables are tightly coupled.让我们知道我们是否有任何其他项目结构可以在我们的项目中使用,因为我们的数据库在 mysql 中并且每个表都是紧密耦合的。
Create a new commons package that contains only entity, dto and util classes.创建一个仅包含实体、dto 和实用程序类的新公共包。
Now make this commons project as dependency jar in all of your microservices project.现在将这个公共项目作为所有微服务项目中的依赖 jar。
Finally, there's no use to initiate commons project as microservice.最后,将公共项目作为微服务启动是没有用的。 To deploy a new microservice that needs commons jar as dependency then make sure you first clone the commons repository and respective repository.要部署需要 commons jar 作为依赖项的新微服务,请确保首先克隆 commons 存储库和相应的存储库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.