<?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[Omnicell-Engineering - Medium]]></title>
        <description><![CDATA[Transforming medication management — from hospitals to home worldwide - Medium]]></description>
        <link>https://medium.com/omnicell-engineering?source=rss----32d0e3432232---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Omnicell-Engineering - Medium</title>
            <link>https://medium.com/omnicell-engineering?source=rss----32d0e3432232---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 23:11:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/omnicell-engineering" 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----32d0e3432232---4</link>
            <guid isPermaLink="false">https://medium.com/p/6a6722bd92f8</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Brian Hanolt]]></dc:creator>
            <pubDate>Tue, 30 Apr 2019 19:54:17 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>
        <item>
            <title><![CDATA[Warming up Applications That Use AWS Lambda for Load Testing]]></title>
            <link>https://medium.com/omnicell-engineering/warming-up-applications-that-use-aws-lambda-for-load-testing-5e04d7301dbf?source=rss----32d0e3432232---4</link>
            <guid isPermaLink="false">https://medium.com/p/5e04d7301dbf</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[cold-start]]></category>
            <dc:creator><![CDATA[Eyob Beshah]]></dc:creator>
            <pubDate>Tue, 19 Feb 2019 17:57:35 GMT</pubDate>
            <atom:updated>2019-02-19T17:57:34.089Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HiLYaS_rJE3MqOOx" /><figcaption>Photo by <a href="https://unsplash.com/@thomholmes?utm_source=medium&amp;utm_medium=referral">Thom Holmes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Are your load tests for APIs hosted as AWS lambdas failing? Imagine your team is tasked to run some load tests. The system is expected to respond to any user action within two seconds under different number of concurrent users — 10, 25, 50, 100, 200 and 300. You ran the tests and you see that the results are not so good. Some pages take 20 seconds or more to load and some API calls sometimes run into timeouts. There is a solution. If you use AWS lambds for your APIs and you have such issue, this article could be right for you. Continue reading.</p><p>This article explains what the issue is and how load test goals ca be achieved.</p><p><strong>AWS Lambda</strong></p><p>Don’t get me wrong. Lambdas are great. Using AWS lambdas allows the APIs to be cloud provider agnostic. Lambdas have less infrastructure overhead from both a cost and maintenance perspective. Additionally, we only pay based on compute and not uptime. This allows for costs to scale with usage of the application.</p><p><strong>Cold starts failed us</strong></p><p>In line with its pricing model, when there is no usage, lambdas shut themselves down. The first request causes an instance of the lambda to be started up and this takes about 10 seconds. That is not it though. When there are many concurrent requests, more instances need to be created to handle all the requests. As demonstrated by Yan <a href="https://hackernoon.com/im-afraid-you-re-thinking-about-aws-lambda-cold-starts-all-wrong-7d907f278a4f">here</a>, every time a new instance is started up there is a delay. This delay is referred to as cold start. The test report below shows spikes that represent delays caused by cold start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*XmXQpfTw5FsVN7NT_h1R7Q.png" /><figcaption>Load test report with spikes showing cold start.</figcaption></figure><p>Your test environment is normally idle and it’s expected that no instance is running. At this point when load test is run, the APIs run into several cold starts, causing delays of about ten seconds on each affected request. This causes the load tests to fail. Had it not been spotted, this could have severely affected outlook of the system.</p><p><strong>OK, how do we fix it?</strong></p><p>Now, that we know what the problem is, how do we fix it? How do we make sure that no or very small number of requests run into cold starts? We can achieve this by predicting how many concurrent execution will be required and ensuring enough lambda instances are started up ahead of time. Below is a high level design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*wGgkwh4JZ3XuxxuJzdbcZw.png" /></figure><p><strong>Runner</strong></p><p>Runner is the core piece that sends the required number of requests to the lambdas to keep them warm. Requests should be sent in parallel to create concurrent executions. We use a script written in python to send these requests. Let’s look at the code</p><p>Import the following modules:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9ec26a70a58238c2fe6be50b48e7de7/href">https://medium.com/media/b9ec26a70a58238c2fe6be50b48e7de7/href</a></iframe><p>Expect the following arguments to be passed and validate them:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/49e88a5a37e51392e2b84c1c21079d70/href">https://medium.com/media/49e88a5a37e51392e2b84c1c21079d70/href</a></iframe><p>Then we create several threads, based on arguments, and make separate API calls on each thread:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/42a099ce1fee25013e5887942601d844/href">https://medium.com/media/42a099ce1fee25013e5887942601d844/href</a></iframe><p><strong>Crontab</strong></p><p>Depending on <a href="https://read.acloud.guru/how-long-does-aws-lambda-keep-your-idle-functions-around-before-a-cold-start-bf715d3b810">various conditions</a>, lambdas sleep after 10–60 minutes of idle time. Therefore, we need to execute the warm up script every few minutes. For this purpose, any job scheduling tool can be used. In this case, we will configure crontab to execute the warm up script every 10 minutes specifying the parameters/arguments required by the warm up script (like API URL, number of requests).</p><pre><strong>*/10 * * * * sh ~/warmup.sh 40 &gt;&gt; ~/warmup.log</strong></pre><p>Crontab can also be configured to trigger varying values for number of requests through out a day to support various load requirements of the system. For example, if system load at night is low, sending few number of concurrent requests will be enough. But for peak hours, crontab can be configured to send more requests.</p><pre><strong># 11 AM - 2PM<br>*/10 11-14 * * * sh ~/warmup.sh 40 &gt;&gt; ~/warmup.log</strong></pre><pre><strong># 7AM - 10AM and 3PM-7PM<br>*/10 7-10,15-19 * * * sh ~/warmup.sh 15 &gt;&gt; ~/warmup.log</strong></pre><pre><strong>#8PM - 6AM<br>*/10 0-6,20-23 * * * sh ~/warmup.sh 5 &gt;&gt; ~/warmup.log</strong></pre><p><strong>The result</strong></p><p>After letting the crontab job run the first round of wake script execution, run your load test several times. You can expect to see a much more improved result. Notice that there are no spikes this time which means that there are no cold starts encountered by the load test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*tvMIvbVPieUrtDYYoC_kDQ.png" /><figcaption>Load test result, with warmed up lambdas.</figcaption></figure><p><strong>Don’t blame everything on cold starts</strong></p><p>Yes, cold starts are to be blamed for slow API calls in some scenarios but not all. There are several other reasons that can potentially slow down APIs and fail load tests. Let’s look at a few:</p><ol><li><strong>Database related<br></strong>If your database has resource limitation (CPU, hard disk i/o speed,…) or your database needs tuning like creating or rebuilding indexes or partitions, monitoring your database performance indicators will help narrow down the issue. If specific API is encountering the delay, take a look at the query that is executed to see if it can be improved.</li><li><strong>Slow client<br></strong>You may also be running the test from a slow computer, slow network or the client application might be taking too long to render the page. In this case enabling AWS X-Ray might help prove that API is operating in a timely fashion.</li></ol><p><strong>Conclusion</strong></p><p>As demonstrated by this article, the effect of cold start when running load tests on web APIs deployed on AWS lambda can be minimized by ensuring that the lambda is warmed up before test starts. And this can be achieved by sending scheduled parallel requests to the web API. The same approach of warming up lambdas can be used on production environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e04d7301dbf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/omnicell-engineering/warming-up-applications-that-use-aws-lambda-for-load-testing-5e04d7301dbf">Warming up Applications That Use AWS Lambda for Load Testing</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>
        <item>
            <title><![CDATA[Generating An Enterprise Application Template with the Angular CLI and Schematics]]></title>
            <link>https://medium.com/omnicell-engineering/generating-an-enterprise-application-template-with-the-angular-cli-and-schematics-e59b26b6d828?source=rss----32d0e3432232---4</link>
            <guid isPermaLink="false">https://medium.com/p/e59b26b6d828</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[schematics]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Erich Schutz]]></dc:creator>
            <pubDate>Tue, 05 Feb 2019 19:05:08 GMT</pubDate>
            <atom:updated>2019-02-05T19:05:08.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hehAyv0-DjAWiPCi" /><figcaption>Photo by <a href="https://unsplash.com/@sxoxm?utm_source=medium&amp;utm_medium=referral">Sven Mieke</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This blog post is part of an article series.</p><p><strong>Part 1</strong>: Setting up an enterprise project template.</p><p><strong>Part 2</strong>: Adding common enterprise functionality.</p><p><strong>Part 3</strong>: Distributing the enterprise project template with Artifactory.</p><p>This article assumes some familiarity with Angular Schematics. Here are some good resources to get up to speed.</p><p><a href="https://blog.angular.io/schematics-an-introduction-dc1dfbc2a2b2"><em>Getting started schematics blog post by Hans</em></a></p><p><a href="https://brianflove.com/2018/12/11/angular-schematics-tutorial/"><em>Brian Love’s Angular Schematics Tutorial</em></a></p><p><a href="https://leanpub.com/angular-schematics"><em>Schematics by Manfred Steyer</em></a></p><p><strong>Goal</strong></p><p>To demonstrate how to write an enterprise application template from scratch, Over a series of posts, we are going to build a project template that include some default project layout and enterprise functionality using Angular Schematics.</p><p><strong>Getting Started</strong></p><p>Before creating a schematic generator it is a good idea to have an existing solution that contains the code you want to generate in all variations. For this post we want to start building our enterprise project template with some common modules we would expect would be needed when starting a typical Angular application. Below is an image of what we will be building towards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*CjuMxo_BbZ_HHtmU9w0KsQ.png" /></figure><p>To start our enterprise project template we are going to create a schematic to generate this project template. We’ll add to this base project template over the course of the next few posts.</p><p>Our first step in building our enterprise template we want to install the schematics CLI via npm.</p><pre>$ npm install -g @angular-devkit/schematics-cli</pre><p>Now that we have the schematics CLI installed, lets generate our enterprise project schematics via:</p><pre>$ schematics blank --name=project-template</pre><p>This command is used to either create a new project or add a blank schematic to an existing project. In this case we are creating a new project.</p><p>The next steps are to $ cd into the project-template folder you just created and $ npm install then open the project in you IDE, i.e. code .</p><pre>$ cd project-template<br>$ npm install<br>$ code .</pre><p>Our first step in creating our schematic is to update the collection.json file. The collection.json file is the schematic’s definition.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8de079591cb6b8ef4d847b0454be73ab/href">https://medium.com/media/8de079591cb6b8ef4d847b0454be73ab/href</a></iframe><p>The next step is to add our schema.json file to the schematic in the src folder add schema.json. The schema.json file is the schematic variable definition.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/32711f088c6cdaf4184251ffb3bd4662/href">https://medium.com/media/32711f088c6cdaf4184251ffb3bd4662/href</a></iframe><p>Once we have our schema in place, let’s add the files we went to copy over when we start a new application. In the src/project-template folder add a files folder. The files we add here will be the template files to replicate. Next we’ll add the Angular modules core, shared and static and a new app.module.ts file that imports the core module. Your project should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*GCO7J44B3u9zntmuotfc7A.png" /></figure><p>Next we will update the index.ts file. The index.ts contains the actual schematic code. This is the logic that will execute adding our enterprise template files to a new project. Before we do this, let add a utils folder to src/utils to hold a few utility items we’ll need. Lets now add a schema.d.ts file in the utils . The schema.d.ts will hold our schematic variables.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d103498032817c20efd0e2628cc2eb30/href">https://medium.com/media/d103498032817c20efd0e2628cc2eb30/href</a></iframe><p>Next we’ll need to install the core Angular schematics. We are going to use this to get our current work space.</p><pre>$npm install @schematics/angular</pre><p>And finally our index.ts file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5e7b78232e79cd90fb110a3c85d4efd/href">https://medium.com/media/d5e7b78232e79cd90fb110a3c85d4efd/href</a></iframe><p>Our rule is pretty simple as this point. We are deleting the default app.module.ts and replacing it with the one we added to our /files folder and we are copying over the modules we added to our /files folder and that’s about it. We’ll add more to this in the next post, but this is a good starting point. Its now time to build our schematic. $ cd into the project-template folder and run</p><pre>$ npm run build</pre><p>With our project now built, it’s time to test it out and link it to a new project. We’ll start by creating a new Angular project:</p><pre>$ ng new my-project</pre><p>Once the CLI is complete setting up the project, let’s link our new schematic to test it out. First $ cd into the new my-project and run</p><pre>$ npm link $PATH_TO_PROJECT_TEMPLATE_SCHEMATIC</pre><p>With our new schematic linked, lets generate our enterprise project template</p><pre>$ ng g project-template:project-template</pre><p>After this completes we should see our new project updated with the core, shared and static modules we added to our schematic along with our app.module.ts update to include our new core module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gERcG3KfyojbJnrS9u92AA.gif" /></figure><p>That’s it, we just applied the first step in building our enterprise project template. In the next post, we’ll update this process a bit and add some common enterprise functionality that we will want to include in all our future applications.</p><p>Schematic on <a href="https://github.com/Steeze/project-template">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e59b26b6d828" width="1" height="1" alt=""><hr><p><a href="https://medium.com/omnicell-engineering/generating-an-enterprise-application-template-with-the-angular-cli-and-schematics-e59b26b6d828">Generating An Enterprise Application Template with the Angular CLI and Schematics</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>