Microservices Architecture
Mohamad Farhani
Architectural style
This is not new!
The old new thing...
SOA
service oriented architecture
• Modernized version of SOA
New world:
• Speed of delivery
• Scalability
• Cloud / devops
VS
Monolith microservices
PRESENTATION LAYER
BUSINESS LOGIC LAYER
DATABASE LAYER
A monolith Module
A
Module
B
Module
c
Module
D
VS
monolith microservices
PRESENTATION LAYER
BUSINESS LOGIC LAYER
DATABASE LAYER
microservices
API API
BUSINESS LOGIC
LAYER
DATABASE LAYER
consume
Produce
Microservice 1
Microservice 2
Modularity
Autonomous
hide implementation details
Stateless
highly observable
principles
Modularity (TEAM)
UI - team
Dba - team
SERVER
UI dba
SERVER
dbaUI
dba
SERVER
UI
SERVER - team
monolith microservices
autonomous
autonomous
monolith microservices
hide implementation details
API
-http
-rest
-json
API
http-
Rest-
Json-
stateless
(1)
(2)
A stateless server is a server that treats each request as an
independent transaction that is unrelated to any previous
request
Highly observable
Logs
Highly observable
Centralized logging
Highly observable
Centralized logging
Highly observable
monitoring
Modularity
Autonomous
hide implementation details
Automation
Stateless
highly observable
principles
Advantages
Polyglot architecture
- The right technology for the job
- reduce technical debt
Evolutionary design
- Remove
- Add
- Replace
- Experimental microservice
Selective scalability
Nb users > 500
Big vs small
Smaller code base
Simpler to develop / test / deploy / scale
Start faster
Easier for new developers
drawbacks
• Distributed system
- Consistency
- Request travelling
• Slow (http)
• Multiple databases
• Integration tests
Conclusion:
• The Microservices architecture is more complex
Than a monolith.
• This is the cost of growing and scaling easily
Microservices ecosystem
Load balancer
Load balancer
Service discovery
server
I want TO TALK TO
THE PRODUCT
SERVICE !
Here is the product
service !
Service discovery
Service discovery (load balancing)
Service discovery
server
I want TO TALK TO
THE PRODUCT
SERVICE !
Here is one instance of
product service !
Api Gateway
API Gateway
Browser UI
e.g. angular 2
Mobile app
THANKS !

Microservices architecture

Editor's Notes

  • #3 The term "Microservice Architecture" has sprung up over the last few years to describe a particular way of designing software applications as suites of independently deployable services. While there is no precise definition of this architectural style, there are certain common characteristics around organization around business capability, automated deployment, intelligence in the endpoints, and decentralized control of languages and data.
  • #6 in software engineering, a monolithic application describes a single-tiered software application in which the user interface and data access code are combined into a single program from a single platform
  • #13 EAR: All above files (.jar and .war) are packaged as JAR file with .ear (enterprise archive) extension and deployed into Application Server. A WAR (Web Archive) is a module that gets loaded into a Web container of a Java Application Server. Basically EAR files are a superset containing WAR files and JAR files.
  • #15 Easier to scale / recover from failure
  • #27 Transactions: Increased Processing overhead – It costs many messages to be shared between sites to complete a distributed transaction.
  • #32 API gateway Insulates the clients from how the application is partitioned into microservices insulate the clients from the problem of determining the locations of service instances Provides the optimal API for each client Reduces the number of requests / roundtrips. Backend for front end