简体   繁体   English

spring引导微服务和数据完整性的不同实例

[英]spring boot different instances of a microservice and data integrity

If several instance of a same microservice contain their own database,for scalability, how update all the databases when a create, update or delete operation is made ? 如果同一个微服务的多个实例包含自己的数据库,那么为了可伸缩性,如何在创建,更新或删除操作时更新所有数据库? which tool compatible with Eureka and Zuul spring propose for that ? 哪个工具与Eureka和Zuul弹簧兼容?

I would suggest you use an Event-based architecture where any service has done his work it produces the event and other services subscribe that event will also start his work. 我建议你使用一个基于事件的架构,其中任何服务完成了他的工作,它产生了事件,其他服务订阅该事件也将开始他的工作。

you can use Kafka queue for same. 你可以使用Kafka queue also, read Distributed Sagas for Microservices 另外,阅读微服务的分布式Sagas

One more thing is that inter-communication use UDP instead of TCP. 还有一件事是通信间使用UDP而不是TCP。

Most of the databases offer replication these days with near 0 latency. 目前,大多数数据库提供复制,延迟接近0。 Unless you use the other databases you can let the database do the synchronization for you. 除非您使用其他数据库,否则您可以让数据库为您执行同步。

I would suggest you to use RabbitMQ 我建议你使用RabbitMQ

The basic architecture of a message queue is simple, there are client applications called producers that create messages and deliver them to the broker (the message queue). 消息队列的基本体系结构很简单,有些客户端应用程序称为生成器,它们创建消息并将它们传递给代理(消息队列)。 Other applications, called consumers, connects to the queue and subscribes to the messages to be processed. 其他称为使用者的应用程序连接到队列并订阅要处理的消息。 A software can be a producer, or consumer, or both a consumer and a producer of messages. 软件可以是生产者,消费者,也可以是消费者和消息的生产者。 Messages placed onto the queue are stored until the consumer retrieves them. 放置在队列中的消息将被存储,直到消费者检索它们。

Why to use this RabbitMQ?? 为什么要使用这个RabbitMQ? https://www.cloudamqp.com/blog/2015-05-18-part1-rabbitmq-for-beginners-what-is-rabbitmq.html https://www.cloudamqp.com/blog/2015-05-18-part1-rabbitmq-for-beginners-what-is-rabbitmq.html

Official document for rabbitMQ.... https://www.rabbitmq.com/ rabbitMQ的官方文件.... https://www.rabbitmq.com/

How to install rabbitMQ: https://www.journaldev.com/11655/spring-rabbitmq 如何安装rabbitMQ: https ://www.journaldev.com/11655/spring-rabbitmq

Configuration in spring boot application: Spring启动应用程序中的配置:

https://spring.io/guides/gs/messaging-rabbitmq/ https://spring.io/guides/gs/messaging-rabbitmq/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java spring 微服务中的 postgres 未显示数据 - Data are not diplayed from postgres in java spring microservice 跨不同微服务数据库的数据完整性 - Data integrity across the databases of different Microservices 如何在基于微服务的架构中从不同类型的数据库中查询数据? - How to query data from different types of databases in a microservice based architecture? 当不同的应用程序访问mysql时保持数据完整性 - Maintaining data integrity in mysql when different applications are accessing it Spring Boot 有没有办法在不复制存储库的情况下将相同的数据提交到两个不同的数据源? - Is there any way in Spring Boot to commit same data to two different data sources without duplicating the repository? 微服务架构概念问题——微服务数据和边界 - Microservice architecture conceptual problem - microservice data and boundaries 有数据完整性测试软件吗? - Is there a data integrity test software? MongoDB数据完整性 - MongoDB data integrity 将初始数据导入Spring Boot应用程序 - import initial data into spring boot app 数据持久性的 Spring Boot 依赖注入错误 - Error With Spring Boot Dependency Injection For Data Persistence
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM