An Introduction to Microservices
-
Upload
ad-van-der-veer -
Category
Software
-
view
135 -
download
2
Transcript of An Introduction to Microservices
![Page 2: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/2.jpg)
About me
Actually a ‘Strategic Product Designer’
![Page 3: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/3.jpg)
About me
But spend the other 50% on programming backend services
![Page 4: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/4.jpg)
About me
But most importantly: my Graduation Project at the Delft University of Technology
![Page 5: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/5.jpg)
Contents
Microservices: • What is it? • Why should you use it? • Why shouldn’t you use it? • How should you use it? • What’s next?
![Page 6: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/6.jpg)
So, what the Freck is it?
![Page 7: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/7.jpg)
Our Example: Magento ( 8,511,815 lines of code )
![Page 8: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/8.jpg)
Breaking it up
![Page 9: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/9.jpg)
Small? Logical?
“Write services that do one thing and do it well. Write services to work together. Write services to handle RESTful http, because that is a universal interface.”
![Page 10: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/10.jpg)
Small? Logical?
“For us, a service is micro if we can rewrite it in 2 weeks or less”
![Page 11: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/11.jpg)
Breaking up Magento
System
Products
Customers
EAV
Sales
Get /products/21 POST /transactions
![Page 12: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/12.jpg)
How is this different from SOA?
- Less specs (WS-*) - Focus on being small - Fit with Agile - JSON > XML - ??
![Page 13: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/13.jpg)
Why should you use it? (The 5 most popular PRO’s)
![Page 14: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/14.jpg)
1. The Right Tool for the Job
System
Products
Customers
EAV
Sales
Get /products/21 POST /transactions
![Page 15: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/15.jpg)
2. Division of Labor(before)
![Page 16: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/16.jpg)
2. Division of Labor (after)
Get /products/21 POST /transactions
![Page 17: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/17.jpg)
3. Cognitive Scaling (before)
![Page 18: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/18.jpg)
3. Cognitive Scaling (after)
Get /products/21 POST /transactions
![Page 19: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/19.jpg)
4. Limited blast radius
![Page 20: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/20.jpg)
4. Limited blast radius
Get /products/21 POST /transactions
![Page 21: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/21.jpg)
5. Defer Decisions
System
Products
Customers Analytics
?
Sales
Get /count
![Page 22: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/22.jpg)
Why shouldn’t you use it? (The 5 most popular CON’s)
![Page 23: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/23.jpg)
1. DevOps Mentality is a Must
Get /products/21 POST /transactions
![Page 24: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/24.jpg)
2. Complexity movement
Get /products/21 POST /transactions
![Page 25: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/25.jpg)
3. Polyglot and Shared libraries
System
Products
Customers Sales
Get /products/21 POST /transactions
![Page 26: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/26.jpg)
4. (Integration) Testing
Sytem
Products
Sales
![Page 27: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/27.jpg)
5. interface Management
Products
![Page 28: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/28.jpg)
How should you use it?
![Page 29: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/29.jpg)
‘Separation of Concerns’
At the process level: - Instances: services - interfaces: RESTful
endpoints
![Page 30: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/30.jpg)
API Gateway
Products
Customers Sales
API Gateway: Authentication&Routing
System
![Page 31: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/31.jpg)
HTTP (REST)
Products
Customers Sales
API Gateway: Authentication&Routing
HTTP
HTTP
HTTP
HTTP
System
![Page 32: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/32.jpg)
Message Queue (MQ)
Products
Customers Sales
API Gateway: Authentication&Routing
HTTP
HTTP
HTTP
HTTP
HTTP HTTP
System
![Page 33: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/33.jpg)
How to Transitioning from A Monolith?
Piece by piece: “Whenever a big new feature change came along, we asked ourselves? Can we split this into a seperate microservice?”
Sales
HTTP
![Page 34: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/34.jpg)
Tools and Technologies (step by step)
![Page 35: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/35.jpg)
Step1 : Write something Tools& Techs: - JAVA - Go - .Net - Node.js … Standard(s)?: Simple to run (separate) processes
![Page 36: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/36.jpg)
Step 2: Test it Tools& Techs: - REST Clients (Paw, Postman) - Language specific
test/mock frameworks
Standard(s)?: Ad hoc testing
![Page 37: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/37.jpg)
Step 3: Commit it Tools& Techs: - GitHub - BitBucket - Launchpad - In-house hosting Standard(s)?: Support many repo’s, easy to use (GitHub?)
![Page 38: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/38.jpg)
Step 4: Encapsulate it Tools& Techs: - Docker - (platform specific
process encapsulation)
Standard(s): Docker
![Page 39: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/39.jpg)
Step 5: Wire it up
Tools& Techs: - Docker based:
- (google) Kubernetes - (openshift) GearD - (spotify) Helios - Many more…
- DNS service disco - Immutable:
- Terraform & Packer Standard(s): None, very much in flux, also check: http://www.mindmeister.com/389671722/docker-ecosystem
![Page 40: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/40.jpg)
Step 6: Keeping Track Tools& Techs: - ELK stack - Nagios - Statsd/Graphite - … Standard(s): Whatever your company is comfortable with and has support for your poly glot env
![Page 41: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/41.jpg)
And check out..
![Page 42: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/42.jpg)
What’s Next?
![Page 43: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/43.jpg)
1: Docker will lead development
![Page 44: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/44.jpg)
2: Cloud providers will create convenient services (e.i lock-ins)
![Page 45: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/45.jpg)
3: Development tools are needed for (contract) testing and isolation
Products
Customers Sales
API Gateway: Authentication&Routing
HTTP
HTTP
HTTP
HTTP
HTTP HTTP
System
![Page 46: An Introduction to Microservices](https://reader035.fdocuments.us/reader035/viewer/2022081502/55a686bc1a28abed088b46f3/html5/thumbnails/46.jpg)
Thank you! please check out: