Microservices: Principles and in Practice
-
Upload
cake-labs -
Category
Technology
-
view
326 -
download
2
Transcript of Microservices: Principles and in Practice
December 11thMicroservices
Principles and In Practice
Definition
“Small autonomous services that work together,
modelled around a business domain”- Sam Newman -
Building Microservices
Microservices vs Monolithic services
- Martin Fowler -
Microservices vs Monolithic services
- Philip Hauer -
When scaling.
Principles of microservices
Principle 01
Small Autonomous Services
Principle 01 -Small autonomous services that work together
Merchant API
Admin API
Consumer API
Payment API
Principle 01 -Small autonomous services that work together
Merchant API
Admin API
Consumer API
Payment API
Small??Autonomous Services?Work together
Principle 01 -Small autonomous services that work together
Merchant API
Wallet API
Notifications APIEmployee Mgt API
CINCO Onboarding API Menu Related API
Rewards API
Definition
“Small autonomous services that work together,
modelled around a business domain”- Sam Newman -
Building Microservices
Principle 02
Business Domain BasedModelling
Merchant API
Wallet API
Notifications APIEmployee Mgt API
CINCO Onboarding API Menu Related API
Rewards API
Principle 02 - Business Domain Based Modelling
Principle 03
Culture of Automation
Principle 03 - Culture of Automation
Automated TestingContinuous Delivery
Lot of upfront work for a transition
Principle 04
Hide Implementation Details
Principle 04 - Hide implementation Details
Merchant API
LEAPSET DB PROFILE
DB
Consumer API
Admin API
Payment API
Drastically impacts the ability to change
Principle 04 - Hide implementation Details
Data Level APIs
LEAPSET DB
PROFILE DB
Merchant API
Easier said than done, of course.Especially for startups and where time to market is critical
Authentication Services
You need to make a request to get the data.People who manage these data level services can do their job
Decentralization
Principle 05
Microservices architecture boasts about autonomyMicroservices architecture optimizes around autonomy
Principle 05 - Decentralization
● Do we still need to rely on another party to create a new server instances?
○ I know.. I know … checks and balances are required.. that’s fine.○ Practical issues...shush!
● Do we still rely on another party for deployment?○ Deserves a separate section on its own - Mr Mumtaz will cover it
● Do we have to communicate to all other teams in the Cake ecosystem for us to push a release
● Is it a one man show? What happens if “that man” is done and dusted?○ One centralized architect? Is he the guru for everything or is to
the team that comes together..Where is brainstorming? collective decision making? Many brains against one?
● Decentralization does not mean decentralizing everything
Principle 05 - Decentralization
Principle 05 - Dumb Pipes
ESB
Merchant API Admin API Payment API IDM Other APIS
Clients
● Should not be domain aware● Cannot become too smart
Principle 06
Consumer First
Principle 06 - Consumer First
● Api Blueprint● Raml● Swagger
○ Features;■ Industry Standard - Open API Initiative (OAI) - Has announced
an open governance model around the Swagger Specification under the Linux Foundation.
■ Largest community and has been around since 2011. ■ Stub generators and Live documentation demo. Can be used
as interactive sandbox■ Open source 100%
○ Platform Swagger Url■ https://plat1-api.leapset.com:8343/sandbox/
Principle 06 - Consumer First
Principle 06 - Consumer First
● Service Discovery tools
Principle 07
Isolate FailureObserve and Debug Failure
Principle 07
● Log aggregation tools - make it highly observable.○ Logstash○ Just imagine logging into 40 servers to debug issues
● Tools that can be used for monitoring○ Cacti○ Nagios○ Graphite○ Grafana
Principle 07
● AWS Autoscaling
● Correlation Ids
Principle 08
Deploy Independently
Virtual Machine vs Containers
Docker
Docker allows you to package an application with all of its dependencies into a standardized unit for software development.
Docker
● Lightweight● Open● Secure● Accelerate Developer Onboarding
○ Eliminate Environment Inconsistencies● Easily Share and Collaborate on Applications
○ Ship More Software Faster○ Portable○ Fast
AWS Elastic Beanstalk
● An AWS Product● Infrastructure manager● Reduces management complexity without restricting choice or
control● Quickly deploy and manage applications in the AWS cloud
Demo
Demo
Demo
SF ConnectorCAKE Platform
AWS Elastic Beanstalk
Do we have a problem?
Do we have a problem?
Do we have a problem?
A Solution
Amazon ECSAmazon EC2 Container Service
Amazon ECS