Object invariants, immutability & you full talk (v1) - AmsterdamPHP
Immutability: from code to infrastructure, the way of scalability - snowcamp 2016
-
Upload
quentin-adam -
Category
Technology
-
view
971 -
download
0
Transcript of Immutability: from code to infrastructure, the way of scalability - snowcamp 2016
Use Promise, Future and some functional programing stuff without being a math nerd.
Immutability, from code to infrastructure, the way of scalability @waxzce Quentin ADAM at snowcamp
Quentin ADAM from the Clever Cloud@waxzce on twitter github- soundcloud instagram .Who am I ?
My day to day work : Clever Cloud, the IT automation company
And learn a lot of things about your code, apps, and good/bad designKeep your apps online. made with node.js, scala, java, ruby, php, python, go
And learn a lot of things about your code, apps, and good/bad design
When you need to scaleThere are 2 ways
Growing and growing until you explode or become weird
Or split the work and make your software work as a team
Build an army of fat appYou can do both
So we need to be able to dispatch the workScale outMany workers doing the same thingNo SPOFGrowing is more easyIntroduce best practice
Scale up1 Fat instance1 Fat applicationSPOF (single point of failure)Hard to maintainAlways has a limitShort term meaningBest long term solution
Scale out
Create parallel work unit
CPU:many cores
Apps:clustering
Team:microservice
Synchronize access to the data by the actors
Data management is mandatory
Access to the data in a mutable state
Make everybody works
Consider variable or VM as a data box
Possible state in a mutable stateHistory
Is the data readable?
Fix state of the data to ensure accessibility
Possible state in an immutable stateVery simple to predicate
Fix the data in a immutable state
Avoid history
example on collections management
Ephemeral COPY
Determined scenario
RAM & space
Split process and storage
Consider more things as dataUser accountUsers dataFilesSessionsEvents
Data qualification
Immutability for your code
Immutability as a pattern
lets talk about infrastructure
40 times in 5 years price drop of AWSServers costS ARE going down
Google I/O 2015race to zeroI.E the server is FREE
In fact, all you have isCool. you have a server.
hosting
Integrating a new technical stack can take monthsInstalling new software is just a tiny part of the work41
Create history
documentation
Specific
Taylor made
Not able to scale
Do not create history
Ephemeral servers?
Immutable infrastructure
There is one process: build
Then, register
And live without data
And die when more updated version is there
Trash old version
How to manage data?
VM, docker, kubernetes, puppet, ansible, vmware This is not the problemTechnologies?
fully automated hosting factory
Production has to be perfect
People are not perfect
people have nothing to do on production stuff
ultron
At Clever Cloud ssh connection is a red alert
An instance is dead or alive and thats all
App fail ?Redeploy new instance
Operation system update ?Redeploy new instance
Operation system update ?Redeploy new instance
Picking one instance or another doesnt matterStatelessness is the key
Because you will not rely on a server anymore
Create a factory of instance
Be consistent and predictable
no more Olympic contest on uptime
immutability
Immutability : never delete, always clone, be stateless
And log all to get an event stream ;-)
Im on twitter : @waxzce
[email protected] you !Any questions ?