<?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[StaticGarden - Medium]]></title>
        <description><![CDATA[Random thoughts from building and running StaticGarden - Medium]]></description>
        <link>https://medium.com/staticgarden?source=rss----312c16946f98---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>StaticGarden - Medium</title>
            <link>https://medium.com/staticgarden?source=rss----312c16946f98---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 14:22:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/staticgarden" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to architect your services to use AWS ECS using Spot Instances]]></title>
            <link>https://medium.com/staticgarden/how-to-architect-your-services-to-use-aws-ecs-using-spot-instances-59823473a714?source=rss----312c16946f98---4</link>
            <guid isPermaLink="false">https://medium.com/p/59823473a714</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[sqs]]></category>
            <dc:creator><![CDATA[Khaja Minhajuddin]]></dc:creator>
            <pubDate>Sun, 17 Jun 2018 10:22:01 GMT</pubDate>
            <atom:updated>2018-06-17T10:25:32.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KIlb3WMimN90vNvQ" /><figcaption>“Macro of sound equipment mixing board with equalizers, knobs, and buttons” by <a href="https://unsplash.com/@chuttersnap?utm_source=medium&amp;utm_medium=referral">chuttersnap</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Alright, I’ve a bunch of side projects which make decent money. However, till recently I’ve been setting up products using a virtual server (on AWS or DO or Linode) and by creating one user account per service all sitting behind an Nginx reverse proxy. This has been working fine most of the time, However this kind of setup is a bit time consuming and you are screwed if your server goes boom! I’ve been researching a few deployment strategies and different architectures to build a few of my new services. I think I’ve found the right combination using AWS Lambda, SQS, DynamoDB and ECS using a cluster of spot instances.</p><p>Most of you may know that AWS allows you to use spot instances which are instances available at a highly reduced price ranging from 10% to 30% of the original cost. If this seems too good to be true there is of course a catch: Spot instances can be terminated any time. There is a notification service which allows you to be notified of these terminations 2 minutes in advance (which is not enough for a typical service). So, how do we use spot instances without bringing down our services? We don’t want our services to go down when our spot instances are terminated!</p><p>To use spot instances we need to use a different architecture, The way that I<br>am designing my services is in the following</p><pre>Static site hosted on S3 and distributed by cloudfront</pre><pre>AWS Lambda<br>(this handles the form endpoints for the dynamic stuff)<br>My lambdas usually push events to an SQS queue so that they are fast</pre><pre>ECS Cluster (using Spot instances)<br>Now this cluster hosts the core of the service, which picks up things from our<br>SQS queue and processes them. If a spot instance goes down AWS will bring another<br>back in a different availability zone (if the price of this type of instance is<br>lower in that availability zone). And if a task is not completed our new Spot<br>instance will pick up tasks from our queue and starts processing them.</pre><p>So, to explain the above a little more, the frontend comprises of a static site and AWS Lambda which are always on all the time and whenever a user does something the action gets saved in an SQS queue via a Lambda. Once this is done our ECS cluster (which uses spot instance) takes over and finishes the job. This removes the need for your worker instances to be on all the time, they can now be terminated with gay abandon without impacting your core service.</p><p>I’ll do a more detailed post using the example of our new HTTP to Email service.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59823473a714" width="1" height="1" alt=""><hr><p><a href="https://medium.com/staticgarden/how-to-architect-your-services-to-use-aws-ecs-using-spot-instances-59823473a714">How to architect your services to use AWS ECS using Spot Instances</a> was originally published in <a href="https://medium.com/staticgarden">StaticGarden</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>