<?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 Sahana Bhat on Medium]]></title>
        <description><![CDATA[Stories by Sahana Bhat on Medium]]></description>
        <link>https://medium.com/@sahanabhat_92690?source=rss-20014cdb2b1d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*P2Hr4vOI_gCARg6--uZYRA.jpeg</url>
            <title>Stories by Sahana Bhat on Medium</title>
            <link>https://medium.com/@sahanabhat_92690?source=rss-20014cdb2b1d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 13:05:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sahanabhat_92690/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[Serverless flows with Step Functions]]></title>
            <link>https://medium.com/practo-engineering/serverless-flows-with-step-functions-bac062f8c625?source=rss-20014cdb2b1d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bac062f8c625</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws-step-functions]]></category>
            <category><![CDATA[lambda-function]]></category>
            <dc:creator><![CDATA[Sahana Bhat]]></dc:creator>
            <pubDate>Tue, 09 Apr 2019 06:04:28 GMT</pubDate>
            <atom:updated>2019-04-22T11:09:47.342Z</atom:updated>
            <content:encoded><![CDATA[<p>Serverless paradigm is taking Iaas (Infrastructure as a Service) to the next level in the form of Faas (Function as a Service). Its gaining popularity is because of the many benefits that comes with it, like, cost reduction — because you only pay for the amount of time your code is running, fast deployments and managed autoscaling — because you do not maintain a dedicated server for your application, etc.</p><p>AWS Lambda Functions, Google Cloud Functions, Azure Functions are some of the serverless hosting options provided by the cloud providers. Some CDNs provide this option too, for example, Workers on CloudFlare. The added advantage of hosting your code on CDN is latency reduction, since the user is served by the CDN server closest to the user. That being said, serverless architecture might not be ideal for every use-case of yours. For your long running processes or applications with continuous traffic, cost would increase and so, you are better off spinning off a server to host your process or app.</p><p>In the micro-services and serverless era, if your infrastructure revolves around AWS, Lambda functions are one of the most popular and easiest options to host your micro-services or backend processes . Through Lambda functions, AWS enables you to host your code, without you managing the infrastructure (like an EC2). Lambda functions can be triggered by hooks like API gateway, S3 events or one of the many CloudWatch events available.</p><p>If your use case is solved by a single Lambda function, setting up the entire flow is a piece of cake. If not, your multiple Lambdas will have to be glued together. Let’s look at a hypothetical use case of automating the task of validating the key-pair attached to any new EC2 instance launched in your account and then notifying a concerned person, if it is an outdated/invalid key-pair. For the sake of separation of concerns, let’s have 2 Lambda functions — one to validate the key-pair and the second to notify. How we typically would implement this, is as follows.</p><ol><li>Create a Cloudwatch rule to receive events of EC2 creations.</li><li>Create a Lambda function, let’s call it the-validator, and add it as a trigger to the rule created in Step 1.</li><li>If the key-pair is determined to be invalid, the-validator would push a job to an SQS queue (or an SNS topic or any other trigger for lambda).</li><li>The second Lambda function, let’s call it the-notifier, would be added as a trigger to the SQS/SNS of Step 3 and it would notify whenever there is a new event.</li></ol><p>Though the above setup seems straight forward, the lambda-SQS-lambda pipeline would increase as and when we add more concerns to the flow. Step functions provide a graceful way to glue your lambdas together. Step functions is to lambdas, what conjunctions is to grammar. A Step function constitutes a state machine which holds the definition of how the Lambdas are inter-connected. Below is the state machine which would create a step function to handle the use case discussed above.</p><pre>{<br>  &quot;StartAt&quot;: &quot;the-validator&quot;,<br>  &quot;States&quot;: {<br>    &quot;the-validator&quot;: {<br>      &quot;Type&quot;: &quot;Task&quot;,<br>      &quot;Next&quot;: &quot;the-notifier&quot;,<br>      &quot;Resource&quot;: &quot;arn-of-the-validator-lambda&quot;<br>    },<br>    &quot;the-notifier&quot;: {<br>      &quot;Type&quot;: &quot;Task&quot;,<br>      &quot;End&quot;: true,<br>      &quot;Resource&quot;: &quot;arn-of-the-notifier-lambda&quot;<br>    }<br>}</pre><p>The above state machine and the lambdas are the only resources required to implement the discussed use case. This state machine is added as the trigger to the CloudWatch rule for EC2 creation events, which means, when a new EC2 is created, this state machine is executed. State machines are built to pass on the output of one step to the next. In our case, the output of the-validator would be passed to the-notifier, with no extra configurations to be done.</p><p>The above state machine can be extended to add more states when the concerns increase, eliminating the need to create complex workflows with SQS, SNS or any other glue in picture. Let’s say, a 3rd Lambda is added to our above discussed use case. This new Lambda, let’s call it the-db-handler, would save the invalid key-pair and the EC2 details in persistent storage. Here is our updated state machine.</p><pre>{<br>  &quot;StartAt&quot;: &quot;the-validator&quot;,<br>  &quot;States&quot;: {<br>    &quot;the-validator&quot;: {<br>      &quot;Type&quot;: &quot;Task&quot;,<br>      &quot;Next&quot;: &quot;the-notifier&quot;,<br>      &quot;Resource&quot;: &quot;arn-of-the-validator-lambda&quot;<br>    },<br>    &quot;the-notifier&quot;: {<br>      &quot;Type&quot;: &quot;Task&quot;,<br>      &quot;Next&quot;: &quot;the-db-handler&quot;,<br>      &quot;Resource&quot;: &quot;arn-of-the-notifier-lambda&quot;<br>    },<br>    &quot;the-db-handler&quot;: {<br>      &quot;Type&quot;: &quot;Task&quot;,<br>      &quot;End&quot;: true,<br>      &quot;Resource&quot;: &quot;arn-of-the-db-handler-lambda&quot;<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uqeOcCYydPdLw3PXffMeZg.png" /><figcaption>Ways to glue Lambdas</figcaption></figure><p>The new Lambda and addition of the state to the state machine are the only changes required to update the flow making it very straightforward to add more functionality to your system. the-notifier, which was the end state of the state machine earlier, now specifies that the-db-handler is the next state and the-db-handler is the new end state.</p><p>Creating a workflow for your lambdas is one of the basic use cases of step functions. It also has a lot more useful features like conditional states, wait states, parallel states execution, etc. Though step functions isn’t a technical marvel, it does make the serverless experience better and is worth a try for your serverless workflows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bac062f8c625" width="1" height="1" alt=""><hr><p><a href="https://medium.com/practo-engineering/serverless-flows-with-step-functions-bac062f8c625">Serverless flows with Step Functions</a> was originally published in <a href="https://medium.com/practo-engineering">Practo Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimisation wins with CloudFlare]]></title>
            <link>https://medium.com/practo-engineering/optimisation-wins-with-cloudflare-33243447c738?source=rss-20014cdb2b1d------2</link>
            <guid isPermaLink="false">https://medium.com/p/33243447c738</guid>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[latency]]></category>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[cdn]]></category>
            <dc:creator><![CDATA[Sahana Bhat]]></dc:creator>
            <pubDate>Tue, 13 Feb 2018 13:47:17 GMT</pubDate>
            <atom:updated>2018-09-05T14:30:37.356Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s fast paced world, speed beats everything else, especially when it comes to the Internet. Users expect content to be accessible over the Internet in a flash. If you are someone who has ever hosted a website which caters to users across geographic locations and/or wants the best possible end user response times, chances of you having used a Content Delivery Network are high.</p><p>At Practo, we take end user experience very seriously and so, CDN has been an important part of our system. We recently migrated our services to use CloudFlare as the CDN. For the curious, <a href="https://medium.com/practo-engineering/cdn-change-and-its-effects-on-googlebots-behaviour-990b5ac880a7">here</a> is the blog that explains the reasons and the after effects of the migration. This blog will focus on some key features of CloudFlare that helped us achieve superior user experience.</p><p>Soon after migrating our services to CloudFlare, we saw high latency in requests made from locations which were far away from our origin servers, in other words, requests from a different continent. While exploring options to counter this issue, we came across a CloudFlare offering called <a href="https://www.cloudflare.com/website-optimization/railgun/">Railgun</a>. Railgun server has two main responsibilities. First, it maintains persistent TCP connections with CloudFlare datacenter servers so that the overhead of establishing a new TCP connection for every request is eliminated, thereby reducing the overall latency of requests. Secondly, compressed response content is cached in memory and only the changes in content in the consequent requests are transmitted over the internet.</p><p>Here are some fun facts of Railgun</p><ul><li>~500ms to 1000ms (depending on the route of the requests) per request is reduced because of the persistent TCP connection (except, of course, in the initial request which establishes the TLS handshake + TCP connection).</li><li>For frequently accessed pages, the delta of the response content can fit into a single TCP packet.</li></ul><p>We waited for a couple of days for the Railgun magic to be quantifiable. However, though this new setup improved response times to some extent, we did not see the improvement we desired. We’ll shortly see why.</p><p>While our Railgun experiments were in progress, just about the same time, CloudFlare announced <a href="https://blog.cloudflare.com/argo/">Argo</a>, a solution for internet route optimisation. Enabling Argo on our domain worked like a charm. Our response times were back to the desired numbers almost immediately.</p><p>Argo is a smart routing algorithm which does real-time analysis of internet routes. The solution detects congestion in networks and routes the requests through congestion free or lesser congested networks. With better routes for requests to travel over the internet, the request latency reduces drastically, in turn improving response time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*4P-uxoRRWMa-nb_9E78ECQ.png" /><figcaption>Initial page load times on various setups (as seen by GoogleBot)</figcaption></figure><p>Thanks to Argo, ~60-70% of our requests find a smart route leading to ~2X improvement in average response times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7SEmtMsrzwLxklRJe6nmxQ.png" /><figcaption>~70% of our requests find a smart route</figcaption></figure><blockquote><em>So, how did Argo help when Railgun couldn’t?</em></blockquote><blockquote>Though Railgun establishes a persistent connection between CloudFlare data centers and origin server, the connection is still established over the open internet. This means that there is every possibility that each request travels through an unoptimised and congested route. And this is where Argo helped — to route the requests through the <strong>fastest route at the current time</strong>.</blockquote><p>Argo has, by far, been our favourite and one of the most useful CloudFlare feature. If you are looking for superior response times for your customers across the globe, Argo is definitely worth a try!</p><blockquote>Follow us on <a href="https://twitter.com/practodev">twitter</a> for regular updates. If you liked this article, please hit the applause icon to recommend it and help other Medium users find it.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33243447c738" width="1" height="1" alt=""><hr><p><a href="https://medium.com/practo-engineering/optimisation-wins-with-cloudflare-33243447c738">Optimisation wins with CloudFlare</a> was originally published in <a href="https://medium.com/practo-engineering">Practo Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CDN change and its effects on GoogleBot’s behaviour]]></title>
            <link>https://medium.com/practo-engineering/cdn-change-and-its-effects-on-googlebots-behaviour-990b5ac880a7?source=rss-20014cdb2b1d------2</link>
            <guid isPermaLink="false">https://medium.com/p/990b5ac880a7</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[cdn]]></category>
            <category><![CDATA[bots]]></category>
            <dc:creator><![CDATA[Sahana Bhat]]></dc:creator>
            <pubDate>Tue, 23 Jan 2018 07:54:59 GMT</pubDate>
            <atom:updated>2018-09-05T14:29:46.713Z</atom:updated>
            <content:encoded><![CDATA[<p>Couple of months ago, we, at Practo, decided to switch the CDN for our website and services from Akamai to CloudFlare. Akamai is one of the largest and most popular content delivery platforms out there. However, we had to move out of it and here’s why.</p><ul><li>Akamai’s configuration update system, Luna Property Manager is a very elaborate and complex system. It is also extremely configurable and gives you enough power to change and modify the behaviour to the maximum possible extent. Because of the same reason, the learning curve and maintenance of these configurations is fairly time consuming. For a startup like ours, investing so much time and efforts into fine tuning the system was too much of an overhead.</li><li>Secondly, the kind of performance boost and security that Akamai provides, doesn’t come at a small price.</li></ul><p>On the other hand, in CloudFlare, the number of things that we could control and configure were far fewer but that was exactly what we wanted. The amount of time that we had to spend managing the setup had reduced drastically. Also, with simple dashboards where configuration changes are click-of-a-button away, simple to understand graphs to monitor the setup and great documentation to help us integrate without any need of professional support, CloudFlare was an obvious choice.</p><p>Other than a few minor hiccups like, inability to activate couple of features at subdomain level, inability to configure url rewrite rules, WAF false positives, etc. the migration proceeded as per the plan. After few days of efforts, we had all our services migrated to CloudFlare. This was followed by a relaxed weekend, since the target was met — or so we thought.</p><p>Very soon, we discovered a drastic drop in GoogleBot’s crawl rate. What followed was an anxious day, hoping our SEO ranking doesn’t get affected by this drop. By the end of the day, we had switched back, our consumer facing crawl-able site, to Akamai to avoid any side effects (Thanks to the Akamai team for saving the day with a service extension).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*nD360QHyrlZesAmBwKYx_g.png" /><figcaption>Monday morning blues!</figcaption></figure><p>The decrease in crawl rate could directly be correlated to increase in time spent in downloading the page. The culprit seemed to be the increased response time, which was a result of increased latency. It was also observed that the response times of the requests served to our users weren’t as bad as it was to GoogleBot. It was obvious that the cause for increased latency was because of our origin servers and GoogleBot servers being in two different continents. Since majority of our end users are in the South and Southeast Asian countries, which is also where our origin servers are hosted, end user response times weren’t affected at all. But why hadn’t we noticed these differences till date? Because of Akamai! Akamai’s routing took care of the latency issue for us. Our next step was to figure out how CloudFlare could solve this for us. Details on our attempts with CloudFlare offerings is a story for another time.</p><p>While we were concentrating on figuring out our latency related issues, a new fact came into picture. GoogleBot’s algorithm had a big role to play in the change in these numbers.</p><p>So, what was the main cause of drop in crawl rate?</p><blockquote>IP address change !!<br>With the CDN change, the IP address had changed.</blockquote><p>Why would a new IP address result in drop in crawl rate?</p><blockquote>Whenever there is a change in the IP address, GoogleBot has to ensure that it doesn’t overwhelm the servers since it is unaware of the capacity of the new system. GoogleBot also takes into account what the hosting provider can sustain. With CloudFlare, we possibly had more neighbours and hence got a lower rate for ourselves. Hence, GoogleBot starts slow and takes time to relearn how much it can crawl. The crawl rate is ramped up, post some experimentation. Phew! That’s one smart spider!</blockquote><p>Summarising the causes of the drop</p><ul><li><em>Change in IP.</em></li><li><em>Change in CDN.</em></li><li><em>Increased latency.</em></li></ul><p>After letting GoogleBot understand the capacity of our “new” system for a couple of days and with a boost of CloudFlare’s offering to reduce latency, we were back to getting millions of our pages crawled by GoogleBot, at rates higher than before!</p><blockquote>Follow us on <a href="https://twitter.com/practodev">twitter</a> for regular updates. If you liked this article, please hit the applause icon to recommend it and help other Medium users find it.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=990b5ac880a7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/practo-engineering/cdn-change-and-its-effects-on-googlebots-behaviour-990b5ac880a7">CDN change and its effects on GoogleBot’s behaviour</a> was originally published in <a href="https://medium.com/practo-engineering">Practo Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>