<?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 Sylvain Perron on Medium]]></title>
        <description><![CDATA[Stories by Sylvain Perron on Medium]]></description>
        <link>https://medium.com/@slvn?source=rss-31a603e136a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eSE8glv6UKJM2_o7392kVQ.png</url>
            <title>Stories by Sylvain Perron on Medium</title>
            <link>https://medium.com/@slvn?source=rss-31a603e136a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 07:17:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@slvn/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[Superbowl-scalable Backend]]></title>
            <link>https://medium.com/@slvn/superbowl-scalable-backend-478e3ddc311b?source=rss-31a603e136a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/478e3ddc311b</guid>
            <dc:creator><![CDATA[Sylvain Perron]]></dc:creator>
            <pubDate>Tue, 03 Feb 2015 17:58:08 GMT</pubDate>
            <atom:updated>2015-02-03T19:32:03.518Z</atom:updated>
            <content:encoded><![CDATA[<h3>Is AWS Lambda ready for the Superbowl?</h3><p>Two days ago was the great Superbowl XLIX. <a href="https://medium.com/@slvn/scalability-is-getting-easy-797ecc5d77a">In my last article</a>, our team made a reference to Coke not being able to scale appropriately during the 2013 Superbowl, mentioning that AWS Lambda might be the answer for that kind of scalability need. We felt like it was a great opportunity to put it to the test and see if we could create a Superbowl-scalable backend with AWS Lambda.</p><p>We wanted to simulate a realistic, highly stressed production environment. A scenario similar to what Coke and <a href="http://www.yottaa.com/blog/bid/265815/Coke-SodaStream-the-13-Websites-That-Crashed-During-Super-Bowl-2013">the 12 other companies</a> experienced when they crashed. Of course, we didn’t plan on spending millions of dollars in TV commercials to generate traffic. Instead, we decided to turn ourselves to the online community, aka Twitter. Last year, there have been over 24M tweets during the entire Superbowl event, enough traffic to stress almost any production environment.</p><p>Our initial plan was to trigger a Lambda function every time there was a new tweet related to the Superbowl. Since AWS Lambda is still in preview, there’s a limit of <a href="http://docs.aws.amazon.com/lambda/latest/dg/limits.html">25 concurrent requests</a> per account. So, we went ahead and asked Amazon to raise that limit to 8500 concurrent requests per second during the time of the Superbowl. They politely declined the request and said we should try EC2 instead. How is one supposed to ever use it if <strong>we are not guaranteed that it will scale</strong>? At the moment, AWS Lambda is only good if you plan to have less than a few dozen functions running concurrently. If you need more scalability, you must ask Amazon to unlock more concurrent requests. That means you either need really good persuasion skills or be an old AWS paying customer.</p><p>That being said, we were not aware of that concurrency limit before we coded our function. Even though our request failed, we thought that something could still be done. We might not be able to prove that we can scale with Lambda but that doesn’t mean we can’t play with it at a much smaller scale during the Superbowl. We decided to batch the tweets by either 5 seconds or 5000 tweets as they come with the help of a reactive stream. The batching significantly reduced the number of requests to Lambda, thus making the demo unimpressive / insignificant. So we decided to add a little coolness to the thing and make it analyze the batches of tweets for specific keywords related to a touchdown. Every time a keyword was spotted in at least 20% of the tweets in a particular batch, the function would return such keyword. Then, all we had to do was to setup a simple <a href="http://aws.amazon.com/sns/">Amazon SNS</a> to receive SMS notification on these events.</p><p>We ran it the day before the event, on Saturday. Everything was working fine; we could handle a dozen of tweets per second. The next day however, about 3 hours before the superbowl started, we noticed that it stopped working. We looked at the <a href="http://aws.amazon.com/cloudwatch/">Lambda CloudWatch</a> logs… nothing. We were using our <a href="https://github.com/mentum/lambdaws">Lambdaws</a> library to invoke the functions, so we thought there must have been an issue with the library or something. But there wasn’t. When we launched the function with Lambdaws, we received a success message coming back from AWS and then, nothing. No error message or hint that something might have failed.</p><p>After one hour of head scratching, we finally found what we thought was the issue: we were sending Lambda <a href="http://docs.aws.amazon.com/lambda/latest/dg/limits.html">too much data in arguments</a> (i.e. many tweets). The other theory is that the tweets contained some unsupported characters and that Lambda doesn’t check the parameters before sending us a success response. The Superbowl was now 2 hours away and we needed to pivot fast. We uploaded the tweets to S3 and passed the lambda function the S3 object key instead of passing them directly to Lambda. No more weird characters and extra long serialized arrays of tweets. Bingo, that worked!</p><p>The code ran flawlessly during the Superbowl. We received notifications every time there was a touchdown. The chart below shows the number of tweets per minute we captured and analyzed by Lambda. Notice the spikes at every touchdown and at the end of the game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*XsXKC_Sck6hpcocLwpsM1g.png" /><figcaption>Tweets per minute, time in GMT-5</figcaption></figure><p>To conclude, we are pretty disappointed to see that we can’t really rely on Lambda to build a massively scalable application at the moment. While it is good for processing a small number of events (lasting less than 60 seconds), it won’t work for thousands of executions per second. I think it is only a matter of time before the AWS team raises the limit of concurrent requests, but I doubt they will allow running thousands in the near future — at least for little players like us. Big companies such as Coke probably won’t have any trouble convincing Amazon they are worth reserving a few hundred instances.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=478e3ddc311b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scalability is getting easy]]></title>
            <link>https://medium.com/@slvn/scalability-is-getting-easy-797ecc5d77a?source=rss-31a603e136a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/797ecc5d77a</guid>
            <dc:creator><![CDATA[Sylvain Perron]]></dc:creator>
            <pubDate>Wed, 17 Dec 2014 17:35:35 GMT</pubDate>
            <atom:updated>2014-12-17T17:35:35.103Z</atom:updated>
            <content:encoded><![CDATA[<h4>A quick jump into the future of cloud computing</h4><h3>AWS Lambda</h3><p>For those who don’t yet know, <a href="http://aws.amazon.com/lambda/">AWS Lambda</a> is a very promising service that Amazon announced at their latest <a href="https://reinvent.awsevents.com/">re:Invent conference</a>. The service allows you to run custom code in response to events. The typical example they use to showcase the service is a thumbnail creator running every time there is a new image dropped into a S3 bucket. This is brilliant! Think about it for a second. You don’t need to manage infrastructure anymore or worry about software updates and security patches. What about scalability and availability? Amazon handles it all for you, running your code on as many machines as required.</p><h3>When auto-scaling isn’t enough</h3><p>Today’s auto-scaling technology is a good progress toward responding to increasing user requests, yet they are still insufficient. Remember the 2013 Super Bowl <a href="http://www.yottaa.com/blog/bid/265815/Coke-SodaStream-the-13-Websites-That-Crashed-During-Super-Bowl-2013">massive website outage</a>? Most auto-scaling technologies have a common shortcoming: in order to boot new instances, you first have to collect analytics and reach a threshold of unacceptable response time. Then, your saviour instances will start booting. Few minutes later (and probably too late), those new instances will be ready to respond to requests. In other words, you must either predict the requests spike or suffer a few minutes down time.</p><p>What does it have to do with AWS Lambda? Well, imagine if your web application faced a similar problem. You might have one or many servers running your app and some clients using it, but you can’t predict when they’ll actually log on and run calculations. And when they do, you need to respond <strong>now</strong>. You don’t have the luxury of time to spin up a new instance; your SLA wouldn’t be respected nor will your users be happy. On the other hand, you can’t simply have many permanent instances, as it would cost too much to operate. Wouldn’t it be better if you could just run those heavy computations on the cloud instead? Wouldn’t it be paradise if you had a single server handling all the basic stuff like authentication and logging while executing all the CPU-intensive tasks in AWS Lambda? Of course it would be.</p><p>This isn’t easy to achieve with Lambda alone. Why? Because in order to run your code on Lambda, you need to manually zip your code, upload it to AWS, invoke the function through their SDK, store the result somewhere like on a S3 bucket and poll AWS CloudWatch to know when the function finished executing so your server can get the result back.</p><h3>Introducing Lambdaws</h3><p>This is why my friends and I wrote <a href="https://github.com/mentum/lambdaws">this library</a>, which runs on top of AWS Lambda. With a single line of code you can cloudify any stateless asynchronous function and make it run on Lambda. In fact, one line is a lie— it’s more like a single character:</p><pre>var cloudedFunction = <strong>λ</strong>(yourAsyncFunction);</pre><p>I do not pretend this solves all the scalability problems modern applications face, but I do think this is where the future of cloud computing is heading. Not having to worry about underlying infrastructure is the dream of many developers, including myself.</p><p>Sooner or later, platform-as-a-service will make it trivial to build highly-scalable, high-availability applications. I think giving developers the ability to scale their functions directly is a great step toward this dream.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=797ecc5d77a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>