Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Jedi's Guide to Migrating to Serverless

A Jedi's Guide to Migrating to Serverless

Aleksandar Simovic

April 12, 2018
Tweet

More Decks by Aleksandar Simovic

Other Decks in Technology

Transcript

  1. A Jedi’s Guide to
    Migrating to Serverless
    CloudConf 2018
    Aleksandar Simovic
    Torino, Italia

    View Slide

  2. What we’ll be covering
    • Stepping stones to serverless

    • Serverless monoliths

    • Rethinking application processes

    • The function-by-function approach

    “Divide and conquer”

    View Slide

  3. STAR WARS
    NERD ALERT
    If you have Star Wars phobia or mania, take care!

    View Slide

  4. Serverless means…
    • No longer need to manage or
    configure servers

    • Pay only for used time

    • Automatically scaled per usage

    • Auto-failover and automated
    high scalability

    View Slide

  5. Sounds great!

    View Slide

  6. How do we go serverless?

    View Slide

  7. “We’ll just build applications on
    serverless instead of cloud”
    Initially serverless seems like…

    View Slide

  8. Simply…
    Attribution: Simon Wardley

    View Slide

  9. Also known as “The Luke Skywalker approach”

    View Slide

  10. “We just don’t think about servers anymore.”
    “I have a light saber, I am a Jedi.”

    View Slide

  11. ANTI PATTERN ALERT
    Welcome to Serverless Monoliths!

    View Slide

  12. Serverless Monoliths = Dark Side
    • Hard to maintain
    and test

    • Slower starting time

    • Kept all drawbacks
    from your previous
    state

    • Higher cost

    View Slide

  13. Bundling many functionalities into a
    serverless function also means…
    every time you wanted to use your car, 

    you would have to assemble it first.

    View Slide

  14. “Now we just don’t think
    about servers anymore.”
    Serverless is much more than

    View Slide

  15. Migrating to serverless requires us to
    change how we think about
    application development
    …not just jump to serverless.

    View Slide

  16. So, how should we migrate?

    View Slide

  17. Learn from Luke’s mistakes

    View Slide

  18. Function-by-function approach
    “Divide and Conquer”
    1. Pick your already isolated services first

    “the low hanging fruit”

    View Slide

  19. Function-by-function approach
    “Divide and Conquer”
    2. Rethink and separate services into functions
    Hint: you don’t pay for your function storage, just usage.

    View Slide

  20. Function-by-function approach
    “Divide and Conquer”
    3. Divide your business processes into functions

    View Slide

  21. Case Study:
    • Can’t predict the popularity of their pens

    • Have lots of unexpected peaks

    • Being able to serve is the key business
    goal

    • Spending lots on provisioning servers

    • Keeping lots of servers idle
    Problems:

    View Slide

  22. Case Study:
    • Low hanging fruits 

    = preprocessors

    • Migrated all preprocessors into
    serverless functions

    • Separated their business process
    into functions

    • > 200,000 requests / h

    View Slide

  23. Case Study:
    • Converters were eating too much
    resources

    • Too expensive Heroku dynos

    • Less isolation, could collide over
    resources

    • Hard to experiment
    Problems:
    MINDMUP

    View Slide

  24. Case Study:
    • Low hanging fruits 

    = converters

    • Migrated all converters into functions

    • Separated business processes for payments,
    notifications, file storage

    • Half a million active users each month

    • Grew 30% in the migration period, 

    while reduced costs by 30%
    MINDMUP

    View Slide

  25. Key points to remember
    • Identify your isolated problems.

    • Apply the “function-by-function” approach.

    • Analyze the remaining monolith services.

    • Repeat the approach.

    View Slide

  26. “But can we use this approach
    everywhere?”

    View Slide

  27. No. 

    Look at your current situation.

    View Slide

  28. Case Study: Migrating User authentication

    View Slide

  29. Reuse existing serverless
    components
    • Plug-and-play authentication and authorization
    services: AWS Cognito, Azure Active Directory, etc.

    • Easily add other authentication providers.

    • User groups.

    • Automated permission and policy systems.

    View Slide

  30. Revised Steps
    • Identify isolated problems.

    • Check and replace these problems with existing
    serverless components.

    • Apply the “function-by-function” approach.

    • Analyze the remaining monolith services.

    • Repeat.

    View Slide

  31. Summary
    • Serverless is much bigger than just 

    “no longer managing servers”.

    • Don’t just rush going serverless. Rethink.

    • Remember your context. Reuse.

    • Pick the low hanging “fruits” (services) first.

    • “Divide and conquer” your business processes into
    functions.

    View Slide

  32. Learn more?
    Use code claudia40

    View Slide

  33. Thank you!
    Questions?
    @simalexan

    View Slide