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

Lambda @ Hooroo

Lambda @ Hooroo

The what, the why, the how, the challenges, and the learnings of AWS Lambda. A real world example of how it has gone from a 10% time project to production at Hooroo.

Jackie Camomot

July 27, 2017
Tweet

More Decks by Jackie Camomot

Other Decks in Technology

Transcript

  1. What is it? - A bit of code - Triggered

    by some something happening (an event) - Executed in the cloud (no dedicated server)
  2. What else is there? FaaS BaaS Serverless Cloud Functions PaaS

    Microservices Lambda Openwhisk Azure Functions Firebase Parse Google Functions FaunaDB Event Driven MBaaS
  3. Why should I use it? - You do not care

    about the servers. - You do not interact with the OS. - You do not think about capacity. - You do not think about scale. - There are very few dials to tweak. - Pay for fulfillment, not provisioning. - It is composable.
  4. How do I use it? - You provide your Node.js,

    Java, or Python code - Configure: - Event sources (what triggered me?) - Permissions (what things can I access?) - Handler function (what should I invoke when it happens?) - Memory (how much gusto should it have?)
  5. As Customer Support, I need a notification when a booking

    failed so that I can resolve the issue with the customer.
  6. We can’t use Splunk because - It needs to be

    real time - Complicated and resource consuming query - Dynamic data in the email content - Event logs are truncated - Splunk is difficult to test - Conditional complexity
  7. What about a service? - Bookings don’t fail often -

    Infrastructure would sit there idle - Increased setup time - Need to choose - Instance size - Auto scale groups - Auto scale conditions - AMI
  8. Amazon SES Bookings publishes an event Customer Support Booking Alerts

    in AWS Lambda λ Sends an email when event type is `booking_failed`
  9. - Offline development (on the plane over here) - Development

    environment (tail -f, hot code reload) - Frameworks (active development; things break) And more challenges ...
  10. Learnings & Protips - Write your function code as stateless,

    keep lambda at the boundary of your core code - Function code should do only one thing (be simple) - Execution time is limited to 5 mins - Cold starts (sometimes seconds)
  11. - Reacting to something (an event) - Infrequent events -

    Async - 100’s of milliseconds (i.e not High Frequency Trading - Max 5 minutes (i.e no Video Encoding) - Connecting things together (AWS Step functions, IFTTT) - Scale quickly (1000’s of headless tests - Chromeless) Niche