<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Brian Hanolt on Medium]]></title>
        <description><![CDATA[Stories by Brian Hanolt on Medium]]></description>
        <link>https://medium.com/@brianhanolt?source=rss-5def00b9aebe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EOS34bgw6nRcyAbYIScATw.jpeg</url>
            <title>Stories by Brian Hanolt on Medium</title>
            <link>https://medium.com/@brianhanolt?source=rss-5def00b9aebe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 23:34:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brianhanolt/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Microservices in AWS Lambda]]></title>
            <link>https://medium.com/omnicell-engineering/microservices-in-aws-lambda-6a6722bd92f8?source=rss-5def00b9aebe------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a6722bd92f8</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Brian Hanolt]]></dc:creator>
            <pubDate>Mon, 08 Apr 2019 22:09:49 GMT</pubDate>
            <atom:updated>2019-04-08T22:09:49.204Z</atom:updated>
            <content:encoded><![CDATA[<p>The Good, the Bad and the Ugly</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwVSLppgr5nI3JmLUnO4OQ.png" /></figure><p>When we began to look into AWS service options to host our microservice platform, we were looking for a relatively inexpensive, rapid way to prototype a new web application. One of the traits of a strong agile environment is the ability to prototype a product quickly with the knowledge that if that product is successful, the business can support investment for a full rewrite. This gives us the opportunity to pivot as well as learn from our mistakes. With the sheer number of AWS offerings as well as the constantly evolving ecosystem, we are guaranteed to make some missteps.</p><h3>The Good</h3><p>AWS Lambda is a PAAS compute offering, which AWS describes as “letting you run code without provisioning or managing servers. You pay only for the compute time you consume — there is no charge when your code is not running. Just upload your code and Lambda takes care of everything required to run and scale your code with high availability.” This is the primary benefit of Lambda. It is your lowest cost option for compute and is simple to configure and deploy. With a little guidance, you can have an application service ready for consumption in a matter of hours.</p><p>As a Microsoft shop, another huge advantage that was introduced with AWS Lambda was the ability to host a standard .NET Core WebAPI. This allowed developers to keep using familiar tooling like Visual Studio and the existing CI pipeline and helped minimize any disruption to their day to day development workflow. Because AWS uses API Gateway and Lambda to replace the standard Nginx and Kestrel server, requests are marshalled to your WebAPI in the exact same manner with the addition of only a couple of lines of code as depicted below. This would also allow you to easily transition to another hosting option like Docker containers at a later time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*5tlL8XKn80Wor1fK6kyoSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*uiTNlaFSyr_DHo1Ed3u4EQ.png" /></figure><p>Lastly, the inclusion of API Gateway offers a simple solution to include authentication checks in your request pipeline. You can use AWS Cognito or setup your own Lambda to act as the authorizer. This allows you to be sure that authorization is handled consistently for all requests across microservices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*1T_sEmhAafGOj4AYEm9Qew.png" /></figure><h3>The Bad</h3><p>With a little research, you will undoubtedly find some mention of cold starts. This refers to the delay experienced in the request pipeline as AWS creates a container to execute your function. This is somewhat to be expected as a tradeoff for avoiding the cost of a dedicated server. You can read more about how we handled this problem <a href="https://medium.com/omnicell-engineering/warming-up-applications-that-use-aws-lambda-for-load-testing-5e04d7301dbf">here</a>. Unless you require a very low level of latency, your application can still deliver an acceptable user experience in these scenarios.</p><p>With the simplicity of Lambda, you do sacrifice flexibility in configuration. For example, you can adjust the amount of memory, which will increase CPU, but you cannot tune these independently. You cannot configure persistent storage as all disk is ephemeral, but this has the benefit of guaranteeing stateless services. Lastly, you do not have OS level control, so you will have to wait for AWS to officially support the newest releases of .NET Core. None of these are necessarily negatives but tradeoffs that need to factor into your decision when you are evaluating your use case.</p><h3>The Ugly</h3><p>When creating your cloud architecture, it seems that Amazon Relational Database Service (RDS) is a natural choice to use for persistent storage, but you should beware. There are a couple of AWS services that still require Lambda be deployed into a VPC, and RDS is one of those services. In order for Lambda to be able to establish a connection to your database hosted in RDS, you will need to provide Lambda with an IAM role that has the <em>AWSLambdaVPCAccessExecutionRole</em> permission. There are <a href="https://docs.aws.amazon.com/lambda/latest/dg/vpc.html">AWS tutorials</a> to step through this configuration process. What is not readily advertised is that this will guarantee cold start times of a minimum of 10 seconds. Imagine a user waiting 10 seconds for your UI to load! The culprit is elastic network interfaces (ENIs). When Lambda cold starts and needs to create a new container, a new ENI also needs to be deployed in order for the function to communicate to the RDS instance within the VPC. This process assigns the Lambda a private IP address within the accepted range of your subnet to allow the connection. As mentioned in the other blog post, you can alleviate the cold start symptoms by keeping a number of containers awake. In the long run this is difficult to maintain as a viable solution. One it requires you to be able to accurately predict your site traffic to ensure you try to keep a minimum number of containers awake and there is no guarantee of success as the manner in which AWS does this can be unpredictable resulting in unexpected cold starts. Two as your traffic grows even a small percentage of cold starts can result in enough impacted users to affect the bottom line. Imagine if Amazon lost 1% of their sales because users left the website after waiting 9 seconds for their cart to load. This is the black sheep of the family that will want to make you burn your platform to the ground later if you are not aware it is there from the start.</p><h3>Conclusion</h3><p>AWS Lambda is still a great option to host your microservices in the cloud as long as you are aware of the tradeoffs. Lambda is a significantly cheaper option to prototype a new application as you grow your user base and have limited sporadic traffic. If you are hosting APIs for third-party integration that are not impacted by latency, RDS is still a viable choice. If you are hosting a user facing application, you need to consider alternative options for data storage. Unfortunately, ElastiCache is one of the other remaining services requiring the VPC execution role. It appears that one of the few options is to use AWS DynamoDB. There have been reports that AWS is working on a solution, but I would not expect to see anything soon while they can push developers towards their in-house DynamoDB option.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a6722bd92f8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/omnicell-engineering/microservices-in-aws-lambda-6a6722bd92f8">Microservices in AWS Lambda</a> was originally published in <a href="https://medium.com/omnicell-engineering">Omnicell-Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>