2. Agenda
● Evolution of application infrastructure
● Web application architecture models
● What is a microservice?
● How are microservices utilized?
● A case study
4. Mainframe PCs &
Servers
Web Cloud
App
UI
DB
Monolithic
Client
Server
UI
DB
Client Server
App
UI
DB
N-Tier
UI
App
DB
App
DB
App
DB
App
DB
App
DB
App
DB
Service Oriented
InfrastructureApplications
6. Monolithic
● Tightly coupled
components
● Large
codebase
● Difficult to
change
● Long release
cycles
● Waterfall
development
Highly sensitive to
errors
Normalized
data models
Single
technology stack
Large
development teams
Expensive to scale
infrastructure
●
●
●
●
●
Architecture
7. Application
Web Browser
Users Manager
Products
Manager
Inventory
Manager
Orders Manager
Users Products
Inventory Orders
Components Libraries of
reusable code
Inter-component
communication
In-process calls
Orchestration Application Logic
Interface Definitions Code
documentation
Technology Stack Single application
platform
Persistence, Data
Management, Data
Models, Consistency
Centralized
Persistence, Single
Database, Unified
Data Model,
Transactional
Consistency
8. ● Tightly coupled
services
● Partitioned
codebase
● Easier to
change
● Shorter release
cycles
● Iterative
development
Less sensitive to
errors
Normalized
data models
Single
technology stack
Several smaller
development teams
Cheaper to scale
infrastructure
●
●
●
●
●
Service Oriented Architecture
9. Web App
Users Products
Inventory Orders
Components Independently
deployed services
Inter-component
communication
Tightly coupled
Messages
Orchestration Service Bus
Interface Definitions Discoverable,
provider contracts
Technology Stack Disparate
application
platforms
Persistence, Data
Management, Data
Models, Consistency
Centralized
Persistence, Single
Database, Unified
Data Model,
Transactional
Consistency
Users
Manager
Products
Manager
Inventory
Manager
Orders
Manager
Service Bus
10. ● Loosely coupled services
● Small codebase per service
● Built for change
● Short release cycles
● Iterative development
Resilient to errors
Denormalized data model
Multiple technology stacks
Several small development teams
Cheaper to scale infrastructure
●
●
●
●
●
Microservices Architecture
12. Small Service
● Provides one or more RESTful API endpoints
● All APIs are related to a single functional domain or entity
● APIs generalized for covering maximum use cases
● Code size small enough for a single SCRUM team to own and
manage
Users
Manager
Products
Manager
Inventory
Manager
Orders
Manager
13. Independent Service
● Functional Independence: Not dependant on any other microservice
● Data Independence: Owns its data entities
● Technology Independence: Uses tech stack that is best suited
● Denormalized: Keeps a copy of all data required for its functioning
Users
Manager
Products
Manager
Inventory
Manager
Orders
Manager
Users DB Products DB Inventory DB Orders DB
14. Event Aware Service
● Publishes all significant events that occur in its domain or entity
● Subscribes to all dependent events that affect its domain or entities
● Able to regenerate all its data by replaying past events
Users
Manager
Products
Manager
Inventory
Manager
Orders
Manager
Users DB Products DB Inventory DB Orders DB
Events Store/Queue
15. Extensible, Expendable Service
● Multiple instances of the same service can coexist
● New version of a service can be tested along with an old version
● Other services are not affected by changes in one service
Events Store/Queue
Users
Manager
ver 1.1
Users DB
ver 1.1
Users
Manager
ver 1.0
Users DB
ver 1.0
Inventory
Manager
Inventory DB
Orders
Manager
Orders DB
Products
Manager
Products DB
17. Responsive UI Applications
Web UI App Mobile UI App
Generalized APIs
Users
Manager
Products
Manager
Inventory
Manager
Orders
Manager
Users DB Products DB Inventory DB Orders DB
Events Store/Queue
18. API Gateway
Web UI App Mobile UI App
Generalized APIs
Users
Manager
Products
Manager
Inventory
Manager
Orders
Manager
Users DB Products DB Inventory DB Orders DB
Events Store/Queue
API Gateway
UI Optimized APIs
19. Monolithic Architecture Service Oriented Architecture Microservices Architecture
Components Libraries of reusable code Independently deployed
services
Services of reusable
applications
Inter-component
communication
In-process calls Tightly coupled Messages Publish-Subscribe Events
Orchestration Application Logic Service Bus Event Queue
Interface Definitions Code documentation Discoverable, provider contracts Discoverable,
consumer-driven contracts
Technology Stack Single application platform Disparate application platforms Independent applications
Persistence, Data
Management, Data
Models, Consistency
Centralized Persistence,
Single Database, Unified
Data Model, Transactional
Consistency
Centralized Persistence, Single
Database, Unified Data Model,
Transactional Consistency
Polyglot Persistence, Multiple
Databases, Domain-driven
Bounded Contexts, Eventual
Consistency
Comparison Chart