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 full-size 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 full-size slide

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

    View full-size 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 full-size slide

  5. Sounds great!

    View full-size slide

  6. How do we go serverless?

    View full-size slide

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

    View full-size slide

  8. Simply…
    Attribution: Simon Wardley

    View full-size slide

  9. Also known as “The Luke Skywalker approach”

    View full-size slide

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

    View full-size slide

  11. ANTI PATTERN ALERT
    Welcome to Serverless Monoliths!

    View full-size slide

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

    • Slower starting time

    • Kept all drawbacks
    from your previous
    state

    • Higher cost

    View full-size 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 full-size slide

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

    View full-size slide

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

    View full-size slide

  16. So, how should we migrate?

    View full-size slide

  17. Learn from Luke’s mistakes

    View full-size slide

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

    “the low hanging fruit”

    View full-size 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 full-size slide

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

    View full-size 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 full-size 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 full-size 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 full-size 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 full-size 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 full-size slide

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

    View full-size slide

  27. No. 

    Look at your current situation.

    View full-size slide

  28. Case Study: Migrating User authentication

    View full-size 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 full-size 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 full-size 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 full-size slide

  32. Learn more?
    Use code claudia40

    View full-size slide

  33. Thank you!
    Questions?
    @simalexan

    View full-size slide