Date post: | 12-Jan-2017 |
Category: |
Technology |
Upload: | mongodb |
View: | 1,890 times |
Download: | 0 times |
Monolithic to Microservices in 45 min
Understand Scalability
4
AgendaMonolithic ApplicationsMicroservicesBest PracticesHow it's Done
Monolithic Applications
"A monolithic application is self-contained, and independent from other computing applications. The design philosophy is that the application is responsible not just for a particular task, but can perform every step needed to complete a particular function"
7
8
9
Monolithic Applications• It’s very easy to start building applications that become Monolithic
– Projects start small– If successful they will grow
Super Cool Application
UI Component
Business Logic
Persistency Layer
Monolithic Applications
Super Cool Application
UI Component
Business Logic
Persistency Layer
Monolithic Applications
Super Cool InstanceSuper Cool Instance
Super Cool InstanceSuper Cool Instance
Super Cool InstanceSuper Cool Instance
Super Cool InstanceSuper Cool Instance
Decouple Applications
"Decoupled architecture is a framework for complex work that allows components to remain completely autonomous and unaware of each
other"
Decoupling your applicationsSuper Cool Application
UI Component
Business Logic
Persistency Layer
15
Reasons to Decouple
• The different components of your application have different:– Density– Release and Development cycles – Requirements
• Functional• Architecture
Decoupling your applications
UI Layer
Business Service Layer
Scalable Data Layer
… for scalability
UI Layer
Business Service Layer
Scalable Data Layer
UI Layer
UI Layer
UI Layer
UI Layer
… for different integrations
MobileUI
Business Service Layer
Scalable Data Layer
Web UI
MobileUI
Web UI
Specific UI
… for function segregation
… scale separately
Scale AxisY-axis: Functional Decomposition
X-axis: Functional Duplication Z-axis: Data Partitioning
Microservices
"Microservices is a software architecture style in which complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs"
Application Stack
UI Layer
Business Service Layer
Scalable Data Layer
Microservices
Microservices
Text Search
Recommendations Engine
Chat Service
Microservices
Microservices – Service Registry
Service Registry
Service Registry allows client side discovery of existing and available services
Host OS
Virtual OS
Virtual OS
Virtual OS
Microservices – Virtual MachinesVirtual Machines are a familiar topic, it is the backbone of many PaaS and IaaS services out there
Host OS
System Kernel
Microservices – ContainersContainers are a typical approach to deploy and maintain microservices because they're highly scalable and isolated.
Microservices – Containers
Host OS
System Kernel
Host OS
System Kernel
Host OS
System Kernel
REHL v7 Windows 2008
Web Search v1Web Search v2
Microservices – Clustering
"I'm getting dizzy"
Norberto Leite – 2015/10/06
MongoDB
Ops Manager
35
MongoDB - Containerized
• Benefit from MongoDB Scalability– Replica Sets for HA– Sharding for Horizontal Scalability
But Keep In Mind: • Sharding requires knowing well your data• Replication is much more than just spinning a few more
instances!
Ops Manager is Important for these
environments!
Use Cases
Otto Use Case
Batch analytics Layer
Frontend – System
Profile Service Customer Service Session Service Persona Service
Shared Nothing architecture
Clear Isolation of services
Hundreds of Virtual Instances
How to do it
39
Best Approach• Start monolithic
– There's nothing wrong with starting small – Your team will be small enough so they will know all the code
• Start Decoupling when you grow – In number of features and functionality – In number of teams working side by side
• Go Microservices– When you become Netflix!
40
When do Microservices Fail• Contracts
– It's important to agree on the interfaces– Developer Philosophical Beliefs
• Service Separation– Granularity – Dependencies
• Maintenance – Devops and Release Manager Burden– Monitoring– Orchestration
"…language-agnostic APIs"
"completely autonomous"
"composed of small, independent processes"
41
Best Approach - Data• Replication from Day 0
– No excuses to have a single node in production• Shard when you grow
– Functionally – By Volume – Regionaly
• Ops Manager to the rescue– Makes you life easier!
Now that you understand it… I hope