Title: Issue #47: Are Lambda Layers Making a Comeback? Publication: Ready, Set, Cloud! Series: Ready, Set, Cloud Picks of the Week Author: Allen Helton Published: February 20, 2023 URL: https://www.readysetcloud.io/newsletter/47/ There's always a debate on whether or not Lambda layers should be used in production. Some content this week weighs in on the argument. ### Serverless Superhero Our serverless superhero this week is [Eric Johnson](https://twitter.com/edjgeek), principal serverless DA at AWS. Eric is *the guy* when it comes to serverless, constantly doing web shows, speaking at conferences, answering questions on social media, doing customer calls, and probably a hundred more things. I have no idea how he does it. If you ever have a question about anything related to serverless, Eric probably knows the answer. Thank you Eric, for shaping the serverless community into what it is today! ### Tutorials In [issue #45](https://readysetcloud.io/newsletter/45) we had a great post from [Ran Isenberg](https://twitter.com/IsenbergRan) on time-based feature flag triggers. Well, he's back, but this time on the AWS blog to talk about [implementing feature flags with AWS AppConfig](https://aws.amazon.com/blogs/mt/how-cyberark-implements-feature-flags-with-aws-appconfig/) end-to-end. This post describes some of the business challenges that feature flags solve, how Ran writes, stores, and deploys them, and of course, goes into best practices around them. It's a great case study of how CyberArk uses them in production and is an inspiring read for those of us looking to get into them. I've heard of DuckDB gaining popularity in the serverless world but haven't had the chance to try it myself. But now thanks to [Tobias Müller](https://twitter.com/TobiM) it's easier than ever. In his post on [using DuckDB in AWS Lambda](https://tobilg.com/using-duckdb-in-aws-lambda), he talks about how he got around some difficulties using the package in Lambda and how he built a layer that anybody can use in a pinch. I see a lot of promise for this going forward as we push for dynamic analytic queries with fully serverless apps. Speaking of Lambda layers, Ran Isenberg posted *another* great article last week about [Lambda layer best practices](https://www.ranthebuilder.cloud/post/aws-lambda-layers-best-practices). He talks about the pros and cons of layers (which is typically a heated debate in the community) and gives us several best practices around security, deployment, and number of layers. As always, Ran gives us a working CDK example which is always a great boost to try it ourselves. ### Interesting Reads Global applications have some interesting challenges to overcome with one of them being edge optimization or getting your code closer to your users. [Daniele Frasca](https://twitter.com/dfrasca80) shared a post cleverly titled [Get Me There Faster](https://dev.to/aws-builders/get-me-there-faster-2gc1) where he describes how to use CloudFront and Global Accelerator to boost the performance of your app anywhere in the world. He describes when you would use Global Accelerator over CloudFront and shows a way you can use both of them together. I ([Allen Helton](https://twitter.com/allenheltondev)) recently gave a talk at the Serverless NYC and Boston meetup groups on [how I built an open source newsletter platform](https://readysetcloud.io/talks/building-an-open-source-newsletter-platform). I talk about the overall architecture, why I had to move away from my old solution, some cool new features I built as a result, and discuss my definition of serverless. ### New Releases DataDog just released an amazing new feature called [cold start tracing](https://www.datadoghq.com/blog/serverless-cold-start-traces/). As you could probably infer, this feature shows where the time is being spent bootstrapping your Lambda function. It provides a crystal clear window into what is making your cold start times slower. Momento released a [fourth new cacheable data type last week: sorted sets](https://www.gomomento.com/blog/were-back-with-another-collection-data-type-sorted-sets). This new data type will automatically sort elements by a `score`, opening up use cases like leaderboards and secondary indexing directly in a cache! You can now [connect Kinesis Data Streams to DynamoDB global tables in CloudFormation](https://aws.amazon.com/about-aws/whats-new/2023/02/amazon-kinesis-data-streams-dynamodb-aws-cloudformation-global-tables/). I believe this functionality was only doable through the console or API, so it's nice to have it available in IaC. [Baselime tracing](https://baselime.io/blog/understand-your-serverless-stack-with-baselime-tracing) was released last week, bringing distributed traces of your applications using OpenTelemetry or AWS X-Ray data to the forefront. This functionality will tie specific CloudWatch logs to individual traces, enabling you to get directly to the detail as fast as possible. ### Spotlight I love cool and practical use cases that get your mind turning with new ideas. That is exactly what [Lee Gilmore](https://twitter.com/LeeJamesGilmore) did last week with his post, [Serverless Amazon Location Service](https://blog.serverlessadvocate.com/serverless-amazon-location-service-19a6029f5c0). It takes us through how to build a restaurant app using the Amazon Location Service to calculate routes and estimate delivery time and distance for food orders. The example is well thought out and as always, nicely illustrated to keep you engaged the whole way through. If you want to take the code and run with it, Lee has the full source available on GitHub deployable with the CDK. ### Tip of the Week [AJ Stuyvenberg](https://twitter.com/astuyve) gave us a first look into the new release from DataDog dissecting Lambda function cold starts. He is rationalizing what we're seeing now that there's visibility into exactly what a cold start is doing. ### Last Words Catch me on the [Saas Factory live stream](https://www.linkedin.com/posts/bill-tarr-san-diego_building-saas-on-aws-write-your-own-serverless-activity-7030925160052334593-iRLw) this Wednesday, February 22, at 8am CST. I'll be talking with [Khawaja Shams](https://twitter.com/ksshams) and [Gunnar Grosch](https://twitter.com/GunnarGrosch) about how we built a serverless service at Momento and how that architecture is repeatable so you can build one yourself! If you'd like to make a recommendation for the serverless superhero or for an article you found especially useful, send me a message on [Twitter](https://twitter.com/allenheltondev), [LinkedIn](https://www.linkedin.com/in/allenheltondev/), or [email](mailto:allenheltondev@gmail.com). Happy Coding! Allen