immutability: from code to infrastructure, the way to scalability - voxxed days luxembourg 2016

89
IMMUTABILITY, FROM CODE TO INFRASTRUCTURE, THE WAY OF SCALABILITY @ WAXZCE QUENTIN ADAM AT

Upload: quentin-adam

Post on 16-Apr-2017

348 views

Category:

Software


0 download

TRANSCRIPT

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

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

Keep your apps online. made with node.js, scala, java, ruby, php, python, go

Cloud & on premise ;-)

And learn a lot of things about your code, apps, and good/bad design

Give back to the community

NEVER GONNA LET YOU DOWNclever-cloud.com

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

Classical iteration with loops

Functional programming map using lambda

Ephemeral COPY

Immutable collection + java 8 lambda

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 work45

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?

Split data and process:FS composition

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

Rebalance hardware allocation?Redeploy new instance

Predicable fail of the application?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

Service uptime!=server uptime

no more Olympic contest on uptime

Does it apply on data?

Basic nosql vision:Store everything

No more delete or update

Cqrs?Immutable DB?

BTRFS Copy on write

Because history matter Git

think

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 ?

Clever Cloud gift coupon:voxxedlux16