Product Guy, Serverless Advocate & Startup Veteran

My name is Jeremy Daly. I appreciate the visit. 👍 I’ve been managing the development of complex web and mobile applications for businesses across the globe for over 20 years. I’m currently the Chief Technology Officer at AlertMe, but I always keep myself busy with several side projects and consulting clients. I’m also an AWS Serverless Hero.

I write a lot about serverless and I like to share thoughts and stories about programmingproduct managemententrepreneurship and productivity. Sometimes I’ll write reviews or have random thoughts that I need to get out of my head. I also like to post a how-to article every once in a while. Feel free to jump in to one of the categories above, view all my posts, or view my latest posts below.

If you want to keep up with what I’m working on, you can follow me on TwitterGithub and Facebook.

Also, if you’re interested in serverless, please subscribe to Off-by-none, a weekly newsletter that focuses on all things serverless, and be sure to listen to Serverless Chats, a weekly podcast that discusses all things serverless.


My Latest Posts:

Verifying self-signed JSON Web Tokens (JWTs) with AWS HTTP APIs

“Trust no one.” Or at least that’s what Fox Mulder told me back in the 90s.

With the recent GA of HTTP APIs for API Gateway, I decided to start evaluating my existing API Gateway REST APIs to see if I could migrate them over to take advantage of the decreased latency and reduced cost of the new HTTP APIs. Several of them were disqualified because they utilize service integrations (a feature that AWS is working to add), but for one of my largest applications, the lack of Custom Authorizers is what brought me to a dead end. Or so I initially thought. 😉

After a bit of research (okay, it was actually several hours because I decided to read through a bunch of specs and blog posts and then run a ton of experiments), it turns out that hosting your own OIDC Conformant “server” to verify self-signed JSON Web Tokens with HTTP APIs is actually quite simple. So as long as you can use JWT for your bearer tokens, you can utilize your existing authentication service (and probably dramatically reduce your latency and cost).

In this post, I’ll show you everything you need to know to set this up yourself. We’ll generate certificates, create our OIDC discovery service, set up our HTTP API authorizers, generate and sign our JWTs, and protect routes with scopes.

Continue Reading…

🚀 Project Update:

Lambda API: v0.10.5 Released

Lambda API v0.10.5 has been released to fix a few minor bugs around ALB query string decoding and TypeScript definitions. Plus a new feature that allows you to disable error logging. Read More...
🚀 Project Update:

Serverless MySQL: v1.5.3 released

This update includes a number of fixes from the community including exporting the escape function, standardizing quotations in a maintenance query, and adding a retry on PROTOCOL_CONNECTION_LOST errors to resolve the zombie cleanup race condition. Read More...
🚀 Project Update:

Serverless MySQL: v1.5.2 released

