4. 4
Monolith
..an architectural style that structures the application as a
single executable unit
• Simple to develop, test & deploy
o At most one technology per layer
• Simple to scale
o Run multiple copies (horizontal
scaling) behind a load balancer
Benefits
Image source: microservices.io
5. 5
Monolith: Problems
• Difficult to achieve operational agility
o Huge and intimidating code base for developers
o Long lead times for releasing new functionality because involves people with all skills coming together
Redeploy entire unit to change one (sub) component
Refactoring take minutes, builds take hours, testing in Continuous Integration takes days
o Interrupts long running background (e.g. Quartz) jobs
o Increase risk of failure
• Single development stack - limits right tool for the job
• Convoluted database model
• Scaling is often a challenge
o Running a copy of the whole system is resource-intense
o Doesn’t scale with data out-of-the-box
6. 6
Microservices
..an architectural style where applications are broken into
smaller *autonomous services that work together
• Developed by small engineering teams
• Can be written in any language /
framework
Benefits
*independently developed, run and operated
Trade-off: Complexity
Image source: microservices.io
7. 7
ConceptualTechnicalTeam
One large application
that serves the business
function
Small Independent
autonomous, auto
deployable, domain driven
services of one application
Each service is dependent
on the other
Each service has
independent stack &
de-centralized data
Organization
al
UI Team DBA Team Test Team Build TeamServer Team
Service 3 team
Service 1 team
Cross Functional
Autonomous
Service teams
Embraces pure agile
that is cross functional
Every service team is
small and responsible
end to end.
Monolith vs. Microservices
9. Docker is a shipping container system for code
MultiplicityofStacksMultiplicityofhardware
environments
QA server
Development
VM
Contributor’s
laptop
Customer Data
Center Production
Cluster
Public Cloud
Static website User DB Analytics DBQueueWeb frontend
Doservicesandapps
interactappropriately?
CanImigratesmoothlyand
quickly
…that can be manipulated using
standard operations and run
consistently on virtually any
hardware platform
An engine that enables any
payload to be encapsulated as
a lightweight, portable, self-
sufficient container…
10. “Kubernetes is an open-source system for
managing containerized applications across
multiple hosts in a cluster. Kubernetes provides
mechanisms for application deployment,
scheduling, updating, maintenance, and
scaling.”
Kubernetes
Traditionally, enterprise Applications are built in three parts: a database (consisting of many tables usually in a relational database management system), a client-side user interface (consisting of HTML pages and/or JavaScript running in a browser), and a server-side application. This server-side application will handle HTTP requests, execute some domain specific logic, retrieve and update data from the database, and populate the HTML views to be sent to the browser.
It is a monolith – a single logical executable.
To make any alterations to the system, a developer must build and deploy an updated version of the server-side application. Yet it is simple to develop, test and deploy. Though comes at a cost, simple to scale as well
And they come with many problems
Huge code base, long lead times for releasing new functionality because involves people with various skills collaborate.
Deploy / release entire unit for even smallest of the changes
Refactoring takes minutes and builds take hours.
Testing in CI takes days
Interrupts long running background jobs
Increases risk of failure
Built with a single development stack limiting right tool to be used for the job.
Very complex data model with lots of relations / FKs
Scaling is often a challenge (entire system has to be scaled together and hence resource-intense).
Introduced around 2012, it has steadily gained in popularity. But what are microservices and what are the pros and cons of adopting them? At its most basic level, the term “microservices” denotes a style of software architecture with applications broken out into smaller autonomous services. It takes the programming concept of breaking out functionality into different classes or libraries and moves that to the service level.
The monolith is instead disassembled into a set of independent services that are developed, deployed and maintained separately.