6. Microservices
What are the micro services?
Where did they come from?
Core principles
Why should I bother?
3 / 50
7. Microservices
What are the micro services?
Where did they come from?
Core principles
Why should I bother?
Challenges and pitfalls
3 / 50
8. Microservices
What are the micro services?
Where did they come from?
Core principles
Why should I bother?
Challenges and pitfalls
Good practices
3 / 50
9. Microservices
What are the micro services?
Where did they come from?
Core principles
Why should I bother?
Challenges and pitfalls
Good practices
Pro-tips
3 / 50
12. Microservices : whatâs that?
Post continuous delivery SOA
Small independently releasable services, that work together,
modeled around a business domain.
5 / 50
23. SOA
Break up application into set of independent services
Add extra layers
Integration Layer (ESB)
Service Layer
13 / 50
24. SOA
Break up application into set of independent services
Add extra layers
Integration Layer (ESB)
Service Layer
Rename existing layers
Frontend â Consumer Interface Layer
Database â Operational System
Middleware â Business Process Layer
13 / 50
26. Application Composition : SOA
Did well in some organizations
Not so well in others
Reasons for failure
Conwayâs Law
Ignoring CAP theorem
Ignoring Fallacies of distributed
computing
15 / 50
28. Conwayâs Law
organizations which design systems ... are constrained to produce
designs which are copies of the communication structures of these
organizations
â M. Conway
17 / 50
29. Conwayâs Law
organizations which design systems ... are constrained to produce
designs which are copies of the communication structures of these
organizations
18 / 50
31. Fallacies of distributed computing
The network is reliable
Latency is zero
Bandwidth is inïŹnite
The network is secure
Topology doesnât change
There is one administrator
Transport cost is zero
The network is homogeneous
20 / 50
44. Microservices : Good Parts
Small and focused
Independent
Loosely coupled
29 / 50
45. Microservices : Good Parts
Small and focused
Independent
Loosely coupled
Allow try and pilot new tech
29 / 50
46. Microservices : Good Parts
Small and focused
Independent
Loosely coupled
Allow try and pilot new tech
Firm module boundaries
29 / 50
47. Microservices : Good Parts
Small and focused
Independent
Loosely coupled
Allow try and pilot new tech
Firm module boundaries
Decentralized data
29 / 50
66. Good practices
Humane registries
Team composition
Isolate failures
Fail fast
Bulkheading
Standardize communications
REST or Message Queues
Robust Service Discovery
34 / 50
67. Good practices
Humane registries
Team composition
Isolate failures
Fail fast
Bulkheading
Standardize communications
REST or Message Queues
Robust Service Discovery
Consider something like Consul / Zookeeper / ETCd
34 / 50
68. Good practices
Humane registries
Team composition
Isolate failures
Fail fast
Bulkheading
Standardize communications
REST or Message Queues
Robust Service Discovery
Consider something like Consul / Zookeeper / ETCd
Monitor everything
34 / 50
72. Deployments
Avoid huge build jobs
One service per host
Host is either physical host, VM or container
Test
35 / 50
73. Deployments
Avoid huge build jobs
One service per host
Host is either physical host, VM or container
Test
Contract Tests
35 / 50
74. Deployments
Avoid huge build jobs
One service per host
Host is either physical host, VM or container
Test
Contract Tests
Consumer driven development
35 / 50
88. Understand your networking
Microservices increase network chatter
More failures with UDP based protocols (DNS, discovery)
More hiccups with TCP based protocols
40 / 50
89. Understand your networking
Microservices increase network chatter
More failures with UDP based protocols (DNS, discovery)
More hiccups with TCP based protocols
Run out of sockets
Decrease TCP timeouts, seconds instead of minutes
40 / 50
90. Understand your networking
Microservices increase network chatter
More failures with UDP based protocols (DNS, discovery)
More hiccups with TCP based protocols
Run out of sockets
Decrease TCP timeouts, seconds instead of minutes
Batch the transactions.
But canât have batching service
40 / 50
96. Robust CI/CD pipeline
1 Service = 1 Repo = 1 Build Job = 1 Artifact
Instantaneous deployments
Pre-build AMis, Containers
Test coverage
Consumer Driven Tests
Avoid integration tests written by service devs
41 / 50
97. Robust CI/CD pipeline
1 Service = 1 Repo = 1 Build Job = 1 Artifact
Instantaneous deployments
Pre-build AMis, Containers
Test coverage
Consumer Driven Tests
Avoid integration tests written by service devs
https://github.com/realestate-com-au/pact
41 / 50
98. Consider using client side load balancing
Service side load balancers create point of failure
42 / 50
99. Consider using client side load balancing
Service side load balancers create point of failure
Hard to deploy and manage HW load balancers
42 / 50
100. Consider using client side load balancing
Service side load balancers create point of failure
Hard to deploy and manage HW load balancers
Problem of running out of sockets
42 / 50
101. Consider using client side load balancing
Service side load balancers create point of failure
Hard to deploy and manage HW load balancers
Problem of running out of sockets
NetïŹix Ribbon Library
https://github.com/NetïŹix/ribbon/wiki/Working-with-load-
balancers
42 / 50