- Hands-On Microservices with Kotlin
- Juan Antonio Medina Iglesias
- 264字
- 2021-06-30 19:10:40
Loosely couple
No microservice exists on its own, as any system needs to interact with others, including other microservices, but we need to do it as loosely coupled as we can. Let's say that we are designing a microservice that returns the available offers for a giving customer, we may need a relation to our customer, for example, a customer ID, and that should be the maximum coupling that we may accept.
Imagine a scenario that for a component that uses our offers, the microservice needs to display the customer name when it displays those offers. We could modify our implementation to use the customer microservice to add that information to our response, but in doing so, we are coupling with the customer microservice. In that case, if the customer name field changes, for example, to become not just a name but is separated into surname and forename, we need to change the output of our microservice. That type of coupling needs to be avoided; our microservices should just return what information that is really under their domain.
We need to take care of how we are coupling, not only between microservices, but with everything in our architecture, including external systems. That is one of the reasons why every microservice should own its own data, this including even a database where the data is persisted.
- ASP.NET Core 5.0開發入門與實戰
- Getting Started with ResearchKit
- .NET 4.0面向對象編程漫談:基礎篇
- MATLAB實用教程
- Python數據可視化之Matplotlib與Pyecharts實戰
- C/C++數據結構與算法速學速用大辭典
- Android傳感器開發與智能設備案例實戰
- Python 3.7從入門到精通(視頻教學版)
- Python程序設計與算法基礎教程(第2版)(微課版)
- QGIS Python Programming Cookbook(Second Edition)
- 進入IT企業必讀的324個Java面試題
- 現代CPU性能分析與優化
- 分布式數據庫HBase案例教程
- Ubuntu Server Cookbook
- Developer,Advocate!