Microservice Patterns - Hexagonal architecture




  1. Inbound adapters:  handle requests from the outside by invoking the business logic
  2. Outbound adapters:  invoked by the business logic and invoke external applications
  3. Port: defines a set of operations and is how the business logic interacts with what’s outside of it 
    1. inbound port:  an API exposed by the business logic, which enables it to be invoked by external applications. Ex. service interface / service public method
    2. outbound port:  how the business logic invokes external systems. ex. repository interface, which defines a collection of data access operations


別名演算法 Alias Method

 題目 每個伺服器支援不同的 TPM (transaction per minute) 當 request 來的時候, 系統需要馬上根據 TPM 的能力隨機找到一個適合的 server. 雖然稱為 "隨機", 但還是需要有 TPM 作為權重. 解法 別名演算法...