Caching in AWS Lambda

Caching in AWS Lambda

You want to optimize your performance in your AWS Lambda functions and reduce infrastructure costs by avoiding expensive API calls? You should think about caching data in your function! In this talk, I'll show you three different options how to cache data in Lambda: simple caching, custom caching and managed caching.

023594dc361cab87c8e40d03ba0f3b18?s=128

sebastianhesse

December 06, 2018
Tweet

Transcript

  1. 1.
  2. 2.

    Available options to cache data in AWS Lambda and how

    to use them. CACHING IN AWS LAMBDA
  3. 3.
  4. 9.

    BETTER PERFORMANCE Avoid slow API calls or computations. REDUCE COSTS

    Avoid calls which cost you money, e.g. to your database. REASONS
  5. 11.

    LAMBDA SCALING GET Name for X GET Name for X

    GET Name for X GET Name for X DynamoDB
  6. 16.

    CUSTOM Setup a caching instance by your own. CACHING OPTIONS

    MANAGED Use a managed caching service. SIMPLE Cache data only inside Lambda functions.
  7. 18.

    LAMBDA EXECUTION PROCESS Response Time (ms) 0 250 500 750

    1000 # Number Of Request 1 2 3 4 5 6 7 8 9 10 Cold start
  8. 28.
  9. 29.
  10. 30.
  11. 31.
  12. 32.
  13. 34.

    AFTER No data synchronization between instances of your Lambda functions.

    BEFORE Low cost caching without performance overhead.
  14. 36.

    CUSTOM CACHING SETUP 1.) GET Name for X CACHE 2.)

    GET Name for X 3.) SET Name for X DynamoDB
  15. 37.

    "Whe; /4: la@;Ah B; EC2 in.9-nH6 Iit84:9 sJeA=fLM5g a .@On6),

    it's a@)QRat=HBSlL Sa@nHT6d i;94 B deV-:St .uOnX) M5 yo@[ <6fa@\9 V^_." https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html —
  16. 38.

    "By 3ea-:l), re.4:bce. I=t8M5 a V^_ -r6 ;o9 -cH6dsieSX f[QR

    wi)T=n B LahOd- V:5c)i45" https://docs.aws.amazon.com/lambda/latest/dg/vpc.html —
  17. 40.

    LAMBDA VPC STARTUP VPC Network Hardware Image: https://www.flaticon.com/free-icon/network-interface-card_969356 "A Serverless

    Journey: AWS Lambda Under the Hood" https://www.youtube.com/watch?v=QdzV04T_kec&t=2400
  18. 42.
  19. 45.

    MAINTENANCE AWS is regularly taking care of updates. ADVANTAGES COMPATIBILITY

    Redis and Memcached well supported caching solutions. GET STARTED Easy setup and ready to go.
  20. 47.
  21. 48.

    SEBASTIAN HESSE Software Engineer | www.k15t.com | @seeebiii CHARLIE IS

    MY HOMEBOY CHARLIE IS MY HOMEBOY K15t Software Example code @ GitHub: https://github.com/seeebiii/caching-in-aws-lambda
  22. 49.

    NEW MEETUP SERIES: K15T TEAM TALKS TOPIC: GIT TOGETHER More

    information: https://www.meetup.com/de-DE/K15tTeamTalks/events/256232999/