Slide 1

Slide 1 text

Effortless Serverless

Slide 2

Slide 2 text

The journey Current development and deployment Problems Washing machines Servers Serverless

Slide 3

Slide 3 text

Random startup company • Education • Innovative • Investments (millions $$$) • High level experts, publications, patents • Switched to new stacks a few times already, each “better” than the previous one • 100,000s users

Slide 4

Slide 4 text

Organization Customers (Angular) API Admin (Angular) Company site (Wordpress) Elastic Search “State of the art” Other services Owners (Angular)

Slide 5

Slide 5 text

Infrastructure VPS (server rental) • Heroku • EC2 • Azure Environments (per server) • Development • Staging • Production

Slide 6

Slide 6 text

Scaling, balancing? • Capacity planning 
 At best random guesses. 100,000 users. 
 Estimations - at most 20,000 are going to login at the same time, horrible mistakes • Environments setup
 dedicated DevOps guys = dedicated cursing machines • Deployment
 ssh, scp everything • Scaling, Balancing
 the hell

Slide 7

Slide 7 text

Problems • Taking 15 mins to 1 hour to deploy a “bug” to all production servers • One service eating up the server memory, other dying and not logging • Most of the time just waiting for a request • Recovery time (2-7h) • Configuring a new server took 2h • Pressure / Yelling • Angry phone calls / messages at 4 am - 
 “Are you awake? The production crashed.”

Slide 8

Slide 8 text

Servers are most similar to?

Slide 9

Slide 9 text

Washing machines What the hell they have in similar with the current development and deployment issues? Quite a lot.

Slide 10

Slide 10 text

Washing machine • Processing machine - cleans clothes • Receives various types of clothes • Has a maximum amount • Can mix different types of clothes • You can buy various types from a big one to handle more, to small ones

Slide 11

Slide 11 text

Problems • Takes from 15 minutes to 2h to wash all your laundry • One cloth color can spoil the other - your special princess dress • Waiting, until it receives clothes • Can get stuck or broken (then you have to call the plumber)
 Recovery time: > 1 day • Buying a new washing machine and setting it up >2h • You can buy a big one to handle more, but then its dumb to turn it on just for one shirt f.e. - so you usually wait • Your partner yelling at you for breaking it 
 (definitely not from a personal experience)

Slide 12

Slide 12 text

Looks familiar?

Slide 13

Slide 13 text

• Taking 15 mins to 1 hour to deploy a “bug” to all production servers • One service eating up the server memory, other dying and not logging • Most of the time just waiting for a request • Recovery time (2-7h) • Configuring a new server took > 1h • Hexa-core for an Angular app? Seriously? • Pressure / Yelling • Angry phone calls / messages at 4 am 
 (“Are you awake? The production crashed.) • Takes from 15 minutes to 2h to wash all your laundry • One cloth color can spoil the other - your special princess dress • Waiting, until it receives clothes • Can get stuck or broken (then you have to call the plumber)
 Recovery time: > 1 day • Buying a new washing machine and setting it up > 1h • You can buy a big one to handle more, but then its dumb to turn it on just for one shirt f.e. - so you usually wait • Your partner yelling at you for breaking it 
 (definitely not from a personal experience) Server issues Washing machine issues Can’t be the same…

Slide 14

Slide 14 text

The rise of the laundry
 ”The evolution of the laundry industry” First “Washateria” 1934. Mass laundromats 1950s First “Fluff and Fold” services 1970s Mass “FnF” and the decline of laundromats 2000s

Slide 15

Slide 15 text

And servers? First “VPS’ 2001. The “Cloud” 2005 Serverless? ?

Slide 16

Slide 16 text

So serverless is? • The new “Fluff and Fold”? • The new “cloud”? • Silver bullet? • Holy grail? • Cure for cancer?

Slide 17

Slide 17 text

This?

Slide 18

Slide 18 text

Serverless is a method of deploying and running applications on cloud infrastructure, on a pay-per-use basis and without renting or buying servers. Serverless But how does not having servers help?

Slide 19

Slide 19 text

Serverless does not exclude the existence of servers. It just abstracts away the need to physically rent or buy a server, including setting up its OS, environment, installing services, and so on. Serverless

Slide 20

Slide 20 text

How does that work? Containers 
 Isolated environment that contains everything your application needs to run - as plant pots.

Slide 21

Slide 21 text

Pay per use?

Slide 22

Slide 22 text

Average API server usage Utilization Intervals 35% 60% 80% 06 09 12 15 18 70% 45% 21 00 03 06 0% 100% Looks good enough? Price: 100$

Slide 23

Slide 23 text

What if we change the perspective?

Slide 24

Slide 24 text

Average API server wasted time Intervals 65% 40% 20% 99% 30% 55% 95% 99% 0% 100% Bad enough? Waste 06 09 12 15 18 21 00 03 06

Slide 25

Slide 25 text

Wow, just an average of ~ 62.8% wasted resources

Slide 26

Slide 26 text

API server utilization + an unexpected peak Utilization Intervals 35% 60% 110% 70% 45% 0% 100% So having new customers Is a problem ?! “Unexpected” peak = new required capacity 06 09 12 15 18 21 00 03 06

Slide 27

Slide 27 text

Burn more! Because, why not?

Slide 28

Slide 28 text

The “new” API server usage Utilization Intervals 28% 54% 80% 63% 38% 0% 100% We are “safe” now! Buffer New Price: 150$ - (if you’re lucky) 06 09 12 15 18 21 00 03 06

Slide 29

Slide 29 text

Need more servers?

Slide 30

Slide 30 text

Just do it! We have a million dollar investment!

Slide 31

Slide 31 text

The serverless way • Pay per request • No request - no charge • No request - no active server • “Hosting” your app is free

Slide 32

Slide 32 text

Providers (most notable) • Amazon - AWS Lambda • Microsoft - Azure Functions • Google - Google Cloud Functions • IBM - BlueWhisk

Slide 33

Slide 33 text

Example (AWS Lambda + Claudia.js)

Slide 34

Slide 34 text

Other Benefits?

Slide 35

Slide 35 text

Refactoring • Makes sense as it has a financial incentive • Better code, less cost • No more statements: “Well, its working good enough already”

Slide 36

Slide 36 text

Code efficiency • Slower code has bigger repercussions. • Algorithms having a stronger impact 
 (start reading)

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Thanks!