One of the challenges of designing distributed systems is to decide which of the services that compose the application are loaded in the same process and communicate directly and which should be deployed on different boxes and use inter-process communication. Sometimes, we cannot anticipate this at all and we’d want the flexibility to change it based on usage metrics collected while the system is running in production.
In this session we will learn, from real life projects experience, how we can achieve the flexibility of deciding only at deploy time, without changing the code, on which of our services communicate in same process and which use inter-process communication. We will achieve this using the iQuarc.AppBoot library, which is an abstraction over a Dependency Injection Container and provides support for modular applications.
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
ITCamp 2017 - Florin Coros - Decide between In-Process or Inter-Processes Communication at Deploy Time
1. @ITCAMPRO #ITCAMP17Community Conference for IT Professionals
Decide Between In-Process or Inter-
Process Communication
at Deploy Time
Florin Coroş
www.infiniswiss.com | www.iquarc.com | onCodeDesign.com
florin.coros@iquarc.com
@florincoros
7. @ITCAMPRO #ITCAMP17Community Conference for IT Professionals
https://oncodedesign.com/ITCamp2017
Performance Degradation Due To Inter-Process Communication
7
Data Data Data
Database
vs
Distributed System Monolith
+ No performance drawbacks due
communication
+ Develop, Test, Maintain and Operate in isolation
+ Scalability, Reliability, Availability, Security
8. @ITCAMPRO #ITCAMP17Community Conference for IT Professionals
https://oncodedesign.com/ITCamp2017
• Develop, test and maintain in isolation as if each service is hosted
individually
• Load more services in the same process and communicate through
simple function calls
• Decompose the system regardless of deployment and communication
concern
• Decide at deploy time (configs only) which services are loaded in same
process and which communicate outside the process
• FOCUS on DECOMPOSITION and FUNCTIONALITY
Flexible Deployment
8
9. @ITCAMPRO #ITCAMP17Community Conference for IT Professionals
https://oncodedesign.com/ITCamp2017
DEMO: Example of Dependent Services
9
QuotationService
+ GetQuotations() : Quotations
IQuotationService
OrdersService
+ PlaceSellLimitOrder()
+ PlaceBuyLimitOrder()
+ GetLimitOrders() : LimitOrders
PortfolioService
+ GetPortfolioValue() : decimal
IPortfolioService
IOrdersService
10. @ITCAMPRO #ITCAMP17Community Conference for IT Professionals
https://oncodedesign.com/ITCamp2017
Individual Deployment
10
IOrdersService
OrdersService
IPortfolioService
PortfolioService IQuotationService
QuotationService
inter-process
11. @ITCAMPRO #ITCAMP17Community Conference for IT Professionals
https://oncodedesign.com/ITCamp2017
Optimized Deployment for Orders – Quotation Communication
11
IOrdersService
OrdersService
IPortfolioService
PortfolioService
IQuotationService
QuotationService
in-process
inter-process
QuotationService
12. @ITCAMPRO #ITCAMP17Community Conference for IT Professionals
https://oncodedesign.com/ITCamp2017
Host All in One Process (like a monolith)
12
IOrdersServiceIPortfolioService IQuotationService
QuotationService
in-processin-process
OrdersServicePortfolioService
13. @ITCAMPRO #ITCAMP17Community Conference for IT Professionals
https://oncodedesign.com/ITCamp2017
How to Achieve This?
13
– Depend only on Contracts implemented in abstract types
– Proxies to forward the contract calls to the actual
implementation
– Type Discovery
Through Design
14. @ITCAMPRO #ITCAMP17Community Conference for IT Professionals
https://oncodedesign.com/ITCamp2017
Code Demo
14www.github.com iQuarc Code-Design-Training InterProcessCommunication TradingApp