microservices without the hassle

37
Microservices without the Hassle Alexis Richardson & Fintan Ryan Weaveworks Contact: [email protected] @weaveworks

Upload: weaveworks

Post on 11-Aug-2015

132 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Microservices Without The Hassle

Microservices without the Hassle!

Alexis Richardson & Fintan Ryan !Weaveworks!

!Contact:!

[email protected]!@weaveworks!

Page 2: Microservices Without The Hassle

- Martin Fowler!

“Microservices are an approach to developing a single application as a suite of small,

connected, services”!

“Loosely coupled service orientated architecture !with bounded contexts”!

!- Adrian Cockcroft!

Page 3: Microservices Without The Hassle

Docker, Port Mapping !and Service Registries!

Make Microservices Easy?!

Page 4: Microservices Without The Hassle

Port Mapping is Easy?!!

# docker run –d –p 12345:54321 myapp!

Page 5: Microservices Without The Hassle

Port Mapping is Easy?!!# docker run –d –p 12345:54321 myapp-a !

# docker run –d –p 12346:64321 myapp-b!# docker run –d –p 12347:74321 myapp-c!

!

Page 6: Microservices Without The Hassle

Port Mapping is Easy?!Lets go to two hosts!

!!

Page 7: Microservices Without The Hassle

> 1 host!•  We now need (at a minimum)!

•  A lookup mechanism!

•  A way to make our apps aware of other services!

•  Which means!

•  Application modifications!

•  More integration points!

Page 8: Microservices Without The Hassle

Have we not heard this before?!

Page 9: Microservices Without The Hassle

Appservers? Platforms?!

•  We have, and generally when someone wants to sell you another “layer”, such as an app server!

•  One size does not fit all!

•  Not every app is a 12 factor web app, fits neatly into a PaaS or requires the functionality of an appserver!

•  Small composable tools and services work!

Page 10: Microservices Without The Hassle

Virtual Machines for Microservices Deployment!

•  Overhead for monolith apps is acceptable!

•  Useful, but far too heavyweight, for microservices as the number of instances increase!

•  People still think of, and manage, virtual machines as servers… hard to run 10 of them in dev on laptop!

•  Exacerbates VM sprawl!

Page 11: Microservices Without The Hassle

Containers for Microservices Deployment!

•  Scale from laptop to cloud!

•  Many can be run on a single host without impacting each other!

•  Extremely quick to launch and kill!

•  Easy to integrate into your CI solution!

•  Allow very fine grained specification and control !

•  Individual containers are very portable & lightweight!

Page 12: Microservices Without The Hassle

Single Host Purpose!

Page 13: Microservices Without The Hassle

Machines Containers!

• Easy to use !• Single Purpose environment!• Microservices!!

• But: non trivial once you move beyond a single host and micro-services need networking and other tooling!

Page 14: Microservices Without The Hassle

Multi Host!

Page 15: Microservices Without The Hassle

What’s needed!•  For multi host micro-services with containers need!

•  As easy to use as docker!

•  and configurable via software to support automation!

•  Scale from laptop to cloud!

•  As portable as docker!

•  Consistent in a dynamic environment (services start, stop, fail)!

•  Scale independent of IaaS or other infrastructure!

Page 16: Microservices Without The Hassle

Weave!•  What? Portable application clusters made easy!

•  How? Service discovery & address automation via a secure, application orientated virtual container network!

•  Write the application and get the networking to do what you need not vice versa!

•  Minimum configuration, it just works !

•  Containers do not require specialist knowledge of other containers to connect to each other!

Page 17: Microservices Without The Hassle

Weave!

•  Connect services across hosts!

•  Across data centres!

•  Across clouds!

Page 18: Microservices Without The Hassle

Weave!

•  Connect services across hosts!

•  Across data centres!

•  Across clouds!

With the same interface and !

no application changes!

Page 19: Microservices Without The Hassle

Single Host!

Page 20: Microservices Without The Hassle

Multiple Hosts!

Page 21: Microservices Without The Hassle

Multiple Clouds!

Page 22: Microservices Without The Hassle
Page 23: Microservices Without The Hassle

Service Discovery!

•  Service discovery is key to microservices!

•  What do we really need?!

•  What well known tools solve most of these problems?!

Page 24: Microservices Without The Hassle

Jeff Lindsay (Progrium) argues!

Lookup and Connect to Services!

Register services and monitor service health!

Highly available service directory!

What do we really need?!

Page 25: Microservices Without The Hassle

Microservices Questions!

Lookup and Connect to Services! essential!

Register services and monitor service health!

essential, but in two parts – service monitoring and

container monitoring!Highly available service

directory!YAGNI in a lot of

cases!

What do most developers need?!

Page 26: Microservices Without The Hassle

Containers & Port Mapping!

•  Port mapping everywhere!

•  An anti-pattern we have developed out of necessity in the monolith era!

•  Transposed to Microservices!

•  And avoidable….. !

Page 27: Microservices Without The Hassle

DNS!

•  Very well defined, well understood protocol!

•  Ubiquitous !

•  We have spent most of the cloud era avoiding DNS because of “organisational scar tissue”!

Page 28: Microservices Without The Hassle
Page 29: Microservices Without The Hassle
Page 30: Microservices Without The Hassle

Containers & WeaveDNS!

•  No need to do port mapping ~ eliminates most use cases for a service directory!

•  Automatically registers services using DNS!

•  “Container health” – the service is either in DNS or not, monitor service health separately !

Page 31: Microservices Without The Hassle

WeaveDNS!•  DNS for containers!

•  Part of Weave!

•  very lightweight!

•  nothing to configure!

•  nothing to maintain!

•  no change request to submit when you need a new name…. !

Page 32: Microservices Without The Hassle

WeaveDNS!•  Just launch your containers with a hostname!

•  WeaveDNS will do the rest!

•  Service is addressable by a known hostname!

•  WeaveDNS can do simple round robin load balancing efficiently as you are in a constrained network!

•  Easy to query via dig for information that load balancers or other tools may need!

Page 33: Microservices Without The Hassle

WeaveDNS!

Page 34: Microservices Without The Hassle

An Example!

Page 35: Microservices Without The Hassle
Page 36: Microservices Without The Hassle
Page 37: Microservices Without The Hassle

Questions?!!

@weaveworks / @monadic / @fintanr!!