January 14, 2020 Serverless API Gateway: Is it Right For You? Serverless API Gateway — Create, publish, monitor, maintain and secure REST APIs and web services at any scale. But, is it right for you? Chris McLeod The following is an excerpt from our Serverless API Gateway guide: There’s More To Serverless Than AWS Lambda You put in the research and decided that AWS Lambda is the right choice to power your website or app. You chose wisely as Lambda offers a number of benefits that make it an attractive option for many businesses. Before you deploy though, there are a couple more decisions: how you connect your front-end to your back-end and where you store all of your data. Since Lambda functions are all stateless, your code can access stateful data via other web services — Amazon S3 and DynamoDB among others. Those stateless functions enable Lambda to rapidly scale as needed. It launches copies of the function that match the rate of incoming events. So, how do you get started? Step 1: Connect Your Front End To Your Back End If your needs include any of the following: Authorization and authentication for your API Request validation before the integration request Rate throttling for better throughput SDK (software development kit) generation Running multiple API versions simultaneously Flexible security controls with Lambda authorizer Restful API endpoints to that respond in the expected language target Real-time two-way communication applications with WebSocket APIs Then API Gateway is for you. What is API Gateway? API Gateway is the catalyst for routing calls from clients to their appropriate microservices. It also allows any two applications to communicate without interruption. Create, publish, monitor, maintain, and secure REST APIs and web services at any scale with serverless API Gateway. Compelling customer service, communicating with partners and suppliers, and connecting internal applications are all among API Gateway’s top features and benefits. Its core mission is facilitating API requests. Thus, it helps enterprises increase revenue, improve developer productivity, and reduce the risk of downtime or slow performance. Where serverless API Gateway particularly comes in handy is by allowing users to maintain a single API domain with multiple end-point versions, instead of supporting a cluster of interface systems. The Serverless API Gateway Alternative: Application Load Balancer If you don’t need all the features that API Gateway offers, a viable substitute to connect your front end user experience to your backend business logic is AWS Lambda via application Load Balancer (ALB) routing. ALB is not only a viable alternative; it’s a much less expensive one as well. Something to keep in mind is that you’re not locked into one choice. Starting out, if you find that ALB is a better fit for you, you can always start out using that and switch to API Gateway as your business needs scale over time. Just because you don’t have the above needs today, doesn’t mean that will always be the case. In fact, you’re almost certain to need additional functionality as you grow. Serverless API Gateway Pricing Once you’ve decided API Gateway is for you, you’ll pay $3.50 per one million API requests for the first 333 million requests each month. Confused? Don’t worry, you’re not alone. Pay-as-you-go pricing structures are often very complex and misleading. It’s easy to look at that pricing equation and think that $3.50 is cheap. However, if you have an API that averages 450 requests per second, that’s pushing 39 million requests every day. In turn, that comes out to $136 per day, or over $4,000 a month, for API Gateway — a fairly daunting amount if you’re not expecting it. This type of pricing led AWS to announce at the 2018 “re:Invent” conference that ALB would also support routing requests to Lambda functions. Notably, ALBs are priced out by the hour and usually cost $15-$20 per month on an hourly rate, depending on the specifications, stream, and nature of the requests. Diving deeper into the cost of ALB, we can look at Load Balancer Cost Units (LCUs). These complex set of structures take into account the number of new and active connections each second, as well as the bytes processed by the ALB, and the number of routing rules it needs to evaluate. Figure out what your application workload is before determining which is right for you. Generally, if you just need Lambda routing, ALB is about eight times less than serverless API Gateway. API Gateway Final Thoughts Choosing between API Gateway and ALB ultimately comes down to what specific needs your company has and how much you’re willing to pay to address those needs. A more robust solution only works when the log of requests calls for it. In other words, don’t bring a power drill to your application if all you need is a small screwdriver. Evaluate your choices and make the right one for you. To continue reading about how to navigate the world of serverless, check out our guide There’s More To Serverless Than AWS Lambda. Image Source: Denys Nevozhai on Unsplash Tags Cloud & DevOpsCloud Native Share Share on Facebook Share on LinkedIn Share on Twitter Guide To Going Serverless You’ve decided AWS Lambda is the right choice to power your website or app. So, how do you get started? Download Share Share on Facebook Share on LinkedIn Share on Twitter Sign up for our monthly newsletter. Sign up for our monthly newsletter.