microservices - Microserivce on database level
问题描述
hat is the standard pattern of orchestrating microservices?
If a microservice only knows about its own domain, but there is a flow of data that requires that multiple services interact in some manner, what's the way to go about it?
Let's say we have something like this:
Invoicing Shipment And for the sake of the argument, let's say that once an an order has been shipped, the invoice should be created.
Somewhere, someone presses a button in a GUI, "I'm done, let's do this!" In a classic monolith service architecture, I'd say that there is either an ESB handling this, or the Shipment service has knowledge of the invoice service and just calls that.
But what is the way people deal with this in this brave new world of micro-services?
I do get that this could be considered highly opinion-based. but there is a concrete side to it, as micro-services are not supposed to do the above. So there has to be a "what should it by definition do instead", which is not opinion-based.
Shoot.
解决方案
在处理微服务时,有多种最佳数据库实践方式,它可能会因所使用的实体的域以及应用程序使用的范围而有所不同。
微服务中数据库设计的最佳实践很少,首先列出其中的几个。
1 - Private-tables-per-service – each service owns a set of tables that must only be accessed by that service
2 - Schema-per-service – each service has a database schema that’s private to that service
3 - Database-server-per-service – each service has it’s own database server.
您可以根据您的数据大小和数据计数混合和匹配这些。
我希望您参考并浏览此页面以获得一个完美的示例。
推荐阅读
- r - 在 WordR 上打印一个闪亮的反应值
- c# - 为什么异步扩展方法会抛出 System.NullReferenceException
- docker - 跨 Ingress 的 JMeter 主/从(Docker 到 Kubernetes)(如何让 JMeter 只使用一个 RMI 端口)
- flutter - googleplaystore 的 Flutter 包名称
- c++ - c++ how to bind a general function with multiple map object and call it clear function
- nhibernate - 自定义 IConnectionProvider 如何“注入”所需的依赖项?
- excel - VBA:单步执行时复制和粘贴范围作为图片工作,但运行时出现“运行时错误'1004'”
- postgresql - 在 postgresql 中是否可以直接读取
- java - Spring Boot 中的现有客户端验证?
- arrays - 有没有办法在 Tarantool 中存储数组的字段上建立索引?