Learn how micro-services, Reactive Manifesto and 12-factors answer us the 'What, Why and How' questions of creating modern distributed systems. One concept, four tenets, twelve factors - rules to live by in cloud.
23. Factors I-IV
I. One codebase, many deploys
II. Declare and isolate dependencies
III. Separate config from code
IV. Treat backing services as attached resources
24. Factors V-VIII
V. Strictly separate build, release and run stages
VI. Execute apps as share-nothing processes
VII.Export services via port binding
VIII.Scale out via the process model
25. Factors IX-XII
IX. Fast startup, graceful shutdown
X. Dev/Prod parity
XI. Treat logs as event streams
XII.Run admin/mgmt tasks as one-off processes
33. Micro-service system
• Many micro-services instead of a monolith
• Do one thing and do it right
• Deploy micro-services independently
• Communicate using message queues
• Cluster locally
Second presentation of the evening. Intriguing title, talk should match. Grand unifying theory of distributed system manifestos.
My name is Dejan Glozic. Full-stack architect at IBM Canada, Toronto Lab (that's in Markham). Apps in the cloud, Node.js and micro-services, moving away from big monolithic applications. I tweet and blog about my experiences at dejanglozic.com.
First reaction “Oh, I got to attend!”. Second reaction “In fact, I should present!”. Third reaction: “What is Reactive?”. Similarities with a political concept, design pattern and a JavaScript library didn’t help.
So I studied. After reading and signing the Reactive Manifesto in excitement (6230!!), I started worrying.
I worried because it seems to me that we are shortening the cycle between notable manifestos. Look at some of the famous manifestos:
The Declaration of Independence.
The Declaration of the Rights of Men and Citizen from the French Revolution
A perennial crowd pleaser - Das Kommunistische Manifest (and soon to follow copycats, Anarchist Manifesto and Fascist Manifesto).
That’s all nice but why exactly should we worry?
Wikipedia trends. XX - golden age of manifestos. In 14 years of XXI, already as many as XIX. As many technical manifestos in 14 years of XXI as XX. At this rate, we will have 57 by the end of the century.
Producing more and more of anything over time causes inflation, which reduces the impact and effectiveness of each manifesto.
If we produce a huge number of manifestos, we can even create a hyper-inflation. Now, how can an illustrate the results of a hyper-inflation?
This should do it. This is an actual paper note from FRY of 500 billion dinars. Sadly, I was there to use it in 1993. You could buy a loaf of bread in the morning, a bagel in the evening for it. We should try to avoid inflation.
Avoid ruining manifestos by the consulting-industrial complex. In this tweet @pragdave was so excited he didn’t spot a typo. Twitter needs an ‘Oops’ button.
In the light of the fate of the Agile Manifesto, Russ Miles decided to pre-empt the creation of one for Micro-services with a tongue-in-cheek Micro-service ManifestNO.
He even proposed an official mascot. You can order it from Amazon for $29.95.
Avoid the urge to create many new manifestos. For Reactive, that ship has sailed. Try not to give up on them easily - worthy goal. We should not confuse developers by making them chose (like languages/platforms - Node.js, Scala/Akka, Go).
Make manifestos complement each other, adding to the growing understanding.
Second presentation of the evening. Intriguing title, talk should match. Grand unifying theory of distributed system manifestos.
First up (chronologically) - 12-factor App by Adam Wiggins and Heroku. It puts forward a checklist that marks a good cloud app, using Roman numerals.
Factors are marked in Roman numerals because they make manifestos sound 50% more effective.
Code in a source control, no sharing. One app - one codebase.
Self-contained, no implicit dependencies - full dependency list, package manager.
Configs vary by deploys, code doesn’t. Can you open source?
Everything is a backing service.
No code changes in a running system. No changes to builds.
Stateless - pre-cursor for clustering.
Inversion of control - no Web container.
With share nothing, easy to cluster.
Necessary for many deploys per day, zero-downtime
Keep DEV/QA/PROD environment as similar as possible to avoid surprises
Let the log processing tools handle storage and analysis
Admin tasks to the same codebase as the services
What are all these apps amounting to? Why am I doing all this?
We are still yearning for answers.
You know this one: reactive to events, load, failure and users.
Reactive manifesto adds to our understanding because it answers the ‘Why?’ question.
We can now add the third ingredient - micro-services. They don’t have a manifesto (thanks, Russ!) but they are all the buzz these days.
Martin Fowler - HBO-worthy 7 episode epic on micro-services. Then Manifesto’s own Jonas zinged him.
We can focus functionality better and isolate bad code. DevOps. Multiple teams in parallel. Bizzaro world to on-prem. Use message queues.
Each service individually clusterable. Each service can use different technology. APIs serve mobile as well. Each API service is self-documenting.
Reactive to events - MQ between services, WebSockets for server push.
Instead of competing with each other, three manifestos are complementary because they address different questions.
This allows us to see the forrest, not just the trees.
This gives us purpose. Async services, message queues - events. Local clustering - load. Paranoid programming, isolation - failure. All this makes the system responsive to users.
Share-nothing - easy clustering. Using async platforms such as JS/Node.js or Go or Scala/Play. Using RabbitMQ, Redis, WebSockets. DevOps, Blue-Green deployment etc.
Almost sounds like a life coach sales pitch. Sweet!
There you go - let’s hope we learned something from the Agile Manifesto experience, and will not let consultants ruin Reactive.
But I may be hopelessly naive…
Before I close, are there any questions?
Thank you. Find me on Twitter or visit my blog at dejanglozic.com.