Added a retry for another error that is resetting connections (this should fix the issues in #57 and #62) as well as some minor documentation and dependency updates. Read More...
🚀 Project Update:

Data API Client: v1.0.1 Released

There was an issue with batch records via standard queries versus those wrapped in transactions. v1.0.1 includes a patch that checks the arguments and conditionally flattens the array for proper handling in each context. Read More...

Takeaways from AWS re:Invent 2019’s Amazon DynamoDB Deep Dive: Advanced Design Patterns (DAT403)

AWS re:Invent 2019 is a wrap, but now the real work begins! There are hundreds of session videos now available on YouTube. So when you have a few days (or weeks) of downtime, you can dig in to these amazing talks and learn about whatever AWS topics you fancy.

I was only able to attend a few talks this year, but one that I knew I couldn’t miss in person, was Rick Houlihan’s DAT403: Amazon DynamoDB deep dive: Advanced design patterns. At the last two re:Invents, he gave similar talks that explored how to use single-table designs in DynamoDB… and they blew my mind! 🤯 These videos were so mind-bending, that they inspired me to immerse myself in NoSQL design and write my How to switch from RDBMS to DynamoDB in 20 easy steps post. I was hoping to have a similar experience with this year’s edition, and I WAS NOT DISAPPOINTED.

As expected, it was a 60 minute firehose of #NoSQL knowledge bombs. There was A LOT to take away from this, so after the session, I wrote a Twitter thread that included some really interesting lessons that stuck out to me. The video has been posted, so definitely watch it (maybe like 10 times 🤷‍♂️), and use it to get started (or continue on) your DynamoDB journey.

Continue Reading…

🚀 Project Update:

Lambda API: v0.10.3 Released

Lambda API v0.10.3 has been released to fix a few minor bugs around route prefixing and base64Encoding (thanks @Sleavely and @btakita), and to add a whitelist for headers on error cases (@hussfelt). Read More...

The Dynamic Composer (an AWS serverless pattern)

I’m a big fan of following the Single Responsibility Principle when creating Lambda functions in my serverless applications. The idea of each function doing “one thing well” allows you to easily separate discrete pieces of business logic into reusable components. In addition, the Lambda concurrency model, along with the ability to add fine-grained IAM permissions per function, gives you a tremendous amount of control over the security, scalability, and cost of each part of your application.

However, there are several drawbacks with this approach that often attract criticism. These include things like increased complexity, higher likelihood of cold starts, separation of log files, and the inability to easily compose functions. I think there is merit to these criticisms, but I have personally found the benefits to far outweigh any of the negatives. A little bit of googling should help you find ways to mitigate many of these concerns, but I want to focus on the one that seems to trip most people up: function composition.

Continue Reading…

🚀 Project Update:

Lambda API: v0.10.2 Released

Lambda API v0.10.2 has been released to add additional TypeScript support (@maxmellen), fix an issue with multiValueHeaders containing a null value (@stawecki), and support for overriding console.log for logging output (@Sleavely). Read More...
🚀 Project Update:

Serverless MySQL: v1.5.0 released

Serverless MySQL v1.5.0 is a maintenance/security update that also adds a new feature to transaction handling allowing you to return null queries to simplify conditional transaction workflows. Read More...

How to switch from RDBMS to DynamoDB in 20 easy steps…

I posted a thread on Twitter with some thoughts on how to how to switch from RDBMS to DynamoDB. Some people have asked me to turn it into a blog post to make it easier to follow. So here it is… with some bonus steps at the end. Enjoy! 😁

Continue Reading…

🚀 Project Update:

Serverless MySQL: v1.4.0 Released

Thanks to contributions from the community, Serverless MySQL v1.4.0 adds the ability to bring your own MySQL and Promise libraries, an enhancement that lets you use multiple instances, and some more TypeScript updates. Read More...

Developing Serverless Applications Locally with the “serverless-cloudside-plugin”

Developing and testing serverless applications locally can be a challenge. Even with tools like SAM and the Serverless Framework, you often end up mocking your cloud resources, or resorting to tricks (like using pseudo-variables) to build ARNs and service endpoint URLs manually. While these workarounds may have the desired result, they also complicate our configuration files with (potentially brittle) user-constructed strings, which duplicates information already available to CloudFormation.

This is a common problem for me and other serverless developers I know. So I decided to come up with a solution.

Continue Reading…

🚀 Project Update:

Lambda API: v0.10.1 Released

Lambda API v0.10.1 has been released to fix an issue with the "statusCode" reporting incorrectly in error logs. The arity requirement for handler functions has also been relaxed since it's possible that they may not be needed within a route definition. Read More...

Throttling Third-Party API calls with AWS Lambda

In the serverless world, we often get the impression that our applications can scale without limits. With the right design (and enough money), this is theoretically possible. But in reality, many components of our serverless applications DO have limits. Whether these are physical limits, like network throughput or CPU capacity, or soft limits, like AWS Account Limits or third-party API quotas, our serverless applications still need to be able to handle periods of high load. And more importantly, our end users should experience minimal, if any, negative effects when we reach these thresholds.

There are many ways to add resiliency to our serverless applications, but this post is going to focus on dealing specifically with quotas in third-party APIs. We’ll look at how we can use a combination of SQS, CloudWatch Events, and Lambda functions to implement a precisely controlled throttling system. We’ll also discuss how you can implement (almost) guaranteed ordering, state management (for multi-tiered quotas), and how to plan for failure. Let’s get started!

Continue Reading…

How To: Use SNS and SQS to Distribute and Throttle Events

An extremely useful AWS serverless microservice pattern is to distribute an event to one or more SQS queues using SNS. This gives us the ability to use multiple SQS queues to “buffer” events so that we can throttle queue processing to alleviate pressure on downstream resources. For example, if we have an event that needs to write information to a relational database AND trigger another process that needs to call a third-party API, this pattern would be a great fit.

This is a variation of the Distributed Trigger Pattern, but in this example, the SNS topic AND the SQS queues are contained within a single microservice. It is certainly possible to subscribe other microservices to this SNS topic as well, but we’ll stick with intra-service subscriptions for now. The diagram below represents a high-level view of how we might trigger an SNS topic (API Gateway → Lambda → SNS), with SNS then distributing the message to the SQS queues. Let’s call it the Distributed Queue Pattern.

Distributed Queue Pattern

This post assumes you know the basics of setting up a serverless application, and will focus on just the SNS topic subscriptions, permissions, and implementation best practices. Let’s get started!

Continue Reading…

🚀 Project Update:

Lambda API: v0.10 Released

Lambda API v0.10 adds the ability for you to seamlessly switch your Lambdas between API Gateway and Application Load Balancers. New execution stacks enables method-based middleware and more wildcard functionality. Plus full support for multi-value headers and multi-value query string parameters. Read More...

Stop Calling Everything Serverless!

I’ve been building serverless applications since AWS Lambda went GA in early 2015. I’m not saying that makes me an expert on the subject, but as I’ve watched the ecosystem mature and the community expand, I have formed some opinions around what it means exactly to be “serverless.” I often see tweets or articles that talk about serverless in a way that’s, let’s say, incompatible with my interpretation. This sometimes makes my blood boil, because I believe that “serverless” isn’t a buzzword, and that it actually stands for something important.

I’m sure that many people believe that this is just a semantic argument, but I disagree. When we refer to something as being “serverless”, there should be an agreed upon understanding of not only what that means, but also what it empowers you to do. If we continue to let marketers hijack the term, then it will become a buzzword with absolutely no discernible meaning whatsoever. In this post, we’ll look at how some leaders in the serverless space have defined it, I’ll add some of my thoughts, and then offer my own definition at the end.

Continue Reading…

Serverless Tip: Don’t overpay when waiting on remote API calls

Our serverless applications become a lot more interesting when they interact with third-party APIs like Twilio, SendGrid, Twitter, MailChimp, Stripe, IBM Watson and others. Most of these APIs respond relatively quickly (within a few hundred milliseconds or so), allowing us to include them in the execution of synchronous workflows (like our own API calls).  Sometimes we run these calls asynchronously as background tasks completely disconnected from any type of front end user experience.

Regardless how they’re executed, the Lambda functions calling them need to stay running while they wait for a response. Unfortunately, Step Functions don’t have a way to create HTTP requests and wait for a response. And even if they did, you’d at least have to pay for the cost of the transition, which can get a bit expensive at scale. This may not seem like a big deal on the surface, but depending on your memory configuration, the cost can really start to add up.

In this post we’ll look at the impact of memory configuration on the performance of remote API calls, run a cost analysis, and explore ways to optimize our Lambda functions to minimize cost and execution time when dealing with third-party APIs.

Continue Reading…

re:Capping re:Invent: AWS goes all-in on Serverless

Last week I spent six incredibly exhausting days in Las Vegas at the AWS re:Invent conference. More than 50,000 developers, partners, customers, and cloud enthusiasts came together to experience this annual event that continues to grow year after year. This was my first time attending, and while I wasn’t quite sure what to expect, I left with not just the feeling that I got my money’s worth, but that AWS is doing everything in their power to help customers like me succeed.

There have already been some really good wrap-up posts about the event. Take a look at James Beswick’s What I learned from AWS re:Invent 2018, Paul Swail’s What new use cases do the re:Invent 2018 serverless announcements open up?, and All the Serverless announcements at re:Invent 2018 from the Serverless, Inc. blog. There’s a lot of good analysis in these posts, so rather than simply rehash everything, I figured I touch on a few of the announcements that I think really matter. We’ll get to that in a minute, but first I want to point out a few things about Amazon Web Services that I learned this past week.

Continue Reading…

Aurora Serverless Data API: An (updated) First Look

Update June 5, 2019: The Data API team has released another update that adds improvements to the JSON serialization of the responses. Any unused type fields will be removed, which makes the response size 80+% smaller.

Update June 4, 2019: After playing around with the updated Data API, I found myself writing a few wrappers to handle parameter formation, transaction management, and response formatting. I ended up writing a full-blown client library for it. I call it the “Data API Client“, and it’s available now on GitHub and NPM.

Update May 31, 2019: AWS has released an updated version of the Data API (see here). There have been a number of improvements (especially to the speed, security, and transaction handling). I’ve updated this post to reflect the new changes/improvements.

On Tuesday, November 20, 2018, AWS announced the release of the new Aurora Serverless Data API. This has been a long awaited feature and has been at the top of many a person’s #awswishlist. As you can imagine, there was quite a bit of fanfare over this on Twitter.

Obviously, I too was excited. The prospect of not needing to use VPCs with Lambda functions to access an RDS database is pretty compelling. Think about all those cold start savings. Plus, connection management with serverless and RDBMS has been quite tricky. I even wrote an NPM package to help deal with the max_connections issue and the inevitable zombies 🧟‍♂️ roaming around your RDS cluster. So AWS’s RDS via HTTP seems like the perfect solution, right? Well, not so fast. 😞 (Update May 31, 2019: There have been a ton of improvements, so read the full post.)

Continue Reading…

🚀 Project Update:

Lambda API: v0.9.2 Released

Lambda API v0.9.2 has been released and contains additional updates and fixes for the index.d.ts TypeScript declarations file. Thanks again to @hassankhan and @Wintereise for submitting the changes. The release is immediately available via NPM. Read More...
🚀 Project Update:

Lambda API: v0.9.1 Released

Lambda API v0.9.1 has been released to include the index.d.ts TypeScript declarations file in the NPM package (thanks again, @hassankhan). The release is immediately available via NPM. Read More...
🚀 Project Update:

Lambda API: v0.9 Released

v0.9 adds new features to give developers better control over error handling and serialization. A TypeScript declaration file has also been added along with some additional API Gateway inputs that are now available in the REQUEST object. Read More...

Takeaways from ServerlessNYC 2018

I had the opportunity to attend ServerlessNYC this week (a ServerlessDays community conference) and had an absolutely amazing time. The conference was really well-organized (thanks Iguazio), the speakers were great, and I was able to have some very interesting (and enlightening) conversations with many attendees and presenters. In this post I’ve summarized some of the key takeaways from the event as well as provided some of my own thoughts.

Note: There were several talks that were focused on a specific product or service. While I found these talks to be very interesting, I didn’t include them in this post. I tried to cover the topics and lessons that can be applied to serverless in general.

Update November 16, 2018: Some videos have been posted, so I’ve provided the links to them.

Audio Version:

Continue Reading…

What 15 Minute Lambda Functions Tells Us About the Future of Serverless

Amazon Web Services recently announced that they increased the maximum execution time of Lambda functions from 5 to 15 minutes. In addition to this, they also introduced the new “Applications” menu in the Lambda Console, a tool that aggregates functions, resources, event sources and metrics based on services defined by SAM or CloudFormation templates. With AWS re:Invent just around the corner, I’m sure these announcements are just the tip of the iceberg with regards to AWS’s plans for Lambda and its suite of complementary managed services.

While these may seem like incremental improvements to the casual observer, they actually give us an interesting glimpse into the future of serverless computing. Cloud providers, especially AWS, continue to push the limits of what serverless can and should be. In this post, we’ll discuss why these two announcements represent significant progress into serverless becoming the dominant force in cloud computing.

Continue Reading…

🚀 Project Update:

Lambda API: v0.8.1 Released

Lambda API v0.8.1 has been released to patch an issue with middleware responses and a path prefixing options bug. The release is immediately available via NPM. Read More...

An Introduction to Serverless Microservices

Thinking about microservices, especially their communication patterns, can be a bit of a mind-bending experience for developers. The idea of splitting an application into several (if not hundreds of) independent services, can leave even the most experienced developer scratching their head and questioning their choices. Add serverless event-driven architecture into the mix, eliminating the idea of state between invocations, and introducing a new per function concurrency model that supports near limitless scaling, it’s not surprising that many developers find this confusing. 😕 But it doesn’t have to be. 😀

In this post, we’ll outline a few principles of microservices and then discuss how we might implement them using serverless. If you are familiar with microservices and how they communicate, this post should highlight how these patterns are adapted to fit a serverless model. If you’re new to microservices, hopefully you’ll get enough of the basics to start you on your serverless microservices journey. We’ll also touch on the idea of orchestration versus choreography and when one might be a better choice than the other with serverless architectures. I hope you’ll walk away from this realizing both the power of the serverless microservices approach and that the basic fundamentals are actually quite simple.  👊

Audio Version:

Continue Reading…

🚀 Project Update:

Serverless MySQL: v1.1.0 Released

Serverless MySQL v1.1.0 adds additional transaction support capabilities to allow users to retrieve interim query results for use with future queries. This is useful for getting the insertId from previous queries when performing transactions. Read More...

Serverless Security: Locking Down Your Apps with FunctionShield

I’ve written quite extensively about serverless security, and while you don’t need to be an expert on the matter, there are a number of common sense principles that every developer should know. Serverless infrastructures (specifically FaaS and managed services) certainly benefit from an increased security posture given that the cloud provider is handling things like software patching, network security, and to some extent, even DDoS mitigation. But at the end of the day, your application is only as secure as its weakest link, and with serverless, that pretty much always comes down to application layer security.

In this post we’re going to look at ways to mitigate some of these application layer security issues by using some simple strategies as well as a free tool called FunctionShield.

Audio Version:

Continue Reading…

Managing MySQL at Serverless Scale

“What? You can’t use MySQL with serverless functions, you’ll just exhaust all the connections as soon as it starts to scale! And what about zombie connections? Lambda doesn’t clean those up for you, meaning you’ll potentially have hundreds of sleeping threads blocking new connections and throwing errors. It can’t be done!”  ~ Naysayer

I really like DynamoDB and BigTable (even Cosmos DB is pretty cool), and for most of my serverless applications, they would be my first choice as a datastore. But I still have a love for relational databases, especially MySQL. It had always been my goto choice, perfect for building normalized data structures, enforcing declarative constants, providing referential integrity, and enabling ACID-compliant transactions. Plus the elegance of SQL (structured query language) makes organizing, retrieving and updating your data drop dead simple.

But now we have SERVERLESS. And Serverless functions (like AWS Lambda, Google Cloud Functions, and Azure Functions) scale almost infinitely by creating separate instances for each concurrent user. This is a MAJOR PROBLEM for RDBS solutions like MySQL, because available connections can be quickly maxed out by concurrent functions competing for access. Reusing database connections doesn’t help, and even the release of Aurora Serverless doesn’t solve the max_connections problem. Sure there are some tricks we can use to mitigate the problem, but ultimately, using MySQL with serverless is a massive headache.

Well, maybe not anymore. 😀 I’ve been dealing with MySQL scaling issues and serverless functions for years now, and I’ve finally incorporated all of my learning into a simple, easy to use NPM module that (I hope) will solve your Serverless MySQL problems.

Continue Reading…

Jeremy goes to AWS re:Invent 2018

It’s official! I’m going to AWS re:Invent 2018. 🙌

My goal from this trip is to learn, learn, learn… and then share, share, share.   There are over 30 sessions that talk about serverless, plus 40,000 other people there to meet and learn from! I’m so excited. 🙃

I know that many of you will be there, but for those of you who can’t be, I’ll do my best to share insights, tips, how-tos, best practices and more. I’ll even have a drink for you if you’d like 🍺 (no arm twisting necessary)!

Continue Reading…

Serverless Microservice Patterns for AWS

I’m a huge fan of building microservices with serverless systems. Serverless gives us the power to focus on just the code and our data without worrying about the maintenance and configuration of the underlying compute resources. Cloud providers (like AWS), also give us a huge number of managed services that we can stitch together to create incredibly powerful, and massively scalable serverless microservices.

I’ve read a lot of posts that mention serverless microservices, but they often don’t go into much detail. I feel like that can leave people confused and make it harder for them to implement their own solutions. Since I work with serverless microservices all the time, I figured I’d compile a list of design patterns and how to implement them in AWS. I came up with 19 of them, though I’m sure there are plenty more.

In this post we’ll look at all 19 in detail so that you can use them as templates to start designing your own serverless microservices.

Audio Version:

Continue Reading…

🚀 Project Update:

Lambda API: v0.8 Released

Lambda v0.8 is finally here and was well worth the wait! New features include allowing middleware to accept multiple handlers, new convenience methods for cache control and signing S3 URLs, and async/await support for the main function handler. And best of all, new LOGGING and SAMPLING support for you to add more observability into your APIs and web applications. Read More...

Aurora Serverless: The Good, the Bad and the Scalable

Amazon announced the General Availability of Aurora Serverless on August 9, 2018. I have been playing around with the preview of Aurora Serverless for a few months, and I must say that overall, I’m very impressed. There are A LOT of limitations with this first release, but I believe that Amazon will do what Amazon does best, and keep iterating until this thing is rock solid.

The announcement gives a great overview and the official User Guide is chock full of interesting and useful information, so I definitely suggest giving those a read. In this post, I want to dive a little bit deeper and discuss the pros and cons of Aurora Serverless. I also want to dig into some of the technical details, pricing comparisons, and look more closely at the limitations.

Audio Version

Continue Reading…

A Tale of Two Teams

Audio Version:

It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness… ~ A Tale of Two Cities by Charles Dickens

There is a revolution happening in the tech world. An emerging paradigm that’s letting development teams focus on business value instead of technical orchestration. It is helping teams create and iterate faster, without worrying about the limits or configurations of an underlying infrastructure. It is enabling the emergence of new tools and services that foster greater developer freedom. Freedom to experiment. Freedom to do more with less. Freedom to immediately create value by publishing their work without the traditional barriers created by operational limits.

Continue Reading…

How To: Add Test Coverage to your Serverless Applications

Writing serverless functions brings developers closer and closer to the stack that runs their code. While this gives them a tremendous amount of freedom, it also adds additional responsibility. Serverless applications require developers to think more about security and optimizations, as well as perform other tasks that were traditionally assigned to operations teams. And of course, code quality and proper testing continue to be at the top of the list for production-level applications. In this post, we’ll look at how to add test coverage to our Node.js applications and how we can apply it to our Serverless framework projects. ⚡️

Continue Reading…

Serverless Peeps You Need To Follow

In my never ending quest to consume all things serverless, I often find myself scouring the Interwebs for new and interesting serverless articles, blog posts, videos, and podcasts. There are more and more people doing fascinating things with serverless every day, so finding content is becoming easier and easier. However, this increase in content comes with an increase in noise as well. Cutting through that noise isn’t always easy. 🙉

Great content with valuable insights

I personally love reading articles that introduce new use cases or optimizations for serverless. Stories about companies using serverless in production and how their architectures are set up are also extremely interesting. I’ve been working in the serverless space for several years now, and have come across a number of people who produce and/or share really great content. I’ve put together a list of people that I follow and enjoy their content regularly. Hopefully these people will help you learn to love serverless as much as I do. ❤️⚡️

Continue Reading…

How To: Tag Your Lambda Functions for Smarter Serverless Applications

As our serverless applications start to grow in complexity and scope, we often find ourselves publishing dozens if not hundreds of functions to handle our expanding workloads. It’s no secret that serverless development workflows have been a challenge for a lot of organizations. Some best practices are starting to emerge, but many development teams are simply mixing their existing workflows with frameworks like Serverless and AWS SAM to build, test and deploy their serverless applications.

Beyond workflows, another challenge serverless developers encounter as their applications expand, is simply trying to keep all of their functions organized. You may have several functions and resources as part of a microservice contained in their own git repo. Or you might simply put all your functions in a single repository for better common library sharing. Regardless of how code is organized locally, much of that is lost when all your functions end up in a big long list in the AWS Lambda console. In this post we’ll look at how we can use AWS’s resource tagging as a way to apply structure to our deployed functions. This not only give us more insight into our applications, but can be used to apply Cost-Allocation Tags to our billing reports as well. 👍

Continue Reading…

Thinking Serverless (Big and Small)

I’ve been reading and writing a lot of about serverless lately, and one of the things I realized, is that most articles talk about how SCALABLE serverless architectures are. This, of course, is one of the major benefits of using serverless to build your applications. The ability to scale to thousands of concurrent requests per second without needing to manage your own servers, is simply amazing. 🙌

However, not needing to manage any servers has other benefits beyond the capabilities to achieve web scale. Having on-demand compute space also make serverless the perfect candidate for smaller workloads. In this post, let’s discuss how we can utilize serverless to handle our “less than unicorn 🦄” services and the benefits this can bring.

Continue Reading…

Lambda Warmer: Optimize AWS Lambda Function Cold Starts

At a recent AWS Startup Day event in Boston, MA, Chris Munns, the Senior Developer Advocate for Serverless at AWS, discussed Lambda cold starts and how to mitigate them. According to Chris (although he acknowledge that it is a “hack”) using the CloudWatch Events “ping” method is really the only way to do it right now. He gave a number of really good tips to pre-warm your functions “correctly”:

  • Don’t ping more often than every 5 minutes
  • Invoke the function directly (i.e. don’t use API Gateway to invoke it)
  • Pass in a test payload that can be identified as such
  • Create handler logic that replies accordingly without running the whole function

Continue Reading…

15 Key Takeaways from the Serverless Talk at AWS Startup Day

I love learning about the capabilities of AWS Lambda functions, and typically consume any article or piece of documentation I come across on the subject. When I heard that Chris Munns, Senior Developer Advocate for Serverless at AWS, was going to be speaking at AWS Startup Day in Boston, I was excited. I was able to attend his talk, The Best Practices and Hard Lessons Learned of Serverless Applications, and it was well worth it.

Chris said during his talk that all of the information he presented is on the AWS Serverless site. However, there is A LOT of information out there, so it was nice to have him consolidate it down for us into a 45 minute talk. There was some really insightful information shared and lots of great questions. I was aware of many of the topics discussed, but there were several clarifications and explanations (especially around the inner workings of Lambda) that were really helpful. 👍

Continue Reading…

Mixing VPC and Non-VPC Lambda Functions for Higher Performing Microservices

I came across a post the in the Serverless forums that asked how to disable the VPC for a single function within a Serverless project. This got me thinking about how other people structure their serverless microservices, so I wanted to throw out some ideas. I often mix my Lambda functions between VPC and non-VPC depending on their use and data requirements. In this post, I’ll outline some ways you can structure your Lambda microservices to isolate services, make execution faster, and maybe even save you some money. ⚡️💰

Continue Reading…

5 Reasons Why Your Serverless Application Might Be A Security Risk

There has been a lot of buzz lately about serverless security. People are certainly talking about it more and sharing great articles on the topic, but many serverless developers (especially new ones) are still making the same critical mistakes. Every time a serverless function is deployed, its unique security challenges need to be addressed. Every time. I’ve researched and written extensively about serverless security (see Securing Serverless: A Newbie’s Guide). I’ve read countless articles on the subject. And while there is no shortage of information available, let’s be honest: developers are busy building applications, not pouring through hundreds of articles.

I know, it sounds boring, but I would encourage you to do your research on serverless security. Serverless applications are different than traditional, server-hosted applications. Much of the security responsibility falls on the developer, and not following best practices opens you (or your company) up to an attack. But I know you’re busy. I totally get it. So rather than forcing you to read a bunch of long articles 😴 or watch a plethora of videos 🙈, I’ve whittled it all down to the five biggest serverless security risks for you. Sure, there are a lot of other things to consider, but IMO, these are the most important ones. Nothing here hasn’t been said before. But If you do nothing more than follow these principles, your serverless applications will be much more secure. 🔒

Continue Reading…

Serverless Consumers with Lambda and SQS Triggers

Update November 19, 2019: AWS announced support for SQS FIFO queues as a Lambda event source (announcement here). FIFO queues guarantee message order, which means only one Lambda function is invoked per MessageGroupId.

On Wednesday, June 27, 2018, Amazon Web Services released SQS triggers for Lambda functions. Those of you who have been building serverless applications with AWS Lambda probably know how big of a deal this is. Until now, the AWS Simple Queue Service (SQS) was generally a pain to deal with for serverless applications. Communicating with SQS is simple and straightforward, but there was no way to automatically consume messages without implementing a series of hacks. In general, these hacks “worked” and were fairly manageable. However, as your services became more complex, dealing with concurrency and managing fan out made your applications brittle and error prone. SQS triggers solve all of these problems. 👊

Update December 6, 2018: At some point over the last few months AWS fixed the issue with the concurrency limits and the redrive policy. See Additional experiments with concurrency and redrive polices below.

Audio Version (please note that this audio version is out of date given the new updates)

Continue Reading…

Event Injection: Protecting your Serverless Applications

Updated January 25, 2019: This post was updated based on feedback from the community.

The shared security model of cloud providers extends much further with serverless offerings, but application security is still the developer’s responsibility. Many traditional web applications are front-ended with WAFs (web application firewalls), RASPs (runtime application self-protection), EPPs (endpoint protection platforms) and WSGs (web security gateways) that inspect incoming and outgoing traffic. These extra layers of protection can save developers from themselves when making common programming mistakes that would otherwise leave their applications vulnerable. If you’re invoking serverless functions from sources other than API Gateway, you no longer have the ability to use the protection of a WAF. 

Continue Reading…

10 Things You Need To Know When Building Serverless Applications

I am a HUGE fan of serverless architectures. This new type of compute not only opens up more possibilities for developers, but can support highly-scalable, complex applications for a fraction of the cost compared to provisioning virtual servers. My first question when planning a new application is always, “Can I build this with serverless?” Spoiler alert, the answer is almost always YES!

I’ve been building serverless applications since the release of AWS Lambda in 2015, so answering the question above is pretty easy for me. However, a lot of people I talk to who are new to serverless often have many questions (and misconceptions). I want you to be successful, so below I’ve create a list of 10 things you need to know when building a serverless application. These are things I wish I knew when I started, so hopefully they’ll help you get up to speed a faster and start building some amazing applications.

Continue Reading…

🚀 Project Update:

Lambda API: v0.7 Released

v0.7 adds new features to control middleware execution based on path, plus additional parsing of the AWS Lambda context object. ESLint and coverage reports using Istanbul and Coveralls were also added to ensure code quality and adequate test coverage. Read More...

How To: Optimize the Serverless Optimizer Plugin

I’m sure you’re already well aware of how awesome the ⚡ Serverless Framework is for managing and deploying your serverless applications. And you’re probably aware that there are several great plugins available that make Serverless even better. But did you know that there was a plugin to optimize your functions and reduce the size of your deployment packages? Or are you already using this plugin to optimize your functions, but hate how it takes too long to optimize locally run functions? In this post I’ll share some quick tips to help you optimize your Serverless Optimizer experience.

Continue Reading…

Transducers: Supercharge your functional JavaScript

This is the first in a series of posts on functional programming in JavaScript. My goal is to make these ideas more accessible to all levels of programmers. Feedback about style, content, etc., would all be greatly appreciated.

One thing that perplexed me early on in my functional programming days was the concept of transducers. I spent a lot of time Googling and found some great articles that went deep into the theory and the underlying mechanics. However, the practical use of them still seemed a bit out of reach. In this post I’ll attempt to explain transducers in a more understandable way and hopefully give you the confidence to use them in your functional JavaScript. While this article attempts to make transducers more accessible, you will need to have some basic knowledge of functional programming in JavaScript. Specifically, you should know about function composition and iterator functions like .map(), .filter(), and most importantly, .reduce(). If you are unfamiliar with these concepts, go get a grasp on them first.

Continue Reading…

🚀 Project Update:

Lambda API: v0.6 Released

v0.6 is all about making the serverless developer's life easier! New support for both callback-style and async-await in route functions and middleware, new HTTP method routing features, and route debugging tools. Plus Etag support and automatic authorization parsing. Read More...

Solving the Cold Start Problem

Dear AWS Lambda Team,

I have a serious problem: I love AWS Lambda! In fact, I love it so much that I’ve pretty much gone all in on this whole #serverless thing. I use Lambda for almost everything now. I use it to build backend data processing pipelines, distribute long running tasks, and respond to API requests. Heck, I even built an Alexa app just for fun. I found myself building so many RESTful APIs using Lambda and API Gateway that I went ahead and created the open source Lambda API web framework to allow users to more efficiently route and respond to API Gateway requests.

Serverless technologies, like Lambda, have revolutionized how developers think about building applications. Abstracting away the underlying compute layer and replacing it with on-demand, near-infinitely scalable function containers is brilliant. As we would say out here in Boston, “you guys are wicked smaht.” But I think you missed something very important. In your efforts to conform to the “pay only for the compute time you consume” promise of serverless, you inadvertently handicapped the service. My biggest complaint, and the number one objection that I hear from most of the “serverless-is-not-ready-for-primetime” naysayers, are Cold Starts.

Continue Reading…

How To: Manage Serverless Environment Variables Per Stage

I often find myself creating four separate stages for each ⚡ Serverless Framework project I work on: dev, staging, prod, and local. Obviously the first three are meant to be deployed to the cloud, but the last one, local, is meant to run and test interactions with local resources. It’s also great to have an offline version (like when you’re on a plane ✈ or have terrible wifi somewhere). Plus, development is much faster because you’re not waiting for round trips to the server. 😉

A really great feature of Serverless is the ability to configure ENVIRONMENT variables in the serverless.yml file. This lets us store important global information like database names, service endpoints and more. We can even reference passwords securely using AWS’s Service Manager Parameter Store and decode encrypted secrets on deployment, keeping them safe from developers and source repositories alike. 😬 Just reference the variable with ${ssm:/myapp/my-secure-value~true} in your configuration file.

Continue Reading…

🚀 Project Update:

Lambda API: v0.5 Released

v0.5 takes advantage of AWS Lambda's recently released support for Node v8.10 and has removed its Bluebird promise dependency in favor of async/await. Lambda API is now faster and adds built-in CORS support, additional wildcard features, new HTTP header management methods and more. Read More...

How To: Stub “.promise()” in AWS-SDK Node.js

Since AWS released support for Node v8.10 in Lambda, I was able to refactor Lambda API to use async/await instead of Bluebird promises. The code is not only much cleaner now, but I was able to remove a lot of unnecessary overhead as well. As part of the refactoring, I decided to use AWS-SDK’s native promise implementation by appending .promise() to the end of an S3 getObject call. This works perfectly in production and the code is super compact and simple:

The issue came with stubbing the call using Sinon.js. With the old promise method, I was using promisifyAll() to wrap new AWS.S3() and then stubbing the getObjectAsync method. If you’re not familiar with stubbing AWS services, read my post: How To: Stub AWS Services in Lambda Functions using Serverless, Sinon.JS and Promises.

Continue Reading…

How To: Manage RDS Connections from AWS Lambda Serverless Functions

Someone asked a great question on my How To: Reuse Database Connections in AWS Lambda post about how to end the unused connections left over by expired Lambda functions:

I’m playing around with AWS lambda and connections to an RDS database and am finding that for the containers that are not reused the connection remains. I found before that sometimes the connections would just die eventually. I was wondering, is there some way to manage and/or end the connections without needing to wait for them to end on their own? The main issue I’m worried about is that these unused connections would remain for an excessive amount of time and prevent new connections that will actually be used from being made due to the limit on the number of connections.

🧟‍♂️ Zombie RDS connections leftover on container expiration can become a problem when you start to reach a high number of concurrent Lambda executions. My guess is that this is why AWS is launching Aurora Serverless, to deal with relational databases at scale. At the time of this writing it is still in preview mode.

Update September 2, 2018: I wrote an NPM module that manages MySQL connections for you in serverless environments. Check it out here.

Update August 9, 2018: Aurora Serverless is now Generally Available!

Overall, I’ve found that Lambda is pretty good about closing database connections when the container expires, but even if it does it reliably, it still doesn’t solve the MAX CONNECTIONS problem. Here are several strategies that I’ve used to deal with this issue.

Continue Reading…

Is Code Really Self-Documenting?

In my 20+ years of programming, I’ve encountered a near endless amount of opinions on everything from coding styles to programming paradigms to the great whitespace debate. Obviously, I have strong opinions on a number of these. But for me, the one that bothers me the most is this notion that “code is self-documenting.” 😾

I know what you’re probably thinking: “of course not all code is self-documenting, only well-written code is.” I don’t entirely disagree. I can generally look at someone else’s code and understand exactly WHAT it is doing. However, often it’s not obvious WHY they did it that way, or even why they did it in the first place. In my opinion, the programmer’s intent (the WHY) is just as important as the HOW when it comes to properly documenting software.

So whether you agree with me or not, let’s explore how to better document our software by writing cleaner code, following some general commenting etiquette, and commenting more effectively to make you and your team more productive. 👍

Continue Reading…

Securing Serverless: A Newbie’s Guide

So you’ve decided to build a serverless application. That’s awesome! May I be the first to welcome you to the future. 🤖 I bet you’ve done a lot of research. You’ve probably even deployed a few test functions to AWS Lambda or Google Cloud Functions and you’re ready to actually build something useful. You probably still have a bunch of unanswered questions, and that’s cool. We can still build some really great applications even if we only know the basics. However, when we start working with new things we typically make a bunch of dumb mistakes. While some are relatively innocuous, security mistakes can cause some serious damage.

I’ve been working with serverless applications since AWS launched Lambda in early 2015. Over the last few years I’ve developed many serverless applications covering a wide range of use cases. The most important thing I’ve learned: SECURE YOUR FUNCTIONS! I can tell you from personal experience, getting burned by an attack is no bueno. I’d hate to see it happen to you. 😢

To make sure it doesn’t happen to you, I’ve put together a list of 🔒Serverless Security Best Practices. This is not a comprehensive list, but it covers the things you ABSOLUTELY must do. I also give you some more things to think about as you continue on your serverless journey. 🚀

Continue Reading…

How To: Build a Serverless API with Serverless, AWS Lambda and Lambda API

AWS Lambda and AWS API Gateway have made creating serverless APIs extremely easy. Developers can simply create Lambda functions, configure an API Gateway, and start responding to RESTful endpoint calls. While this all seems pretty straightforward on the surface, there are plenty of pitfalls that can make working with these services frustrating.

There are, for example, lots of confusing and conflicting configurations in API Gateway.  Managing deployments and resources can be tricky, especially when publishing to multiple stages (e.g. dev, staging, prod, etc.). Even structuring your application code and dependencies can be difficult to wrap your head around when working with multiple functions.

In this post I’m going to show you how to setup and deploy a serverless API using the Serverless framework and Lambda API, a lightweight web framework for your serverless applications using AWS Lambda and API Gateway. We’ll create some sample routes, handle CORS, and discuss managing authentication. Let’s get started.

Continue Reading…

Off-by-none: Issue #82

Too early to think about re:Invent? 🤔

Welcome to Issue #82 of Off-by-none. Thanks for being here!

Last week, HTTP APIs from AWS went GA and NPM got acquired. This week, we’ve got new virtual conferences, re:Invent 2020 wishlists, and several serverless podcasts to fill your ears. Plus we’ve got a ton of great posts from the serverless community.

This is your LAST CHANCE to take the Serverless Community Survey! We’ve had a few hundred completions, but we need your input too. It doesn’t matter your level of serverless usage, the more data we have, the better. It takes LESS THAN 15 MINUTES to complete. 🙏

Serverless News & Announcements 📣

End-to-End Observability for Serverless
Instantly monitor and troubleshoot Lambda functions to get the full picture of what they’re doing and why they fail. Agentless and automated, Epsagon delivers full visibility for containers, VMs, FaaS, and more with no training, manual coding, tagging or maintenance required. Try free today! Sponsored

ServerlessDays Virtual – Call for Papers
What do you do when your local ServerlessDays event has been canceled? Go virtual! The new ServerlessDays Virtual conference is now accepting talk submissions. The first virtual conference is scheduled for April 29, 2020. More details to follow!

Azure Functions custom handlers are now in preview
Azure has some more serverless innovation to share. Custom handlers let you implement a functions app in a language beyond the officially supported languages or runtimes. Plus you can have more granular control over the app execution environment.

Serverless Stories 📖

How I Built a Machine Learning Pipeline on AWS for Under $7 a Day
Adam Tankanow worked with his team at CloudZero to split up their ML workloads, put them on Lambda, and get the cost down to $2.15 per day. This is a great example of how a little experimentation (and rethinking how you build your systems) can result in some amazing serverless applications.

How to go bankrupt trying the new cheap AWS HTTP API service
Dennis Butovetsky apparently found out the hard way that detailed metrics on the AWS HTTP API service can quickly rack up some massive CloudWatch Metrics charges. It seems strange that url parameters would be considered unique routes, so perhaps there is something he’s missing?

How I handle time-based events in serverless architecture
We’ve covered this topic many times, but it’s certainly worth repeating over and over again because it is such a powerful pattern. Richard Fan compares four ways to schedule events, and like most, comes to the conclusion that CloudWatch scheduled events plus SQS message delays work the best.

Serverless Use Cases 🗺

5 Minutes to Create an AWS Lambda Function to Stay Updated About COVID-19 in Your Area
This is a great use case that shows how serverless can be used as an extension to existing services. You could use this to monitor a SaaS service’s status page, or check for new updates on an RSS feed, or yes, even use it to get up-to-date info on COVID-19.

How to automatically create CloudWatch alerts with CloudTrail, Lambda, and Serverless
Here’s another great use case, using serverless to alert your team whenever a new Lambda function is added to your AWS account. Antonio Terreno shows you how his team set us this simple way of detecting new functions that your CI/CD system or non-instrumented functions would miss.

Serverless Framework To Test AWS Microservices
This is an interesting use case from Puneet Punj, using serverless to run automated tests runners, upload the reports to S3, and use SNS to notify you of errors.

Slack Messaging from AWS Serverless
Slackbots and serverless are like peanut butter and jelly. Krishnan Viswanath provides some simple scaffolding for building a Java-backed Slackbot using API Gateway and Lambda deployed with SAM. There are plenty of optimizations to be added, but the use case is solid.

Serverless Concepts 🏗

Supercharge Development, Delivery and Management of Serverless Applications
Stackery empowers enterprise development teams to deliver Well-Architected serverless applications quickly, securely, and at scale— without the overhead of complex infrastructure and operations management. Accelerate overall development and secure delivery of serverless applications by up to 60x – so your team can focus on perfecting core business logic. Sponsored

A comprehensive analysis of AWS Lambda function: optimize spikes and prevent cold starts
Excellent post that discusses how Lambda Provisioned Concurrency works, how it relates to Reserved Concurrency and auto scaling groups, and even a code snippet to help you schedule Provisioned Concurrency when you expect spikes in your workloads.

Moving Messages in AWS: Super-Fast Lambdas Use Batches
Good advice from Greg Farrow in here about using the available batching options provided by various AWS services when making calls from Lambda functions. If you need proof that it’s much faster, check out the tests he ran.

AWS HTTP APIs is GA. Here are my favorite features!
We talked a lot about HTTP APIs last week, but George Mao outlines a few of his favorite features. Improved CORS, JWT authorizes, and auto-deploy are all 💯!

EventBridge: The key component in Serverless Architectures
Ben Ellerby gives you the lowdown on EventBridge and why it’s such an important tool for building event-driven architectures in serverless.

Using middleware for cross-cutting concerns in your Lambda functions
Someday (hopefully in the very near future) much of the boilerplate code we need to add to our Lambda functions will go away. Until then, using middleware (like Middy) to help you standardize some of those processes can help you keep your sanity. Paul Swail explains how.

Serverless Tutorials 👷‍♀️

Configuring Serverless Framework for multiple stages
Brett Andrews shows you a simple way to use custom variables in your serverless.yml to change values based on the current stage.

How to Deploy a Local Serverless Application With AWS SAM
Lorenz Vanthillo has a great tutorial that will get you up and running (locally) with the Serverless Application Model, and then show you how to move your work to the cloud.

How to: optimize Lambda memory size during CI/CD pipeline
Yan Cui has added Alex Casalboni’s aws-lambda-power-tuning to the lumigo-cli tool. Now you can easily tune your functions for the optimal memory setting, even as part of your CI/CD pipeline. Lots of considerations when doing this, but this makes it simple.

Building a simple streaming app with Azure Cosmos DB, Event Hubs and Azure Functions
Will Velida walks you though building an event-driven app using serverless tools on Azure. It doesn’t matter what cloud you’re using, embracing and learning distributed system techniques is critical to building modern serverless applications.

Defeating malicious code injection with IAM conditions
Rob Sutter has an awesome video tutorial that shows you how to add a Condition statement to your IAM roles that can restrict item level access in your DynamoDB tables. This is super powerful for all us #SingleTableForLife peeps. This takes fine-grained security to the max. 🔒

Serverless Reads 🤓

Natively Debug AWS Lambda on your IDE!
Thundra allows you to natively debug your serverless applications on the cloud with their own permissions. Thundra’s online-debugger sets up a secure bridge between your AWS Lambda environment and your IDE. VSCode and IntelliJ IDEA are natively supported with plugins. For other IDEs, Thundra provides a portable client to foster the integration with any IDEs. Start debugging Node.js, Python and Java functions for free today! Sponsored

Tim’s Take: A re:Invent 2020 Serverless Wishlist
Tim Wagner (aka the father of Lambda) has a few #awswishlist items that he’d like the serverless teams at AWS to work on. Lots of really interesting ideas in here. My favorite is the idea of a shared in-memory cache (like Redis, only serverless). And let’s add serverless Elasticsearch to this list while we’re at it. 😉

Serverless computing: An ‘exciting space for engineers to play in’
I love reading interviews with serverless engineers that just get it. And Dave Anderson from Liberty IT definitely gets it. Dave gives some really solid answers to a number of common serverless questions.

Back to Basics: Why Global Infrastructure Matters
Great read by Serhat Can that discusses why being able to deploy to multiple regions is so important. It’s really easy to think about single region deployments, but with the right planning (think IaC), service providers like AWS make multi-region deployments an attainable goal for most organizations.

Abstractions and serverless
Adam Warski has an interesting piece that talks about (mis)handling abstractions and why we should be careful not to repeat the mistakes of the past as we continue to evolve serverless. I don’t agree with everything said (like building a non-trivial service with serverless is a high-risk), but I do agree that our current abstraction layers for serverless are not great.

Serverless Videos, Podcasts, and more… 🎧

Serverless Chats – Episode #41: Communication Patterns in Serverless with Paul Swail
In this episode, I chat with Paul Swail about the types of messaging systems available from AWS, how to use them with your serverless applications, and why thinking asynchronously is important to building resilient systems. ALSO: Serverless Chats is now on YouTube, so you can watch the episode here.

Screaming in the Cloud: Serverless Evangelism with Farrah Campbell
Corey Quinn chats with Farrah Campbell about the serverless community, her role as an AWS serverless hero, and how a serendipitous 20-minute car ride inspired her to make the jump into technology.

Real World Serverless – Episode #3: Building a fully serverless insurance company with Joe Emison
Part 2 of Yan Cui’s conversation with Joe Emison, who has been building serverless applications since 2015 with Firebase on GCP and then later with AWS Lambda.

The Serverless Trilemma: Building High-Quality Architectures
Quick video that gives a good overview of The Serverless Trilemma (paper about serverless function composition) and walks you through some examples of each of the three principles.

Build a serverless real-time analytics pipeline with AWS managed services
In this video, Marcia Villalba shows you how to get started building a serverless real-time analytics pipeline with AWS managed services and explains why we need analytics in our applications.

New from AWS 🆕

Amazon Managed Cassandra Service (preview) is now available in 18 AWS Regions
For those of you who love Cassandra, but hate managing it, MCS is now available in a region near you.

Amazon GuardDuty Price Reduction
Amazon GuardDuty is reducing the price of threat detection by adding an additional volume discount tier and further optimizing its CloudTrail analysis. Effective March 1, 2020, GuardDuty pricing for VPC Flow Log and DNS Log analysis now includes a new top discount tier of $0.

Amazon CloudWatch dashboards metric quotas has increased
Amazon CloudWatch now supports up to five times the number of metrics per graph and dashboard than before — up to 500 metrics per graph (from 100) and 2500 metrics per dashboard (from 500).

Amazon CloudWatch now provides more metric data, faster, with GetMetricData quota increase
You can now retrieve more metric data from Amazon CloudWatch, faster. The quota for the bulk metric retrieval service GetMetricData has increased from 100 to 500 metrics per request.

Thoughts from Twitter 🐦

AWS NodeJS sdk protip: ‘new aws.S3({logger: console})’ – async errors suddenly become much easier to understand ~ Gojko Adzic
Awesome tip from Gojko. This lets you log all the request details when calling S3 via the AWS SDK. Also, this option is available on all the other services like SQS, SNS, and DynamoDB.

Well, this changes everything. #AWSCertified. #aws #cloud ~ Andrew Brown
According to Andrew’s tweet, you can now take all AWS Certification exams with online proctoring. If you were looking for something to do during this lockdown, maybe an AWS certification would be a wise choice.

Upcoming Serverless Events 🗓

There are a lot of upcoming serverless events, webinars, livestreams, and more. If you have an event you’d like me to mention, please email me.

March 13-April 10, 2020 – Getting Started with Amazon DynamoDB (Virtual Workshops)

March 26, 2020 – AWS Serverless AMA on Reddit

March 27, 2020 ServerlessDays Hamburg (Rescheduled to October 2nd)

March 30, 2020 – Optimizing Lambda Performance for Your Serverless Applications (Online Tech Talk)

April 6, 2020 ServerlessDays Boston (Postponed – new date pending)

April 20, 2020 ServerlessDays Auckland (Postponed – new date pending)

April 21, 2020 – Failover CONF: A virtual event on reliability

April 23, 2020 ServerlessDays Vienna (Rescheduled to September 24th)

April 24, 2020 ServerlessDays Paris (Canceled)

April 29, 2020 – ServerlessDays Virtual

Serverless Star of the Week ⭐️

There is a very long list of people that are doing #ServerlessGood and contributing to the Serverless community. These people deserve recognition for their efforts. So each week, I will mention someone whose recent contribution really stood out to me. I love meeting new people, so if you know someone who deserves recognition, please let me know.

This week’s star is Angela Timofte (@AngelaTimofte).  Angela is a Tech Lead at Trustpilot, a global review platform that helps businesses collect and leverage customer reviews. Angela’s work has focused on building scalable solutions, and in particular, migrating from monolithic to serverless and event-driven architectures. Angela has also been active in the serverless community, speaking at ServerlessDays Stockholm and at AWS Community Day Nordics 2020 about DynamoDB. Thank you, Angela, for practicing and preaching about serverless! 🙌

Final Thoughts 🤔

I hope you are all doing well and staying healthy and sane during these crazy times. Many of us are lucky enough to be able to work from home and spend some extra time with our families, but I know that’s not the case for a lot of people out there right now. Wishing all of you well, and sending a big thank you from my family to the people on the frontlines of this crisis. Stay safe! 😷

I hope you enjoyed this issue of Off-by-none. Please send me your feedback and suggestions as they help to make this newsletter better each week. You can reach me via Twitter, LinkedIn, Facebook, or email and let me know your thoughts, criticisms, or (perhaps) even how you’d like to contribute to Off-by-none.

Take care,
Jeremy

P.S. If you like this newsletter, and think others would too, please do me the honor of sharing it with friends and coworkers who are interested in serverless.

Off-by-none: Issue #81

HTTP APIs for the rest of us… 🚀

Welcome to Issue #81 of Off-by-none. Thanks for joining us!

Last week, the Serverless Framework added Lambda Destination support, we saw some massive investment in serverless, and we introduced Yan Cui’s new serverless podcast. This week, we’re all about lightweight HTTP proxies to Lambda functions. Plus we’ve got some amazing posts from the serverless community.

Also, PLEASE don’t forget to take the Serverless Community Survey and share it with all your coworkers, family, and friends! The data from this is super important and will help the community make serverless better!

When you just need a simple HTTP proxy to your Lambda function… 👩‍💻

This past week, AWS announced that HTTP APIs have become GA, which is pretty darn cool. For web-facing serverless applications, API Gateway was likely the main entry point, which forced developers to use a fairly complex (and sort of expensive) tool to solve a simple problem. With the release of HTTP APIs, HTTP proxying to Lambda functions is not only super simple, but also 71% cheaper and 60% faster. Plus there’s a ton of other really great features and some exciting things on the roadmap.

If you want to learn more, check out:

And if you want to hear from one of the Senior Project Managers on the API Gateway team, have a listen to this week’s episode of Serverless Chats featuring Eric Johnson and Alan Tan.

Serverless News & Announcements 📣

End-to-End Observability for Serverless
Instantly monitor and troubleshoot Lambda functions to get the full picture of what they’re doing and why they fail. Agentless and automated, Epsagon delivers full visibility for containers, VMs, FaaS, and more with no training, manual coding, tagging or maintenance required. Try free today! Sponsored

Lightbend Secures $25 Million In Funding Led By Dell
Lightbend is the company that launched the CloudState spec initiative a while back that proposed adding state to serverless. It looks like whatever they are doing is getting attention from investors.

Tencent Cloud FaaS capability was evaluated as a “strong performer”
I know this is just a press release, but I think we should all keep our eyes on Tencent Cloud. I know that the Serverless Framework is working closely with them, and they appear to be bulking up their serverless offerings.

Next Phase Montage
Not really serverless news, but NPM is being acquired by GitHub (aka Microsoft). I think this will add more stability and security to NPM, which is a good thing, but the fact that Microsoft is buying another part of the backbone of the open source ecosystem seems a bit concerning. I should probably take off my tinfoil hat.

Stackery Announces Support for AWS HTTP APIs service
Stackery users can now implement the new HTTP APIs in their projects. And if it works for your API use case, you should definitely do this.

Serverless Stories 📖

How Serverless Saved Us For $2.
This is one of those serverless stories that should be sent to every naysayer out there. Generating 2,000 PDFs with a dedicated server takes up to 11 hours. With Lambda functions and SQS, it takes 2 minutes and costs $1.63.

Serverless CI/CD: How we added a staging step
I’ve never met the same serverless CI/CD process twice, and this one from the dev team at Lumigo is no exception. It’s always interesting to see how teams set these things up, so take a peek if you’re looking for some ideas.

How I Built a Serverless Geo-Search App with DynamoDB
Allen Helton recounts some of the bumps along the road when creating a completely serverless geo-search app. Some interesting notes in there about the constraints of third-party packages and the gotcha many people find when trying to update values in a DynamoDB table’s primary index.

Serverless Use Cases 🗺

Comparing Two Ways to Trigger Lambda from S3
Eoin Shanaghy compares S3 notifications versus EventBridge with CloudTrail to trigger a downstream Lambda function. While he notes the latency is higher with EventBridge, the decoupling is definitely a benefit.

Using AWS Sagemaker and Lambda function to Build a Serverless ML Platform
Machines learning use cases with Lambda can be tricky, but throwing SageMaker in there can open up a whole new set of possibilities. This is a really great post that shows how to leverage serverless tools with SageMaker to build a really cool prediction algorithm.

🤖 Price Tracking with Telegram Bot
Periodically checking something and pushing data to a bot seems like a pretty good serverless use case to me. Leon Wee provides a full blown tutorial in here, so if you wanted to implement something like this for yourself, feel free to give it a try.

Can you use Serverless for Artificial Intelligence today?
Rodolphe Cambier runs through two different types of AI use cases and examines whether or not they are a good fit for Lambda functions. I think we’ve been clear that many machine learning use cases are hindered by some of Lambda’s limitations, but I have a feeling that’s going to change at some point in the not so distant future.

Serverless Concepts 🏗

How to model one-to-many relationships in DynamoDB
Another awesome post by Alex DeBrie on DynamoDB modeling. There are so many amazing things that can be done with NoSQL if the data is modeled correctly, and Alex gives you a very thorough lesson on a very useful pattern.

Designing Serverless APIs with AWS
This is a good overview by Udith Gunaratna of the different ways to build APIs using API Gateway and Lambda functions. It outlines some pros and cons to single purpose versus fat Lambdas, along with a discussion on the different types of integrations. Of course, HTTP APIs is likely going to change you approach to this.

Best Practices for Serverless Observability
Whenever the subject of observability comes up, Ran Ribenzaft’s always a great resource to turn to. This post will give you a great overview of what observability is, and how you should be applying it to your serverless applications.

DynamoDB Crash Course — Intro and Secondary Indexes
If you’re looking for a more general overview of DynamoDB, take a look at this article by Stephen Lizcano. I’m loving the recent influx of articles and videos on DynamoDB. We have an entire generation of developers that need to start looking at NoSQL very seriously.

Serverless Tutorials 👷‍♀️

Debug AWS Lambda functions with Thundra Online Debugging
The new Thundra Online Debugger is pretty sweet, so at the very least, you should give this thing a try. Ryan Jones walks you through the whole process from setting up your Thundra account, to installing the VS code plugin, to debugging your first Lambda function.

How to access cloud resource configuration from your local tests
This is a common task that many people end up banging their head against the wall trying to solve. Paul Swail teaches you his preferred method using the serverless-export-env plugin for the Serverless Framework.

How to Build A Serverless Telegram Bot with AWS Lambda
It seems Telegram Bot is popular this week. This post shows you how to implement a Lambda function to respond to bot requests.

Mastering the AWS SAM CLI
There are lots of framework options out there for deploying serverless applications, but if you’re doing straight AWS, it’s hard to go wrong with SAM. Serkan Özal gives you a detailed overview of all the commands you need to know to be publishing serverless apps in no time.

Testing serverless apps with Mocha on Begin
I’m a big fan of Test-Driven Development (though I’m not always a strict practitioner), but any time I see workflows encourage and fully integrate testing, it’s worth sharing. Paul Chin Jr. shows you how this works with Begin using either Mocha or Jest.

Conditionally deploy Serverless services only when modified in a mono Git repository
I’ve included this because I think it’s a creative approach to this common problem. I really like splitting out my services into separate repos, but this has bitten me more that a few times. There are more options now for serverless monorepo deployments, but it never hurts to open up the hood and see how this stuff works.

Serverless Reads 🤓

Natively Debug AWS Lambda on your IDE!
Thundra allows you to natively debug your serverless applications on the cloud with their own permissions. Thundra’s online-debugger sets up a secure bridge between your AWS Lambda environment and your IDE. VSCode and IntelliJ IDEA are natively supported with plugins. For other IDEs, Thundra provides a portable client to foster the integration with any IDEs. Start debugging Node.js, Python and Java functions for free today! Sponsored

Why Organizations Are Adopting or Avoiding Serverless
Roger Magoulas has another wrap up article about the O’Reilly survey on serverless architecture adoption. Some interesting takeaways in here, especially the fact that “security concerns” was the top reason why organizations were avoiding serverless. Also, still seeing “vendor lock-in” way up on the list of challenges.

Edge Computing: Cloudflare’s Current Expansion Is Different
I know I’ve said this before, but if you’re wondering what comes after serverless, edge computing is probably it. Cloudflare’s strategy on this is really interesting, and while there is some competition, they’re certainly positioning themselves well to be the pioneers on this.

Will Virtual Machines Fade Out for Containers and Serverless?
I thought this was a good piece by Joao-Pierre S. Ruth that highlights the importance of choosing the right technology for the right job. There’s no doubt that lifting and shifting to VMs is easier than containerizing your applications, and that taking the next step to serverless will require a complete refactor. So while new applications will obviously benefit from modern technologies, there are still plenty of reasons why we’ll be seeing VMs for quite some time.

InfiniCache: Distributed Cache on Top of AWS Lambda (paper review)
Mikhail Shilkov did an excellent job reviewing “InfiniCache: Exploiting Ephemeral Serverless Functions to Build a Cost-Effective Memory Cache”, a paper by Ao Wang et al. It’s always interesting to see what kinds of crazy ideas people come up with, and sometimes it things like this that can push providers to make their better products.

For the audio/visual crowd… 📽

Serverless Chats – Episode #40: HTTP APIs for API Gateway with Eric Johnson and Alan Tan
In this episode, I chat with Eric Johnson and Alan Tan about why HTTP APIs should be your first choice, the path to REST API feature parity, how private integrations work, implementing CORS and authentication more easily, and so much more.

Using Environment Variables to Deploy to Different Environments with AWS CodePipeline
Marcia Villalba shows you how to configure your SAM templates to create dynamic resource mappings when deploying your serverless applications using AWS CodePipeline.

Real World Serverless #2: The case for monorepoes with Joe Emison
Part 1 of Yan Cui’s conversation with Joe Emison, who has been building serverless applications since 2015 with Firebase on GCP and then later with AWS Lambda. They discuss the value of serverless, especially to startups, and why he has built Branch Insurance to be fully serverless.

Serverless Lunch Chats with James: EventBridge resources
James Beswick, Senior Developer Advocate for Serverless at AWS, did a Twitter Live chat the other day and discussed EventBridge. He posted some additional materials as well that will help you start building better event-driven applications.

New from AWS 🆕

Amazon Athena now publishes CloudWatch Events for Athena query state transitions
This is an awesome new feature that can open up a ton of new data processing pipelines. Using these new events, you can create a rule that invokes an AWS Lambda function to post-process the query results when a query has reached the Successful terminal state. Very cool stuff.

Amazon ElastiCache for Redis announces Global Datastore
So, not really serverless, but Redis has become the go-to for many serverless apps that need reliable and fast caching. This new feature lets you replicate your cache to two different AWS regions, which could dramatically reduce latency for many applications that are still pulling data from a single region. More details here.

Amazon Athena adds support for managing Athena Workgroups using AWS CloudFormation
Athena has become an essential part of my serverless data infrastructure, so more repeatable CloudFormation configurations are always welcome.

Amazon Elasticsearch Service announces support for Elasticsearch versions 7.4
Still not serverless, but like ElastiCache, Elasticsearch is another necessity in many “mostly” serverless applications. This new update adds support for the distance_feature query, some new range aggregations, plus a few updates to Kibana.

New AWS Certification validates expertise in AWS databases
For those of you striving to become an AWS purpose-built database master, you can now attain blackbelt status with this new certification.

Amazon S3 adds tagging support for S3 Batch Operations jobs
S3 Batch is pretty amazing, but it can also be a bit dangerous if anyone in your organization can trigger a job. With this new update, you can use tags to restrict access to specific jobs using IAM.

You now can update your Amazon DynamoDB global tables from version 2017.11.29 to the latest version with a few clicks in the DynamoDB Console
If you are running old DynamoDB global table versions, you should consider doing this. It’s free, requires no table rebuilds, and will allow you to take advantage of the more modern replication features, higher availability, and access to additional regions.

Amazon Redshift introduces support for materialized views (Generally Available)
Also not serverless, but this is a really cool feature. Lots of us have data in Redshift, even if it’s replicated from something like DynamoDB for analytics purposes. These new materialized views can help speed up query performance by pre-computing some of the more predictable workloads.

Serverless Tools 🛠

10 Essential Serverless Framework Plugins
The rich ecosystems of plugins is just another reason why the Serverless Framework is so powerful. Itay Herskovits calls out ten that are super useful in the serverless developer’s toolbox.

Testing DynamoDB offline with Serverless Framework
Michael Timbs shows you how to implement testing using the serverless-dynamodb-local plugin. I’ve gone back and forth on the value of trying to replicate DynamoDB locally, and I tend to favor using a real cloud environment instead. However, if you have a reason for doing it this way, this post will point you in the right direction.

Debugging Event Sources for AWS Lambda
New Relic has always been a solid tool for monitoring applications, and since the team from IO Pipe joined them, the new features being churned out for serverless are quite amazing. Adam Johnson walks you through their event sources feature for Node.js and Python that lets you see which service invoked your Lambda function.

Kumologica: First low-code development tool for AWS Lambda
I don’t know anything about this company, but I came across this blog post and thought it looked like an interesting tool. I need to give it a more thorough look.

Upcoming Serverless Events 🗓

There are a lot of upcoming serverless events, webinars, livestreams, and more. If you have an event you’d like me to mention, please email me.

March 13-April 10, 2020 – Getting Started with Amazon DynamoDB (Virtual Workshops)

March 19, 2020 ServerlessDays Zürich (Rescheduled to September 24th)

March 24, 2020 ServerlessDays Helsinki (Postponed – new date pending)

March 24, 2020 – Introducing HTTP APIs: A Better, Cheaper, Faster Way to Build APIs (Online Tech Talk)

March 27, 2020 ServerlessDays Hamburg (Rescheduled to October 2nd)

March 30, 2020 – Optimizing Lambda Performance for Your Serverless Applications (Online Tech Talk)

April 6, 2020 ServerlessDays Boston (Postponed – new date pending)

April 20, 2020 – ServerlessDays Auckland

April 23, 2020 ServerlessDays Vienna (Rescheduled to September 24th)

April 24, 2020 ServerlessDays Paris (Canceled)

Serverless Star of the Week ⭐️

There is a very long list of people that are doing #ServerlessGood and contributing to the Serverless community. These people deserve recognition for their efforts. So each week, I will mention someone whose recent contribution really stood out to me. I love meeting new people, so if you know someone who deserves recognition, please let me know.

This week’s star is Aviad Mor (@AviadMor). Aviad is the CTO and Co-Founder at Lumigo, a serverless intelligence platform. Aviad’s work extends beyond working on serverless tools that help in troubleshooting serverless applications though. He’s also spoken at ServerlessDays events, chatted with the Devops Chat podcast, and has a few blog posts on serverless that have appeared on the Lumigo blog and on The New Stack. Thank you, Aviad, for helping developers build more reliable serverless applications! 🙌

Final Thoughts 🤔

It’s been a bit of a strange week as the world adjusts to this new normal caused by COVID-19. I’m hoping that all this self-quarantining will lead to inspiration and we’ll see a bunch of really great serverless content and projects come from all this extra free time that people have. Maybe it’s time for you to write your first blog post? 😉

However you decide to spend your time, please stay safe, take care of your loved ones, follow the advice of your local officials, and support health care workers and neighbors in whatever ways you can. We can do this.

I hope you enjoyed this issue of Off-by-none. Please send me your feedback and suggestions as they help to make this newsletter better each week. You can reach me via Twitter, LinkedIn, Facebook, or email and let me know your thoughts, criticisms, or (perhaps) even how you’d like to contribute to Off-by-none.

Best,
Jeremy

P.S. If you like this newsletter, and think others would too, please do me the honor of sharing it with friends and coworkers who are interested in serverless.

Off-by-none: Issue #80

Welcome to your Lambda Destination… 🏝

Welcome to Issue #80 of Off-by-none. Thanks for joining us!

Last week, we met some new heroes, got HTTP APIs support in the Serverless Framework, and a GA version of NoSQL Workbench. This week, the Serverless Framework adds Lambda Destination support, we see a massive investment in serverless, and we get a new serverless podcast. Plus we have plenty of awesome posts from our friends in the serverless community.

⚠️ Before we begin, don’t forget to take the Serverless Community Survey! And if you already took it, please share it with all your recently work-from-home (or self-quarantined 😬) coworkers, family, and friends. ☣️

Serverless News & Announcements 📣

End-to-End Observability for Serverless
Instantly monitor and troubleshoot Lambda functions to get the full picture of what they’re doing and why they fail. Agentless and automated, Epsagon delivers full visibility for containers, VMs, FaaS, and more with no training, manual coding, tagging or maintenance required. Try free today!. Sponsored

AWS Lambda Destination Support
Praise [insert deity of your choice]! 🙌I cannot understate the importance (or my excitement of) Lambda Destinations. And now that the Serverless Framework supports them, I can go through all my recent projects and pull out those AWS::Lambda::EventInvokeConfigs from my resources.

Netlify nabs $53M Series C as microservices approach to web development grows
Another big money investment into the serverless space. Netlify is a great example of taking a serverless use case to the extreme and monetizing it. Happy to see this company keep growing and enabling more serverless sites.

Announcing the new Real-World Serverless podcast
More serverless content for your commute! 🎧Yan Cui has launched a brand new podcast where he discusses real-world use cases and challenges with the engineers who are building serverless applications.

2019 CNCF Survey results are here: Deployments are growing in size and speed as cloud native adoption becomes mainstream
The CNCF released the results of their cloud native survey from last year. Some of the big takeaways are that container usage is up (no surprise there), but 41% of respondents are using serverless, with AWS Lambda topping out the hosted solution (53%) and Knative being the most popular (34%) for installable software.

TriggerMesh Joins the Cloud Native Computing Foundation
I still think we need to have a separate “Cloud Native, but for real this time, Computing Foundation” that focuses only on serverless, but I guess having more contributors to the CloudEvents spec isn’t a bad thing.

Putting an End to the Misery of Serverless Application Debugging With Thundra
I saw a demo of the Thundra Debugger the other day and it is very, very cool. One of the biggest problems we have as serverless developers is needing to test code remotely, which often means republishing over and over and adding more logging. The way this tool integrates directly with your IDE changes everything.

Serverless Stories 📖

Rust and Serverless, with a focus on Cloudflare Workers
Simon Werner has a good post that documents his experience trying to build a REST API with Rust and serverless. Lots of roadblocks right now, but given the future of WASM and serverless computing at the edge, this is something to keep your eye on.

How to Build a Scalable, Cost-Effective Event-Driven ETL Solution using Serverless?
Vyas Sarangapani has an awesome post that documents the architecture his team used to build a serverless ETL system. I love when people share their architectures. It’s always super instructive to see how others solve their problems.

AWS Lambda With Static Outgoing IP
Not every problem is easily solved with a serverless solution (though I’ve had success using a NAT Gateway as a proxy), so sometimes throwing an EC2 server into the mix might work for you. Yury Smykalov explains why EC2 plus tinyproxy worked for him.

Serverless Use Cases 🗺

Build Slack Home Tab in minutes using AWS Lambda and Amazon EventBridge
Slobodan Stojanović has a great article that shows you how Vacation Tracker is using their SAR App to route their Slack commands through EventBridge and off to Lambda workers to handle the response. There are some very cool patterns in here, plus sample code if you want to implement some of this yourself.

AWS primitives for scheduling future tasks
Paul Swail outlines a few strategies that can be used to schedule tasks with AWS. This has been written about extensively (and he includes some links to those articles), but it’s a common use case that creeps up from time to time. I personally like running a CloudWatch Event every 15 minutes and using an SQS with a DeliveryDelay to handle more precision, but everything has its tradeoffs.

Does Serverless Make Sense for Your Organization?
This article lays out five different use cases for serverless that are being applied by a number of large companies. There are a few “other considerations” in here, but I feel like we’ve addressed those a thousand times over.

Monitor Servers and Reboot SolusVM via AWS Lambda Function
Whether you’re running SolusVM or not, using a Lambda function to monitor servers or perform schedules maintenance is a great DevOps use case for serverless.

Serverless Concepts 🏗

5 reasons why you should use EventBridge instead of SNS
Yan Cui outlines five reasons why EventBridge should be your new go-to over SNS. There are still plenty of reasons why you’d want to use SNS, but with all the capabilities being added to EventBridge (like content filtering), the majority of use cases will be satisfied.

Firecracker: lightweight virtualization for serverless applications
If you ever wanted to do a deep dive on Firecracker, but didn’t want to dig through all the open source docs, Adrian Colyer has a treat for you. In this post, he summarizes the recently released NSDI’20 paper on Firecracker and gives you a great overview of its design and the problems it solves.

5 Steps to Making a Predictable Cost Model for AWS Serverless Projects
Great article by Allen Helton that points out a number of cost considerations when building serverless applications. Data transfer, execution time, CloudWatch logs, etc., all have costs associated with them. He also mentions cost modeling around business processes, which I’m a huge fan of. One of the super powers of serverless is knowing exactly how much a particular process will cost you, which makes calculating the value of that process much easier.

Introduction to Firebase
You know I’m a big fan of the AWS ecosystem, but if you’ve never looked at Firebase, you definitely should. There are some great features and capabilities (like built-in auth) that make it a handy tool in your serverless arsenal.

Lambdas in Production
Caleb Brewer has a nice “cheatsheet” of things to remember when running Lambdas in production. It’s not a long list, but each one is an absolute must.

Serverless Tutorials 👷‍♀️

Supercharge Development, Delivery and Management of Serverless Applications
Stackery empowers enterprise development teams to deliver Well-Architected serverless applications quickly, securely, and at scale— without the overhead of complex infrastructure and operations management. Accelerate overall development and secure delivery of serverless applications by up to 60x – so your team can focus on perfecting core business logic. Sponsored

HTML to PDF conversion using Node.js runtime as AWS Lambda Functions
Keyur Bhole shows you how to generate a PDF from HTML and CSS using the Node.js runtime on AWS Lambda Functions. He also provides you with the compiled executables to add to you Lambda Layers.

Add type definitions to your Lambda functions
Great tip from Paul Swail about using the @types/aws-lambda library to add autocomplete and type checking to your IDE when developing with TypeScript.

New at Begin: add and manage routes via manifest file
I really like what Brian Leroux and his team are doing over at Begin. The Architect Framework is really powerful and super easy to use, and Begin ties it all together to let you build modern apps, “fast af.” 😉

Serverless Kubernetes with Amazon EKS
I have absolutely no interest in doing this, but for those of you looking for a K8s alternative with the same basic semantics, this tutorial is for you.

Using Serverless Framework with the Amplify Client Library
If you want to take advantage of the Amplify Client Library, but you’d like more control over your serverless backend, Josh Heling can show you how.

Serverless Security 🔒

Egress Filtering in Serverless Applications
I love me a good serverless security post. Dorian Smiley points out something that many people seem to overlook (besides the fact that most developers don’t think about security). Lambda functions that are not in a VPC have wide open “outbound” access to the public Internet. There are several reason why you would want this, but if you are using lots of NPM dependencies (and you know you are), then this can be a huge security risk. Dorian offers some mitigation strategies in here, but having the ability to disable outbound access from non-VPC Lambda functions has been on my #awswishlist for quite some time.

Serverless (in)security
Pawel Rzepa rehashes the main concerns with security in serverless. As he says, it’s really all about application security. Don’t trust any inputs (even if generated by a cloud resource), use the Principle of Least Privilege, and be wary of third-party dependencies. That should get you most of the way there.

Serverless Reads 🤓

Cloud developers are falling in love with serverless computing – and more soon should
Jason English has a nice round up of some recent studies and reports about serverless that point to the adoption curve trajectory. We’ve commented in the past on the reports mentioned, and the underlying data certainly seems to show that people get it. Although, that recent CNCF survey said 83% of cloud customers are running containers with 78% on Kubernetes.

11 Reasons Why You Are Going To Fail With Microservices
This isn’t specific to serverless, but I found the article to be quite interesting. I’m a huge fan of microservice architecture, especially using serverless, but it is very easy to get lots of things wrong. There are many excellent reasons to choose microservices, however, be cautious of the potholes along your journey.

Serverless is not functions
David Carboni has a thoughtful piece that discusses the “unlearning” that must happen as we move to a serverless mindset. He also recounts his “presentation-less” talk at ServerlessDays Cardiff (which I was lucky enough to see in person).

De-construct the Monolith: How Serverless Modernizes Infrastructure & Refactors Apps
Another great post by Tim Zonca from Stackery. If you’re trying to get some decision makers to buy in on serverless, send them a link to this post.

For the commuter… 🚎

Serverless Chats Podcast – Episode #39: Big Data and Serverless with Lynn Langit
In this episode, I chat with Lynn Langit about why big data is outgrowing traditional systems, how bioinformatics and genomics are generating the biggest data scale ever seen, and why serverless and the cloud are making it easy for researcher to process this data faster and more economically.

ServerlessDays Nashville 2020 – How to fail with Serverless by Jeremy Daly
Here’s my talk from ServerlessDays Nashville. The cloud is designed for failure, and public cloud providers like AWS have several ways to deal with those failures in your applications. In this talk, I review the failure modes and retry policies that allow you to build resilient, highly-available systems.

Videos from ServerlessDays Nashville 2020
And if you really want to dig deep, check out the YouTube playlist for all of the talks at ServerlessDays Nashville 2020.

Why you should use OpenAPI for your API design
Nick Van Hoof talks about how OpenAPI can make your life easier in a serverless world in his presentation from the API Conference.

New from AWS 🆕

AWS Serverless Application Repository adds support for sharing applications with AWS organizations
I really love the concept behind SAR, but multi-account sharing was always a bit of a pain. Now you no longer need to manually enter in account ids, but can share with your entire organization and never have to worry about updating your app configs again. Check out this great post by James Beswick.

Amazon CloudWatch now allows you to combine multiple alarms
You can now combine multiple alarms to reduce alarm noise and focus on critical operational issues. This is a pretty cool feature. For example, I have an alarm on ApproximateNumberOfMessagesVisible and another one on ApproximateAgeOfOldestMessage. I only need an alert if they both cross a certain threshold.

AWS WAF adds Anonymous IP List for AWS Managed Rules
Useful feature if you want to block users who attempt to hide their identity or evade geographic restrictions.

Build k-Nearest Neighbor (k-NN) similarity search engine with Amazon Elasticsearch
This is a very cool new feature built in to Amazon Elasticsearch. While a relatively simple algorithm, k-NN is quite effective, and can be a super useful addition to your ES datasets.

Amazon SageMaker Ground Truth Now Supports Multi-Label Image and Text Classification and Amazon CloudWatch Events
If you’ve ever actually built a machine learning application, you’ve likely had to set up an interface for human review (it’s okay, you can admit it). So having SageMaker Ground Truth at your disposal is pretty sweet. And now you can enable multi-classification and CloudWatch events to kick off additional workflows.

Serverless Tools 🛠

24 open source tools for the serverless developer: Part 1 & Part 2
Yan Cui has assembled a list of open source tools that help make serverless development easier.

Thoughts from Twitter 🐦

In this thread: more evidence AWS needs to build a circuit breaker state service, and integrate it deeply into Lambda. Customers arguing about the best way to implement something we all need to build for ourselves is a prime indicator of opportunity. ~ Ben Kehoe
Ben makes an extremely important point. If you’re not using circuit breakers, you should be, but the implementation (and the best practices) aren’t very obvious when it comes to Lambda functions. Also, depending on the invocation method, velocity, and throughput, there are different ways to approach the problem (think stream processing). Having an official built-in feature would be very nice.

We recently made changes that reduced the time to ~5 min consistently. We’re not done yet as this continues to be a priority for us this year. When we say a config is deployed we reference p100 metrics; however, most edge locations are updated in seconds. ~ Amazon CloudFront
Um, so this is awesome news. I was not seeing these improvements the other day (still looking at 20+ minutes for initial deployments and 15+ for modifying updates), but the fact that this is being worked on and some changes have been made, is welcome news.

Friends, I’m just starting to get into and research AWS Lambdas, but as primarily a front-end dev, I don’t have a lot of use cases in mind. What are some of the ways you’re using Lambdas? ~ Kyle Shevlin
Kyle has been an awesome contributor to the JavaScript space, and it’s great to see him venturing into serverless. His post asks for use cases, and while I commented that you can use serverless for almost anything, there were several more specific responses that you might find helpful in the thread.

Upcoming Serverless Events 🗓

There are a lot of upcoming serverless events, webinars, livestreams, and more. If you have an event you’d like me to mention, please email me.

March 10, 2020 – How Best Friends Animal Society Shifts-Left with Security Strategy on AWS Serverless Infrastructure (webinar)

March 13-April 10, 2020 – Getting Started with Amazon DynamoDB (Virtual Workshops)

March 19, 2020 – ServerlessDays Zürich

March 24, 2020 – ServerlessDays Helsinki 🗣

March 24, 2020 – Introducing HTTP APIs: A Better, Cheaper, Faster Way to Build APIs (Online Tech Talk)

March 27, 2020 ServerlessDays Hamburg (Rescheduled to October 2)

March 30, 2020 – Optimizing Lambda Performance for Your Serverless Applications (Online Tech Talk)

April 6, 2020 ServerlessDays Boston (Rescheduled – new date pending)

April 20, 2020 – ServerlessDays Auckland

April 23, 2020 – ServerlessDays Vienna

April 24, 2020 – ServerlessDays Paris

Serverless Star of the Week ⭐️

There is a very long list of people that are doing #ServerlessGood and contributing to the Serverless community. These people deserve recognition for their efforts. So each week, I will mention someone whose recent contribution really stood out to me. I love meeting new people, so if you know someone who deserves recognition, please let me know.

This week’s star is Amy Arambulo Negrette (@nerdypaws). Amy most recently started a role as Cloud Architect at Trek10, a company that designs, builds, and supports serverless and event-driven architectures for its customers. But before her recent move, Amy was a Cloud Software Engineer at CloudReach, and prior to that, came from the public sector where she designed enterprise scale solutions while updating them with serverless technologies. She’s even built web applications for names like Yahoo! Sports and NASA. Thank you, Amy, for all your work in serverless! 🙌

Final Thoughts 🤔

Lots of great stuff happening in the serverless space this past week. More tools, more investments, and more great content to help developers learn how to build better serverless applications. In other not-so-good news, the recent COVID-19 outbreak is wreaking havoc on people’s health and the world economy. So, stay safe out there, wash your hands, take care of your loved ones, and if you’ve got some extra time at home because you no longer need to commute to the office, use that time to learn more about serverless. 😉

Also, please don’t forget to take the Serverless Community Survey! The more responses we get, the more valuable the data will be. We are sharing this data with everyone, so your input will help the community make serverless better.

I hope you enjoyed this issue of Off-by-none. Please send me your feedback and suggestions as they help to make this newsletter better each week. You can reach me via Twitter, LinkedIn, Facebook, or email and let me know your thoughts, criticisms, or (perhaps) even how you’d like to contribute to Off-by-none.

Best,
Jeremy

P.S. If you like this newsletter, and think others would too, please do me the honor of sharing it with friends and coworkers who are interested in serverless.

Off-by-none: Issue #79

Super Serverless Tuesday… ☑

Welcome to Issue #79 of Off-by-none. Thanks for being here!

Last week, we launched the Serverless Community Survey (don’t forget to take it and share it). This week, we meet some new heroes, welcome HTTP APIs support in the Serverless Framework, and upgrade our NoSQL Workbench. Plus we have loads of awesome content from the serverless community.

Serverless News & Announcements 📣

End-to-End Observability for Serverless
Instantly monitor and troubleshoot Lambda functions to get the full picture of what they’re doing and why they fail. Agentless and automated, Epsagon delivers full visibility for containers, VMs, FaaS, and more with no training, manual coding, tagging or maintenance required. Try free today!. Sponsored

Introducing a Dart runtime for AWS Lambda
I’ve heard a lot of people championing Dart lately, though I’ve yet to spend any meaningful amount of time with it. But if you want to dive in with Dart, then this new custom runtime is for you.

Announcing Support for AWS HTTP APIs
Awesome! HTTP APIs are a great (and much cheaper) alternative to many API workloads. Now that the Serverless Framework supports them (and we get closer to the HTTP APIs GA), I think we’ll see a massive uptick in adoption of this new service.

Announcing the FaunaDB Extension for Visual Studio Code
This extension allows users to browse their FaunaDB databases, indexes, collections, documents, and functions from right inside of the VS Code sidebar.

Get to know the latest AWS Heroes, including the first IoT Heroes!
Congratulations to all the new AWS Heroes, including some new serverless ones!

Serverless Use Cases 🗺

Handling 350k Requests for $3 using Lambda
Insightful post by Burak Karakan on how his browser extension side project is handling hundreds of thousands of API calls per month for less than $3. He makes a number of serverless criticisms as well, mostly around the common arguments of observability and vendor lock-in. While he does praise Lambda, he also argues for a limited set of use cases, then offers Docker and Kubernetes as an alternative. I find this a bit antithetical to his “set it and forget” and ease of “serverless deploy” arguments from earlier. Opinions are fine, but pigeonholing use cases makes adoption harder IMO.

The Serverless Path to DevOps
Excellent article by Sarjeel Yusuf about the DevOps use cases enabled by serverless tools and why implementing them is a no-brainer. I’ve always loved this approach to serverless adoption, because it has the immediate benefit of improving the reliability and resiliency of your entire infrastructure, even if you’re still running VMs.

Serverless Concepts 🏗

Amazon API Gateway HTTP APIs with the Serverless Framework
Eduardo Rabelo adds some additional detail about the differences between API Gateway REST and HTTP APIs, why you should choose one over the other, and some implementation details using the recently added Serverless Framework support.

Serverless Auth with AWS HTTP APIs
Now that the Serverless Framework supports HTTP APIs, why not take advantage of the built-in authorizer support? This post from Fernando Medina Corey will show you how to use JSON Web Tokens to authorize your endpoints against Cognito.

“Serverless Transformation: at any scale” Preview Chapter
Ben Ellerby from Theodo has started working on a book about transforming your organization to a serverless-first approach, and you can get a preview chapter for free.

Inter-service communication channels for serverless microservices in AWS
Paul Swail shares some pros and cons for using different methods to pass messages between serverless microservices. There is some good information in here. A key thing to remember with inter-service communication is making sure you have message durability and sound replay strategies.

Serverless Tutorials 👷‍♀️

Setup AWS CI/CD for Serverless Deployment
Another day, another way to setup a serverless CI/CD process. Jay Desai shows you step by step how he does it.

Build a global serverless application in 30 minutes with AWS CDK.
Brian Foody shows you how to use AWS CDK to deploy a multi-region serverless application, complete with Route 53 Latency-based routing and global DynamoDB tables.

Getting started with AWS, Serverless & TypeScript
Michael Timbs gives you a complete set of instructions, along with all the tools, plugins and tweaks you’ll need to set up your first Serverless Framework project on AWS with TypeScript.

Optimise your Lambda functions using Webpack
This is something that should be built-in to every Node.js serverless deployment. I do this with all my projects, and I highly recommend you do as well.

Simple Firebase Authorization for AWS Lambda and API Gateway
Everyone’s jumping in on this HTTP APIs JWT authorizer capability. Joseph King shows you how to use Firebase as your issuer from both the console, and with IaC using the new support from the Serverless Framework.

Serverless Reads 🤓

Supercharge Development, Delivery and Management of Serverless Applications
Stackery empowers enterprise development teams to deliver Well-Architected serverless applications quickly, securely, and at scale— without the overhead of complex infrastructure and operations management. Accelerate overall development and secure delivery of serverless applications by up to 60x – so your team can focus on perfecting core business logic. Sponsored

10 Tips to Optimize Your DynamoDB Costs
I have some notes for a similar post, but until I can find time to finish it, Rafal Wilinski’s should hold you over. Lots of really good suggestions in here to cut down your total DynamoDB bill.

Creating Stream Processors with AWS Lambda Functions
John Gilbert discusses his approach to stream processing in Lambda using his aws-lambda-stream library. I think this is an interesting approach, but I think some of this complexity is better off handled by the cloud. I do really like some of the built in functional programming components.

Catching up with Google BigQuery
Informative post by Tony Baer about some of the recent moves made by GCP to add to their BigQuery offering. This idea of running ML models from SQL is something other clouds are working on too, but adding more powerful computation to the data engine enhances GCP’s already powerful serverless data offering.

ABL in focus #8: Instrumenting distributed systems for operational visibility
Efi Merdler-Kravitz shares is notes on David Yanacek’s post from the Amazon Builders’ Library. Lots of great bullet points in here with some practical advice from Efi himself.

How do I structure a monorepo serverless project with the Serverless Framework?
Ryan Jones outlines how he sets up a monorepo for serverless projects. It’s such a tough call sometimes balancing the pros and cons of a mono- versus multi-repo setups, especially when it comes to CI/CD. But as he points out, the new Serverless Framework Pro can handle this quite nicely, which might make the choice easier.

For the commuter… 🚎

Serverless Chats Podcast – Episode #38: From Digital to Serverless Transformation with Ben Ellerby
In this episode, I chat with Ben Ellerby about the evolution from digital to serverless transformation, why hands-on experience is important to understanding what serverless actually is, the current problems with complexity, and why you can’t be cloud native without embracing some form of lock-in.

Intro to Amazon EventBridge
James Beswick covers the challenges and benefits of implementing an event-driven design using EventBridge. It’s a relatively short video, but it is packed with lots of really useful information.

New from AWS 🆕

NoSQL Workbench for Amazon DynamoDB is now generally available
I really love this tool, so I’m glad to see that it’s now GA. I did give the latest version a test drive, and there are still a few things I’d like to see changed, but overall, it is really great to work with.

Automate index management with Amazon Elasticsearch Service
Now if they can just make it fully serverless! But seriously, these are great additions that certainly cut down some of the ongoing operational management.

Amazon Managed Cassandra Service now enables you to add new columns to existing tables
I didn’t even know you couldn’t do this! Well, if this was holding you back, this update should make you happy. I prefer to stick with DynamoDB, but maybe that’s just me.

Amazon Athena adds support for querying data in S3 buckets using AWS Identity and Access Management’s aws:CalledVia condition key
This is a nice security feature that was added to S3. I use Athena all the time, and making this work in the past forced you to skip some of the additional security controls available to you.

AWS Step Functions now supports CloudWatch Logs for standard workflows
You can now use AWS Step Functions to log workflow execution history to CloudWatch Logs, which make it faster and easier to monitor event-driven, serverless workflows.

AWS Lambda@Edge now supports Node 12.x and Python 3.8
You can now use Node.js 12.x and Python 3.8 to develop functions in Lambda@Edge, but you still have to wait quite some time for your code changes to propagate. 🤷‍♂️

Amazon Transcribe now supports automatic content redaction
This seems like a really cool feature for the right use cases. However, I stopped using Transcribe a while ago because the quality just wasn’t high enough, so I’d be interested in hearing how effective this is, especially when it eventually supports non-English languages.

AWS Control Tower now supports single-step account provisioning
This looks like another step in the right direction for Control Tower. You still need to set up a new master account to use Control Tower, so maybe a project for another day.

Upcoming Serverless Events 🗓

There are a lot of upcoming serverless events, webinars, livestreams, and more. If you have an event you’d like me to mention, please email me.

March 10, 2020 – How Best Friends Animal Society Shifts-Left with Security Strategy on AWS Serverless Infrastructure (webinar)

March 19, 2020 – ServerlessDays Zürich

March 24, 2020 – ServerlessDays Helsinki 🗣

March 27, 2020 ServerlessDays Hamburg (Rescheduled to October 2)

April 6, 2020 – ServerlessDays Boston

April 20, 2020 – ServerlessDays Auckland

April 23, 2020 – ServerlessDays Vienna

April 24, 2020 – ServerlessDays Paris

Serverless Star of the Week ⭐️

There is a very long list of people that are doing #ServerlessGood and contributing to the Serverless community. These people deserve recognition for their efforts. So each week, I will mention someone whose recent contribution really stood out to me. I love meeting new people, so if you know someone who deserves recognition, please let me know.

This week’s star is Shingo Yoshida (@yoshidashingo). Shingo is the CTO of CYDAS, a cloud-based human resource empowerment platform, as well as the founder of Section-9, which, among many other things, helps companies with AWS migration and optimization. Shingo is actively involved in the serverless community, founding Serverless Community (JP), and is also a member of the Japan AWS User Group. Additionally, Shingo was named a 2019 AWS Serverless Hero for his contributions through community events, blog posts, and books focused on serverless. Thank you, Shingo, for being an advocate for serverless! 🙌

Final Thoughts 🤔

It’s bittersweet to think of the awesome time I had at ServerlessDays Nashville last week. The organizers put on a heck of a show in an amazing and vibrant city. My heart goes out to all the people affected by the recent tornado. I’m hoping their community can recover quickly. 🙏

In brighter news, please don’t forget to take the Serverless Community Survey and share it with all your friends, family, coworkers, neighbors, pets, etc. The data collected will be 100% open sourced and available to anyone that wants to use it. The more responses we get, the more valuable the data will be.

I hope you enjoyed this issue of Off-by-none. Please send me your feedback and suggestions as they help to make this newsletter better each week. You can reach me via Twitter, LinkedIn, Facebook, or email and let me know your thoughts, criticisms, or (perhaps) even how you’d like to contribute to Off-by-none.

Take care,
Jeremy

P.S. If you like this newsletter, and think others would too, please do me the honor of sharing it with friends and coworkers who are interested in serverless.