@altoros
1
Domain-driven Design
by Siarhei Matsiukevich,Cloud Engineer and Go Developer at Altoros
@altoros
@altoros
What is the main challenge in software development?
@altoros
How to measure application complexity❖Complexity of all interfaces that application uses❖+ Complexity of all interfaces that application provides❖+ Complexity of application source code
For me, the definition of complexity is the amount of things you should keep in mind when working with a software product.
@altoros
So, how we can deal with software complexity?❖Become a genius❖Improve the quality of source code❖Decompose your app into smaller pieces
@altoros
Different ways of application decomposition
@altoros
How to identify that decomposition is good?Loose coupling
@altoros
So what is the problem with that?
@altoros
How to identify modules?❖Based on physical layers separation❖To provide abstraction for components that CAN REPLACE EACH
OTHER
Don’t just do it because your architecture is better if you have many interfaces!
@altoros
Module identification based on physical layer separation
@altoros
Module identification based on layer abstraction
@altoros
Microservices
@altoros
Can a separate class or module be a microservice? Module should be transformed to a microservice when there is a need to scale this module independently.
@altoros
Microservices vs. monolithic apps
Category Monolithic Microservice
Understandability Hard to maintain Easy to understandDeployment Big Bang release Independent continuousTools Approved tools, languages,
and frameworksRight tool for Job
Scalability Scale everything Scale bottleneck services Project management Difficult to track More granular controlQuality Assurance Regression tests Localized testPlanning On a department level On a team level
@altoros
Domain-driven Design
@altoros
Bounded context
@altoros
An example of a ubiquitous language
public interface Customer { public void changePersonalName(String firstName, String lastName); public void relocateTo(PostalAddress changedPostalAddress); public void changeHomeTelephone(Telephone telephone); public void disconnectHomeTelephone(); public void primaryEmailAddress(EmailAddress emailAddress);}
public interface Customer { public void save(Customer customer); public void remove(Customer customer); public void findById(Integer id);}
@altoros
Microservices: team
“Any organization that designs a system (defined broadly) will produce a design, which structure is a copy of the organization's communication structure.”--Melvyn Conway, 1967
@altoros
18Don’t do it
1)Start from microservices2)Work without DevOps3)Create too many services 4)Forget to track latency
@altoros
19
Thank you!Want more?
www.altoros.comblog.altoros.com
twitter.com/altoros