micro-services battle scars

28

Upload: richard-rodger

Post on 20-Aug-2015

355 views

Category:

Software


2 download

TRANSCRIPT

nearForm ❤️ micro-services. Richard Rodger @rjrodger

4 years of Node.js 50+ projects

startups to gorillas 1 user to 1 000 000

every kind team all skill levels

What do you think micro-services are made of?

You run lots of little processes, on many machines.

Your services communicate using asynchronous messages.

All services can see All messages …

and react to the ones they care about - a useful fiction!

You use pattern-matching to react to the right messages.

Messages are just JSON documents. Patterns are just property-value pairs.

info:user, what:login

You get real software components. Finally!

Here’s what software components should do for you.

•re-usable •which really means: composable

•extensible •easy to add functionality

•encapsulated and loosely coupled •the implementation does not leak

•well-defined interface •but note: this does not mean strict!

How do you write micro-services to handle this?

You always add services, never modify. Pattern matching makes this work.

Write more micro-services when you need to specialise.

Add more specific patterns for more fine-grained functionality.

You get service composition when you use pattern matching.

nodezoo.com - github.com/rjrodger/nodezoo An example system big enough to be interesting.

You can get yourself into trouble with micro-services…

💩 PILE OF POO

U+1F4A9

You may get a rash of little web servers. This never ends well.

Jon Postel: You should be liberal in what you accept, and strict in what you emit.

Define a schema for the properties of the Chair entity.

Make sure you cover all the business cases!

You can never get away from some anti-patterns.

You can use any language! What could possibly go wrong?

You’ll discover more services than you’ll design.

Architecture. The boxes and arrows don’t work anymore.

You use micro-services to perform actions. They don’t describe the world.

Don’t keep any state in your services. We’ve tried that already with OOP.

It doesn’t work.

You’ll need practice. Micro-services break lots of rules.

You can be awesome with micro-services.

🚀 ROCKET U+1F680

You can swap databases mid-project! Or anything else. Infinite Power!

Your system will scale.

You can actually do continuous deployment! Micro-services are the “unit of deployment”.

You can verify new micro-service versions work by running them beside old versions.

You’ll need some tools to make this work.

senecajs.org nearform.com/nscale nodejs.org docker.com

Thanks! Richard Rodger

@rjrodger