<?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 Gowtham Sai on Medium]]></title>
        <description><![CDATA[Stories by Gowtham Sai on Medium]]></description>
        <link>https://medium.com/@gowthamsai?source=rss-e5a4b3a9c68e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tqhq29R8DzXnWRb7.</url>
            <title>Stories by Gowtham Sai on Medium</title>
            <link>https://medium.com/@gowthamsai?source=rss-e5a4b3a9c68e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 07:48:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gowthamsai/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[Everything Was Fine Until Kubernetes Said ‘No More CPU’]]></title>
            <link>https://blog.zepto.com/everything-was-fine-until-kubernetes-said-no-more-cpu-3768cda76326?source=rss-e5a4b3a9c68e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3768cda76326</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Gowtham Sai]]></dc:creator>
            <pubDate>Fri, 18 Apr 2025 09:58:34 GMT</pubDate>
            <atom:updated>2025-04-18T10:02:25.959Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WI0CLzufyfl_pDJu" /></figure><p>Earlier this year, we started re-architecting one of our busiest Python services into Go. The goal was simple: faster performance and better scalability.</p><p>We rolled out a new service, rewrote the core logic, containerized it, and deployed it with clean interfaces and modern infra knobs.</p><p>And it worked — beautifully till it didn’t.</p><p>The service started wheezing under load. Latencies spiked, dashboards gaslit us, and the root cause sat quietly in the corner — <strong>CPU throttling</strong>, the sneaky little gremlin we never invited but somehow got production access.</p><h3>The Breakway &amp; The Dip</h3><p>We broke out of a giant Python monolith — she was old, slow, and frankly, tired — and spun up a shiny new service with its own API. Wrote it clean. Go, TDD, good practices, containers, CI/CD, the works.</p><p>And you know what? It worked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IrwkjYz2hGQljSuh1kv7BA.png" /></figure><p>We cut down latencies by <strong>95%</strong> for a few of the most critical APIs. Customers were happy. My team was happy. I was almost tempted to write a celebratory post on how we “<em>modernized our infra at scale.</em>”</p><p>Good thing I didn’t. Because 2 weeks later, the service started wheezing.</p><h3>The More Traffic We Sent, The Sadder It Got</h3><p>Initially, we did a partial traffic cutover. Smooth. Fast. Felt like driving a Tesla after years of cycling uphill.</p><p>Then we moved more traffic.</p><p>And suddenly the service started sweating. Latencies shot up. Requests started timing out. Infra graphs were calm — too calm. Which made it worse. There was no <em>reason</em> for this behaviour.</p><p>So what do engineers do when reality and graphs don’t match?<br>We throw more pods at the problem.</p><h3>More Pods, Still Sad</h3><p>We introduced minReplicas. &quot;Don’t scale down too much,&quot; we said. &quot;Maybe cold starts are hurting us.&quot;</p><p>It helped… a little. But the latency graphs were still looking like a stressed-out ECG monitor.</p><p>So next up: “Must be autoscaling issues.”<br>We checked HPA. It was CPU-based. Classic.</p><p>But here’s the kicker — CPU usage was flat.<br>Not low. Not high. Just… flat.</p><h4>Signals Gone Silent: Nothing Was Scaling, And We Didn’t Know Why</h4><p>Digging into our HPA (Horizontal Pod Autoscaler) config, we realized it was CPU-based. Yet, oddly, the CPU usage graphs were flat. No spike. No saturation. Nothing to tell the autoscaler to wake up.</p><p>At this point, we were frustrated. We bumped the CPU limits and requests just to be safe. Still, nothing meaningful changed.</p><p>The service was struggling, but the metrics said everything was fine. Still a flat CPU. Still no scaling. Still bad latencies.</p><h3>The Autoscaler &amp; The Nuances</h3><p>So at one point, we figured — maybe it’s not about having <em>more</em> pods, maybe it’s <em>when</em> they scale. So we tweaked the HPA to autoscale based on the <strong>container CPU</strong> instead of the <strong>pod CPU</strong>. Thought we were being clever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cW2CNKeUu5sC6bxpay0FDg.png" /></figure><p>Look at this beauty.</p><p>Three pods. Each has two containers — <strong>our app</strong> and a sidekick (<strong>Vault</strong>, or whatever background thing you slapped in there). Now, the app is doing all the heavy lifting — 800m CPU each. The Vault container? Just chilling with 20m.</p><blockquote>If you autoscale based on <strong>pod CPU</strong>, it averages out:<br> <strong>(820 + 820 + 820) / (1200 + 1200 + 1200) = 68%</strong></blockquote><p>HPA looks at that and goes,<br> “68%? Meh. No need to scale yet.”</p><p>Meanwhile, your app is <strong>sweating at 800m out of 1000m = 80%</strong>, and <strong>not scaling</strong>.</p><blockquote>But if you scale based on <strong>just the app container</strong>:<br> <strong>(800 + 800 + 800) / (1000 + 1000 + 1000) = 80%</strong></blockquote><p>Now the HPA actually wakes up and goes, “Oh crap. Let me help.”</p><blockquote>Stop letting your sidecars dilute your CPU signals.<br>Scale based on what matters — your app container, not the pod.</blockquote><p>But even after fixing the autoscaler to track just the app container, things didn’t fully bounce back.</p><p>Sure, the scaling looked a <em>bit</em> better. But the service still felt… sluggish. Especially at the edges.</p><blockquote>Tail latencies were through the roof.</blockquote><blockquote>P99s were misbehaving. P95s looked like they were in a long-distance relationship with the median. And worst of all — users were feeling it.</blockquote><p>That’s when we knew: this wasn’t just a scaling issue anymore. Something deeper was throttling our app’s ability to breathe.</p><h3>And There It Was: Throttling Through The Roof</h3><p>Frustrated, we took a closer look at CPU metrics — not usage, but throttling.</p><p>And there it was. <strong>Boom.<br></strong>The container was getting absolutely hammered by throttling. It wasn’t <em>using</em> more CPU because it wasn’t <em>allowed</em> to.</p><blockquote>Kubernetes was like “I’ll give you 500 millicores. You can ask for more, but I’ll just politely say no and throttle you until you behave.”</blockquote><p>To the HPA, it looked like the app wasn’t stressed. But inside, the Go runtime was fighting over CPU slices like it was Black Friday at a mall.</p><p>You see, the Go runtime is like a chill party host… until you mess with the room size. <em>Goroutines</em>? They’re cheap, lightweight threads. You can spin thousands of them without blinking. <em>But they still need CPU time to actually run</em>. And that’s where GOMAXPROCS comes in—it tells Go how many OS threads it can run in parallel.</p><p>But in Kubernetes, your container doesn’t <em>get</em> the full machine. It gets a slice. A quota. Maybe 1 core. Maybe 500 millicores. But Go doesn’t know that. It still thinks it has the whole buffet.</p><p>So what happens?</p><p>You end up with goroutines competing for CPU that doesn’t exist. The Go scheduler tries its best — it shuffles things around, switches context, queues up work. But it’s fighting a losing battle. It’s chaos.</p><p>So even though the app <strong>looks</strong> idle from the outside, inside it’s a CPU-hungry toddler throwing a tantrum because someone said <em>“no more screen time.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*thaMtFBVdpvG7az2HHc3QQ.png" /></figure><p>You’ve got your Go app, happy and full of goroutines, ready to <em>do work™</em>.<br> Go runtime looks around and goes,</p><p><strong><em>Goruntime:</em></strong> “Cool, I see <strong>4 cores</strong>. Let’s party! I’ll set GOMAXPROCS=4. Spin up schedulers, bring in the goroutines!”</p><p>But here’s the twist: <strong>you’re in a container</strong>, not on bare metal. And Kubernetes says,</p><p><strong><em>Kubernetes:</em></strong> “LOL, nope. You only get <strong>1 core</strong>. That’s all your cpu.limit allows.”</p><p>So now what?</p><p>Go is trying to run 4 OS threads in parallel… on 1 actual core. It’s like inviting 4 DJs to play at the same time using <strong>one speaker</strong>.</p><p>The result?</p><ul><li>Context switching madness.</li><li>Goroutines pile up.</li><li>Latencies spike.</li><li>You’re not even maxing CPU <em>usage</em>, but the app is choking.</li></ul><p>Meanwhile, Kubernetes is watching this chaos, sipping tea, thinking,<br>“Looks fine to me. CPU isn’t maxed out.”</p><p>And you, the poor engineer, are staring at dashboards going:<br>“Why is nothing scaling? Why are users crying?”</p><p>Apparently, “CPU usage” isn’t the same as “CPU not screaming for help; Because Go was never told the <strong>truth</strong> about its limits.</p><h3>Right Sizing. Not Just for Jeans.</h3><p>Once we knew, the fix was straight-forward(ish):</p><p>Gave the container more realistic <strong>CPU requests and limits</strong>. Not the “this should be enough” guesstimates we started with. Explicitly set <strong>GOMAXPROCS</strong> to match the number of CPUs the container actually had, not what the Go runtime <em>thought</em> it had. Added <strong>throttling metrics</strong> to our dashboards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NyTEDInKZPaJPJ1zZ2YQrg.png" /></figure><p>And thus, by increasing our efficiency, we have seen cost per day going down and efficiencies going up, latencies coming down, and back to smiling customers :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bLFXBUbBigk-SdtM" /><figcaption>Difference in p99</figcaption></figure><h3>The TL;DR Lessons</h3><ul><li>CPU usage lies. Throttling doesn’t.</li><li>Don’t rely on just HPA + CPU unless you understand what you’re measuring.</li><li>GOMAXPROCS is not a suggestion. It’s survival.</li><li>Monitoring only helps if you’re tracking the <em>right</em> metrics.</li><li>Don’t forget about GOMEMLIMIT ; deserves another blog post.</li></ul><blockquote>In Kubernetes, your code doesn’t run alone.<br>It runs with limits, throttles, schedulers, and sidecars.<br>And they all have opinions.</blockquote><blockquote>Kubernetes containerized your assumptions too :/</blockquote><p><strong><em>We are Zepto, We move fast…</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3768cda76326" width="1" height="1" alt=""><hr><p><a href="https://blog.zepto.com/everything-was-fine-until-kubernetes-said-no-more-cpu-3768cda76326">Everything Was Fine Until Kubernetes Said ‘No More CPU’</a> was originally published in <a href="https://blog.zepto.com/">Zepto TechXPress</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sharding 101: The Ways of Weaver]]></title>
            <link>https://medium.com/gojekengineering/sharding-101-the-ways-of-weaver-6c99360531fa?source=rss-e5a4b3a9c68e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c99360531fa</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[sharding]]></category>
            <category><![CDATA[proxy]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Gowtham Sai]]></dc:creator>
            <pubDate>Tue, 16 Apr 2019 03:56:05 GMT</pubDate>
            <atom:updated>2019-04-16T03:56:05.104Z</atom:updated>
            <content:encoded><![CDATA[<h4>A guide to deploying GOJEK’s open-source reverse proxy to Kubernetes and using it to shard incoming requests.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4vaWPgsUjBYAcSFpatBDGw.jpeg" /><figcaption><a href="http://bit.ly/2UEfyPa">gojek.jobs</a></figcaption></figure><p>In a previous post, we had announced Weaver, GOJEK’s in-house reverse proxy (which we have open-sourced 🖖). You can read it here:</p><p><a href="https://blog.gojekengineering.com/weaver-sharding-with-simplicity-8d602f2b0d81">Weaver: Sharding with simplicity</a></p><p>Here’s the TL;DR: Weaver is an HTTP reverse proxy with dynamic sharding strategies, written in Go. One of the challenges we face at GOJEK is the high volume of concurrent requests, which can be really tough to handle at scale if you don’t shard your clusters.</p><p>There are multiple ways to shard your request, which include <em>geographical sharding,</em> <em>algorithmi</em>c sharding based on order_id or customer_id, <em>dynamic sharding </em>and <em>entity-based sharding</em>. As mentioned before, Weaver specialises in dynamic sharding.</p><p>This post covers how to deploy Weaver onto Kubernetes and explains strategies to shard requests among different sample services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*gOYXZwz2aKkLoYcXi7_L8Q.png" /><figcaption>Sharding <em>Geographically vs Sharding Internally</em></figcaption></figure><p>Recently we launched our GO-CAR product to users in Singapore. During the analysis, we decided to go with the same cluster we use in Indonesia, but have different instances of the service as different shards.</p><p>This architectural topology was adopted for multiple reasons, which include:</p><ul><li><em>Achieving failure isolation across geographical boundaries.</em></li><li><em>Scaling systems independently of one another.</em></li><li><em>Having shard-specific configurations.</em></li></ul><p>This is where Weaver plays an important role. We created another replica of the service with different configurations, and deployed Weaver in front of the service clusters. Weaver was then configured to shard the requests based on different strategies (in this instance, based on <strong>geographical location</strong>).</p><h3>Sharding using Weaver</h3><p>Weaver can shard based on multiple strategies like header lookup, key in body, hashring, and more. These are documented <a href="https://github.com/gojek/weaver/blob/master/docs/weaver_acls.md">here</a>.</p><p>Weaver can be configured using a simple JSON file (referred as Weaver ACLs).</p><h4>Deploying Weaver to Kubernetes</h4><p>You can use the helm charts available on our <a href="https://github.com/gojektech/weaver/tree/kube-deploy/deployment/weaver">GitHub</a> to deploy Weaver. Let’s start by setting up <a href="https://kubernetes.io/docs/setup/minikube/">minikube</a> on the dev machine (you can follow the <a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro/">instructions from Kubernetes official website</a>).</p><pre># clone repository<br>git clone git@github.com:gojektech/weaver.git</pre><pre># Verify you have minikube installed<br>minikube version # minikube version: v0.33.1</pre><p>Once you clone the repo, deploying to Kubernetes is pretty simple. All you have to do is start Kubernetes and deploy using helm. Once you have done the setup by following the links mentioned above, verify that minikube is installed.</p><p>Let’s start minikube which will start a Kubernetes cluster in your dev machine. If your setup is fine, you will be greeted with <strong>Everything looks great. Please enjoy minikube!</strong> message.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/49d945da63d2624d4b5c8058f58a11a7/href">https://medium.com/media/49d945da63d2624d4b5c8058f58a11a7/href</a></iframe><p>You can see that our cluster is up and running and kubectl is configured correctly. We will be deploying using helm (please follow <a href="https://helm.sh/docs/using_helm/">helm official docs to install).</a> Once you have helm installed in your dev machine run the following commands to start working with helm.</p><pre># To begin working with Helm<br>helm init</pre><pre>minikube dashboard</pre><p>You will be able to see the Kubernetes dashboard in your default browser.</p><p>Now, we are good to deploy Weaver to Kubernetes.</p><blockquote>In this exercise, we will be releasing a simple internally-sharded service which gives us an estimate for a ride.</blockquote><p>A consumer asks for an estimate for a ride in a particular country_code, based on which Weaver will route the request to different shard. To better understand the request routing path, refer to the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*UaPRvFLNceiVgFweaJsRxw.png" /><figcaption>Weaver request routing path</figcaption></figure><p>Before continuing further, let’s build a dev docker image for Weaver so that it will test this experiment on the latest master branch.</p><pre># Connect to minikube docker engine<br>eval $(minikube docker-env)</pre><pre># Builds weaver docker image and tags it as stable<br>docker build . -t gojektech/weaver:stable # To have latest build.</pre><p>Please be aware that eval $(minikube docker-env) works only for that shell as it is local to the session.</p><p>If the above commands are executed successfully, a Weaver image should be present in the minikube docker environment, as represented below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*4FwaPdLXw7VOqQrNbFpOew.png" /></figure><p>By now we have everything set up. Time to deploy Weaver.</p><pre>helm upgrade --debug --install proxy-cluster ./deployment/weaver --set service.type=NodePort -f ./deployment/weaver/values-env.yaml</pre><p>Let’s breakdown the command and understand what we are doing. We are upgrading a release candidate named <strong>proxy-cluster </strong>and --install says install if the release is not present. We are setting service.type to NodePort so that we can connect from a host machine. To get the status of the deployment you can run:</p><pre>helm status proxy-cluster</pre><p>This will output something very similar to the below image. Please check that all yours are pods in <strong>RUNNING</strong> status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eGJqWRMpEB4LgP7SFnFljw.png" /></figure><p>We have successfully deployed Weaver to Kubernetes and are watching /weaver/acls actively for any changes in ACLs. It’s time to deploy simple services and add ACL to see Weaver in action.</p><h3>Deploying A Simple Service</h3><p>We have this simple service called estimator which estimates the amount it takes for a given ride. This is just a random number between min cap and max cap which is presented as the estimated amount for a request.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/978a6fbcf8a7b0d603ad6eafb86afc35/href">https://medium.com/media/978a6fbcf8a7b0d603ad6eafb86afc35/href</a></iframe><p>This is simplified version of estimating a price, all it can do is to estimate the amount, and return the response that contains the estimated amount and currency, which a shard level config. So, we are going to build a docker image for this simple service and deploy it as two shards. One is Indonesianshard where currency is configured as IDR and Singapore shard where currency is configured as SGD.</p><p>We will build this docker image using the docker file mentioned below and deploy this to two clusters. All the code and charts to deploy this are available under examples in <a href="https://github.com/gojektech/weaver/tree/master/examples/body_lookup">GitHub public repo</a>.</p><pre>$ eval $(minikube docker-env)</pre><pre>$ docker build ./examples/body_lookup -t estimator:stable</pre><pre># Deploying to SG Cluster<br>helm upgrade --debug --install singapore-cluster ./examples/body_lookup/estimator -f ./examples/body_lookup/estimator/values-sg.yaml</pre><pre># Deploy to ID Cluster<br>helm upgrade --debug --install indonesia-cluster ./examples/body_lookup/estimator -f ./examples/body_lookup/estimator/values-id.yaml</pre><p>Below is the Dockerfile we used to build the docker image. Once you built the docker image using the above command, deploy it to <strong>singapore-cluster</strong> and <strong>indonesia-cluster</strong>. You can check the status of deployments using helm as we have done for Weaver.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7821a8a2694cf7216d030282d8d1083a/href">https://medium.com/media/7821a8a2694cf7216d030282d8d1083a/href</a></iframe><p>Now we have an <strong>Estimate Service</strong> deployed to Kubernetes and exposed internally using ClusterIP. These services are sharded, without knowledge about one another. Let’s deploy an ACL to tell Weaver to route the request to Singapore Cluster if request body contains currency whose value is equals to SGD and to Indonesian Cluster if request body contains currency with value equals to IDR. You can exec into either of the estimate service pods and make a curl request to see the response. Regardless of the country you send, the service returns configured currency.</p><p>Even though our customer is requesting an estimate only in a particular currency, regardless of that we are returning configured currency. Weaver handles this using <strong>body_lookup</strong>. Below is the ACL that we apply to etcd, which also depicts Weaver loading the ACL and shard requests.</p><pre>{<br>  &quot;id&quot;: &quot;estimator&quot;,<br>  &quot;criterion&quot; : &quot;Method(`POST`) &amp;&amp; Path(`/estimate`)&quot;,<br>  &quot;endpoint&quot; : {<br>    &quot;shard_expr&quot;: &quot;.currency&quot;,<br>    &quot;matcher&quot;: &quot;body&quot;, <br>    &quot;shard_func&quot;: &quot;lookup&quot;,<br>    &quot;shard_config&quot;: {<br>      &quot;IDR&quot;: {<br>        &quot;backend_name&quot;: &quot;indonesia-cluster&quot;,<br>        &quot;backend&quot;:&quot;<a href="http://indonesia-cluster-estimator/">http://indonesia-cluster-estimator</a>&quot;<br>      },<br>      &quot;SGD&quot;: {<br>        &quot;backend_name&quot;: &quot;singapore-cluster&quot;,<br>        &quot;backend&quot;:&quot;<a href="http://singapore-cluster-estimator/">http://singapore-cluster-estimator</a>&quot;<br>      }<br>    }<br>  }<br>}</pre><p>To put it in simple English, when someone makes a <strong>POST</strong> request and the path is <strong>/estimate</strong>, we tell Weaver to use <strong>body</strong> <strong>matcher</strong> to find the backend using <strong>lookup,</strong> and shard requests accordingly based on the value of the expression <strong>.currency </strong>. To apply this to etcd, we have to port forward to connect to etcd deployed in Kubernetes.</p><pre># k port-forward svc/etcd 2379<br>Forwarding from 127.0.0.1:2379 -&gt; 2379<br>Forwarding from [::1]:2379 -&gt; 2379</pre><p>You should be able to reach etcd using localhost:2379. Make a curl request to see the health of etcd to ensure that our etcd cluster is properly up and running. Once it is done, we can set the ACL on etcd to see Weaver loading it up and start serving traffic without any restarts required.</p><p>As you see, Weaver just picked up the ACL we have applied and started serving the traffic without restarts.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FeAgIIKNPd3c%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DeAgIIKNPd3c&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FeAgIIKNPd3c%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9de45693d406c4a6d1a67eeb96db1305/href">https://medium.com/media/9de45693d406c4a6d1a67eeb96db1305/href</a></iframe><h3>Conclusion:</h3><p>Weaver is written to solve a particular use case, and has pretty much become the general solution to solve sharding problems at GOJEK.</p><h4>Reminder: Weaver is open source. Find it here: 👇</h4><p><a href="https://github.com/gojek/weaver">gojek/weaver</a></p><p>Hope you enjoyed this post and that it proved useful. Please do share your feedback and let us know what you think. 👌</p><p>Whether it’s products for people or tools to help us work better, building stuff is what we do. It’s what we do best, as evidenced by how we built 19+ products in 3 years, and expanded to three new countries. We’re not done though, and we’re looking for the best talent to help us do more. Want to give us a hand? Visit <a href="http://bit.ly/2UEfyPa">gojek.jobs</a> and grab the chance to work with us. 🙌</p><figure><a href="http://bit.ly/2UEfyPa"><img alt="" src="https://cdn-images-1.medium.com/max/892/1*PdKKvtpvxTQcbMlDvIlFzQ.png" /></a><figcaption>gojek.jobs</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c99360531fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gojekengineering/sharding-101-the-ways-of-weaver-6c99360531fa">Sharding 101: The Ways of Weaver</a> was originally published in <a href="https://medium.com/gojekengineering">Gojek Product + Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lessons from Yahoo!]]></title>
            <link>https://medium.com/gowtham-sai/lessons-from-yahoo-54fbed07c5b?source=rss-e5a4b3a9c68e------2</link>
            <guid isPermaLink="false">https://medium.com/p/54fbed07c5b</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[lessons]]></category>
            <category><![CDATA[business-strategy]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[yahoo-failures]]></category>
            <dc:creator><![CDATA[Gowtham Sai]]></dc:creator>
            <pubDate>Tue, 06 Mar 2018 21:09:02 GMT</pubDate>
            <atom:updated>2018-03-07T04:47:40.173Z</atom:updated>
            <content:encoded><![CDATA[<h4>Improvise. Adapt. Overcome.</h4><p>Focus: It is really important to have fixed focus or focus <strong>as company </strong>in order to avoid distraction. <strong>Yahoo </strong>started as search engine, one of the web giant, changed focus to marketing/media company, and realised the mistake, changed it back to search. Have clear focus on what you want to achieve.</p><p>Attention: Yahoo’s failure highlights the criticality of the role founders play in a business. Biggest tech companies like Apple, Google and Facebook had at least one founder played a critical role in at least the first 5 years of the company. Now if we look at Yahoo, both co-founders, <strong>Yang and Filo, </strong>stopped playing a key role in Yahoo A YEAR after it was founded. Paul mentioned about it more clearly in one of his <a href="http://paulgraham.com/yahoo.html">blogposts.</a> Pay attention to the product, please listen to your customers feedback. Make insights.</p><p>Culture: Is the collection of business practices, processes, and interactions that make up the work environment.They are the uncompromising core principles that the company is willing to live or die by, the rules of the game. Bunch of values makes the bed rock foundation for culture. Culture helps the company grow by keeping the mission at heart and encouraging passion.</p><p>Talent: Companies are not just products, but ideas, people. Great companies are made by great employes. I must quote this, my mom used to say, one saint can not stay among hundreds of sinners and one sinner can not stay among hundreds of saints. In both cases, the former parties converts. Exactly same way, as you start hiring people, your team becomes sparse more. No matter how hard it is, hire and retain the best rather than hiring just to fill in.</p><p>While I said, stay focused, it doesn’t mean that, not to adapt as per market. But be careful about improvising it. It is hard to change the architecture once designed, imagine how hard it is to change company culture. <strong>It’s really, really hard to change a company culture. </strong>To be successful, build culture, have standards, decide what is your business about, be the best at it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54fbed07c5b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gowtham-sai/lessons-from-yahoo-54fbed07c5b">Lessons from Yahoo!</a> was originally published in <a href="https://medium.com/gowtham-sai">Gowtham Sai</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gooooogle it better with dorks!]]></title>
            <link>https://medium.com/gowtham-sai/gooooogle-it-better-with-dorks-4c121b300735?source=rss-e5a4b3a9c68e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c121b300735</guid>
            <category><![CDATA[google-search]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[searching]]></category>
            <category><![CDATA[dorks]]></category>
            <category><![CDATA[google-hacks]]></category>
            <dc:creator><![CDATA[Gowtham Sai]]></dc:creator>
            <pubDate>Tue, 06 Mar 2018 19:12:55 GMT</pubDate>
            <atom:updated>2018-03-06T19:12:55.537Z</atom:updated>
            <content:encoded><![CDATA[<p>Dorks are dirty, be careful. Will let you know why they are dirty, and at the same time beautiful too, when you know how to use them. Dorks are basically advanced search query to get the results which are hard to get when searching normally. This sometimes also referred as Google Hacking. While there are over thousands of dorks, will introduce you to the most usable dorks in everyday day to day life.</p><ol><li><a href="https://www.google.co.in/search?rlz=1C5CHFA_enIN772IN772&amp;ei=_NmeWpf_KMjcvgSkzIr4DQ&amp;q=tabs+vs+spaces+site%3Astackoverflow.com&amp;oq=tabs+vs+spaces+site%3Astackoverflow.com&amp;gs_l=psy-ab.3...8629.11050.0.11278.14.13.0.0.0.0.192.1089.2j7.9.0....0...1c.1.64.psy-ab..8.0.0....0.0XYW-V920Go">site</a>: gets the result only from mentioned site.</li><li><a href="https://www.google.co.in/search?rlz=1C5CHFA_enIN772IN772&amp;ei=xdqeWsC_O8zcvgT62pOIAw&amp;q=allintitle%3A+gowtham+pspec+site%3Agithub.com&amp;oq=allintitle%3A+gowtham+pspec+site%3Agithub.com&amp;gs_l=psy-ab.3...75352.76039.0.76222.8.6.0.0.0.0.196.304.0j2.2.0....0...1c.1.64.psy-ab..7.0.0....0.r6JKGMZNV2A">allintitle</a>: produces results which includes all the text.</li><li>intitle: produces result which contains the word in title.</li><li><a href="https://www.google.co.in/search?rlz=1C5CHFA_enIN772IN772&amp;ei=V92eWuD-I6OYvQTV54vwBg&amp;q=info%3Ayahoo.com&amp;oq=info%3Ayahoo.com&amp;gs_l=psy-ab.3...6890.9874.0.10060.16.14.0.0.0.0.287.1546.0j7j2.10.0....0...1c.1.64.psy-ab..6.3.544.6..0j35i39k1j0i67k1j0i131i67k1j0i131k1j0i10k1.222.uaDVG42zUKw">info</a>: gives you the information google knows about it.</li><li><a href="https://www.google.co.in/search?q=related%3Agojek.com&amp;rlz=1C5CHFA_enIN772IN772&amp;oq=related%3A&amp;aqs=chrome.0.69i59l3j69i57j69i58j69i65.3064j0j9&amp;sourceid=chrome&amp;ie=UTF-8">related</a>: produces results which all are related to the topic</li><li>filetype or ext: Returns the result which contains files with those extensions.</li></ol><p>That’s enough to get regular information, let’s look at few queries.</p><blockquote><strong>ext</strong>:pdf <strong>site</strong>:<a href="http://www.bluebirdgroup.com/">www.bluebirdgroup.com/</a></blockquote><p>This shows all pdf files from blue bird group. Keyword <strong>ext</strong> is to show pdf files, from <strong>site</strong> blue bird group.</p><blockquote>ext:pdf site:yahoo.com</blockquote><p>When used with cloud storages, leads to files which might not intended to expose it to public usage.</p><p>Let’s get to more complex search queries.,</p><blockquote>Ed Shareen intitle:”index.of” “parent directory” “size” “last modified” “description” Shape Of You (mp4|mp3|avi|flac|aac|ape|ogg) -inurl:(jsp|php|html|aspx|htm|cf|shtml|lyrics-realm|mp3-collection) -site:.info</blockquote><p>Ed Shareen: filter out result, intitle indicates that we want result, that contains <strong>Index of </strong>in title, and <strong>parent directory, size, last modified, description </strong>in body as mandatory, mp4, mp4 etc text in body, negative indicates, we don’t want result from those which contains <strong>jsp, php, … </strong>in url, and we don’t want result from the site whose domains ends with .info</p><p>At the beginning of the page, we mentioned it’s dirty as well. You will get to know why it is, try the below dork in your Google search and try to see what happens, explore the results.</p><blockquote>intext:”Index of /” +password.txt</blockquote><p>List the sites which exposes passwords, be aware of <strong>honeypots. </strong>You can get the sites which have sql injection exposed using google dorks as well.</p><p>Lastly, there are few dork keywords like inurl, which I didn’t explain, I leave that as exercise to user as I believe learn by doing rather than reading.</p><p>Here is a bonus, while I don’t encourage you to do this, <strong>especially at work</strong>, read about 94fbr. Happy googling.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c121b300735" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gowtham-sai/gooooogle-it-better-with-dorks-4c121b300735">Gooooogle it better with dorks!</a> was originally published in <a href="https://medium.com/gowtham-sai">Gowtham Sai</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[README..!]]></title>
            <link>https://medium.com/gowtham-sai/readme-69fca492f7b0?source=rss-e5a4b3a9c68e------2</link>
            <guid isPermaLink="false">https://medium.com/p/69fca492f7b0</guid>
            <category><![CDATA[readme]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[engineering-technology]]></category>
            <dc:creator><![CDATA[Gowtham Sai]]></dc:creator>
            <pubDate>Tue, 06 Mar 2018 03:36:22 GMT</pubDate>
            <atom:updated>2018-03-06T03:36:22.862Z</atom:updated>
            <content:encoded><![CDATA[<p>The very first and important way to communicate about your project is README. What all, a README is supposed to contain..?</p><ol><li><strong>Introduction:</strong> It should be brief introduction about what it is and how it works and why it is needed. I think those should be enough to explain, give summary about the project.</li><li><strong>Configuration &amp; Setup: </strong>It is really very important for other developers to understand and setup the project in order to contribute. If it is taking more than 5 mins for any new developer to setup the project, it’s worth spending time on optimising it. Use vagrant, dockers or plain shell script, but make sure, all setup is automated which required to run the application.</li><li><strong>Usage &amp; Configuration: </strong>It should be clearly mentioned how to run the the application, and what are all the things, that can be configured. There is no point, if developer or user, don’t know how to use the application. It is better to put complete architecture picture if possible and valid for the project.</li><li><strong>Specs, Build &amp; Conventions: </strong>You should be careful about this, especially if you are setting up open source project. You should setup linter (code style checks) in place, code quality metrics, else soon when different people with different habits, starts contributing to the project, it will become mess. Have clear instructions to setup and run, specs, builds, pre git commit hooks for code coverage and etc.</li></ol><p>Finally, you can put information such as link to Licence, authors information, credits, acknowledgments, link to change log, and if there is any known critical bugs, which can’t be fixed anytime soon, or no body working on, mention them in README.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69fca492f7b0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gowtham-sai/readme-69fca492f7b0">README..!</a> was originally published in <a href="https://medium.com/gowtham-sai">Gowtham Sai</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tell, Don’t Ask: XY Problem]]></title>
            <link>https://medium.com/gowtham-sai/tell-dont-ask-xy-problem-f3c005640a3c?source=rss-e5a4b3a9c68e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3c005640a3c</guid>
            <category><![CDATA[why]]></category>
            <category><![CDATA[five-whys]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[tell-dont-ask]]></category>
            <category><![CDATA[problem-xy]]></category>
            <dc:creator><![CDATA[Gowtham Sai]]></dc:creator>
            <pubDate>Tue, 27 Feb 2018 04:27:12 GMT</pubDate>
            <atom:updated>2018-02-27T04:27:12.950Z</atom:updated>
            <content:encoded><![CDATA[<p>The X-Y Problem, which leads to enormous amounts of wasted time and energy is asking about your attempted solutions rather than what you actually want to achieve. You are trying to solve problem X, and thinks Y is the answer. However, you couldn’t achieve it because of Y. You go to a person and asks how to do Y. But that won’t solve the problem, cause your problem is not doing Y, but completing X.</p><blockquote>RikusW&gt; Say I have a filename in $1 how would I get its size ?<br>greycat&gt; Why?<br>erUSUL&gt; du $file<br>RikusW&gt; ty<br>erUSUL&gt; du “$file” even<br>RikusW&gt; havent thought of that … :)<br>greycat&gt; Literal answers to bad questions can be dangerous.<br>greycat&gt; WHY do you want its size? What is the POINT?<br>RikusW&gt; <em>du $1</em> maybe ?<br>RikusW&gt; Want to write a script to dd 512k sections out and md5sum it…<br>erUSUL&gt; RikusW: huh? you want to do something with the size later?<br>greycat&gt; you want to WHAT?<br>RikusW&gt; dd doesn’t return 1 when the end is reached…<br>greycat&gt; … why wouldn’t you take a SINGLE md5 of the whole thing?<br>RikusW&gt; I have a corrupt 500mb file….<br>RikusW&gt; and a slow connection<br>greycat&gt; rsync.<br> greycat&gt; NEXT!</blockquote><p>Example from: <a href="http://xyproblem.info/">XyProblem</a></p><p>Usually it is important for the User to know, why it’s not working as well. But rather than asking what you’ve tried, it will be helpful to explain the problem and your solution as well.</p><blockquote>Why? Why.? Why..? Why…? Why…¿?</blockquote><p>The easiest way to get to a real problem is to ask Why five times. Ask, why?, ask again? till you have no more whys to ask.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3c005640a3c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gowtham-sai/tell-dont-ask-xy-problem-f3c005640a3c">Tell, Don’t Ask: XY Problem</a> was originally published in <a href="https://medium.com/gowtham-sai">Gowtham Sai</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Studying vs Learning — The 3Ws’]]></title>
            <link>https://medium.com/gowtham-sai/studying-vs-learning-the-3ws-59199d291085?source=rss-e5a4b3a9c68e------2</link>
            <guid isPermaLink="false">https://medium.com/p/59199d291085</guid>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Gowtham Sai]]></dc:creator>
            <pubDate>Fri, 23 Feb 2018 04:31:47 GMT</pubDate>
            <atom:updated>2018-02-23T04:31:47.930Z</atom:updated>
            <content:encoded><![CDATA[<p>There is a great misconception (Maybe!) between studying and learning. In my case, <strong>I’ve studied Civil Engineering, but I didn’t learn anything related to Civil. </strong>Just like most of the students, I studied to pass the exam. You do learning to gain some knowledge either by studying, practising, listening or may by experiencing. <strong>I learned programming by practicing it.</strong></p><p>It doesn’t mean that you are learning or pursuing it if you are studying it. Want to learn something, question it. Know in and out of that. I strongly believe 3Ws’ concept helps a lot to learn (~not studying).</p><blockquote>What, Why, When………., and Repeat?</blockquote><p>It’s okay to be silly to know it completely. Don’t believe it. Ask again and again, till you get satisfactory information. One of the important thing to do is ask why again and again, till you have no more why questions. At the same time, don’t be idiot. Don’t ask why 5 is called Five, why not Ten.</p><blockquote>Goal of Education is to Learn, not to Study &amp; Pass the Exam</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59199d291085" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gowtham-sai/studying-vs-learning-the-3ws-59199d291085">Studying vs Learning — The 3Ws’</a> was originally published in <a href="https://medium.com/gowtham-sai">Gowtham Sai</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Three Laws of TDD]]></title>
            <link>https://medium.com/gowtham-sai/three-laws-of-tdd-a84dd5204eae?source=rss-e5a4b3a9c68e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a84dd5204eae</guid>
            <category><![CDATA[three-laws]]></category>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[gojek]]></category>
            <category><![CDATA[beginner]]></category>
            <dc:creator><![CDATA[Gowtham Sai]]></dc:creator>
            <pubDate>Tue, 13 Feb 2018 23:01:33 GMT</pubDate>
            <atom:updated>2018-02-13T23:04:28.658Z</atom:updated>
            <content:encoded><![CDATA[<p>Yet another simple and magnificently powerful software development process that relies on short repetitive development cycle. A noticeable advantage of TDD is, it forces you to think in the smallest way and take tiny steps possible. Over lot of debates and arguments, final conclusion leads to the foundation for new beginners, Three laws of TDD.</p><blockquote>If it’s worth building, it’s worth testing. If it’s not worth testing, why are you wasting your time working on it?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHDCeAc96xjV4p2Cj7JNlg.png" /></figure><p>In fact these three laws are mechanics, you must and should apply it especially when you are beginner like me who is new to TDD and wanted to learn it because it forces you to write better maintainable software. Mechanics are literally the the exact steps you are going to execute unlike the decision making principles. At the same time, it doesn’t mean that you should never question it before you blindly following it. This reminds me of my favourite movie I Robot.</p><blockquote><strong>Law 1:</strong> You can’t write any production code until you have first written a failing spec.</blockquote><p>What it conveys is that you are not going to have your <strong>any class file </strong>in your code base unless your specs are failing because of it. Motive behind this is to <strong>write spec first.</strong></p><blockquote><strong>Law 2: </strong>You can’t write more of a unit test than is sufficient to fail, and not compiling is failing.</blockquote><p>Of course, we know that it’s going to fail once you are about to initialise in your spec. Wait, until then it’s not going to fail because of it. So, you don’t need it. Write at least one line that makes your build fail. It can be simple as the following.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/67026a640c240f5cdf3f17c323649380/href">https://medium.com/media/67026a640c240f5cdf3f17c323649380/href</a></iframe><blockquote><strong>Law 3:</strong> You can’t write more production code than is sufficient to pass the currently failing unit test.</blockquote><p>The third law says, write the minimum step required to make the currently failing spec pass. The very minimal step is to create the class file which causing it to fail. Well, again go step one, iterate. do it again. pass arguments to add method, watch it fail, go and implement addition, assert for value, watch it fail, go and return bluntly the expected value.</p><p>All these three laws arises a question and an outcome</p><blockquote>Do I literally switch between files, write spec, compile, watch it fail, create file, modify, run, compile, waste time?</blockquote><p>I strongly believe that, the motive behind this is to force you to think and take small tiny tiny tiny steps possible to adopt. It is far more productive than attempting to code in large steps. We all might have faced situation where we are in hurry, do lot fo things at once, and we don’t know which one actually fixed the issue, or even worse, which one is actually currently in action. Don’t you think, taking one little tiny step at a time, gives you more control and understand better about the problem. That is exactly these three laws are for.</p><blockquote>Motive is to teach the self discipline and patience. Concentrate only on one thing and exactly one thing.</blockquote><p>Once this becomes you natural habit, and once you are experienced TDDers follow, you might not write exactly one line of code which makes the build fail, you might level it up and do RGR in Kent Beck’s original words:</p><blockquote>Make it work. Make it right. Make it fast..!</blockquote><p>We follow many things, because we are convinced that they have some advantages or benefits either directly or indirectly or you might have observed doing that makes your life better. The above three laws as well, just like the constitution</p><ol><li><strong>Debugging:</strong></li></ol><p>We spend most of the time, in debugging right? The above laws might not take that away from you, but it helps you in identifying the part of the code you focuses to debug the problem because you are taking tiny steps.</p><p>2. <strong>Confidence:</strong></p><p>We all were there in situations where we don’t want to touch or modify the code, because we were afraid of breaking it. Following three laws, having high test coverage gives you the confidence to make changes.</p><p>3. <strong>Specifications:</strong></p><p>You don’t need to answer for documentation and specifications, you already got them covered. You have huge specifications that focuses even on tiny steps you’ve taken.</p><p>4. <strong>Decoupling:</strong></p><p>In order to follow TDD, you’ve to break things to tiny level possible. Thus your code is decoupled already, a design benefit.</p><p>5. <strong>Discipline:</strong></p><p>It teaches you self discipline, makes you far more productive than you were. Allows you to focus on only on thing, and exactly one thing as decoupled rest of the system.</p><p>At the end a better person than you were yesterday, and who your future self thanks :)</p><p>Please feel free to share your opinions and feedback. I take this opportunity to announce that GoJek is hiring. Please feel free to shootout a <a href="/service/mailto:gowtham95india@gmail.com">mail</a> if you love working and solving interesting Engineering problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a84dd5204eae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gowtham-sai/three-laws-of-tdd-a84dd5204eae">Three Laws of TDD</a> was originally published in <a href="https://medium.com/gowtham-sai">Gowtham Sai</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Pytest PSpec — A Terminal Reporter]]></title>
            <link>https://medium.com/gowtham-sai/python-pytest-pspec-a-terminal-reporter-207fdffc0dd5?source=rss-e5a4b3a9c68e------2</link>
            <guid isPermaLink="false">https://medium.com/p/207fdffc0dd5</guid>
            <category><![CDATA[pytest]]></category>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[bdd]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[rspec]]></category>
            <dc:creator><![CDATA[Gowtham Sai]]></dc:creator>
            <pubDate>Mon, 12 Feb 2018 18:42:41 GMT</pubDate>
            <atom:updated>2018-02-16T04:39:10.176Z</atom:updated>
            <content:encoded><![CDATA[<h4>documentation generated from specs</h4><p>Being general purpose powerful programming language, it got lot popularity. One of the important aspects of Python is Readability. In fact it has strong design philosophy which emphasises code readability. In one of the blog posts, <a href="http://python-history.blogspot.in/2009/01/pythons-design-philosophy.html">Guido van Rossum</a> the creator of Python elaborated philosophical guidelines that helped him in order to make decisions while designing and implementing Python.</p><blockquote>Readability counts. Explicit is better than implicit.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*X8yosWNcr1zW48ltJb9hQw.png" /></figure><p>I was introduced to Test Driven Development (or Behaviour?) recently right after I joined <a href="http://gojek.com/">GoJek</a> by <a href="http://sidu.in/">Sidu</a>. Honestly at first, I was like, <strong>do I reaalllyyyy need to write specs?</strong></p><p>You know, as my first language is python, I like to keep it simple and less code. Seriously why should I waste time on writing specs which is not going to be useful to end user? Out of no where, one day the magic happened. Suddenly I couldn’t imagine how I used to write code without specs. I really feel so sorry for my past because I struggled a lot after modifying code a bit. I was introduced to <a href="https://en.wikipedia.org/wiki/RSpec">RSpec</a>. It is so perfect and with few changes you can produce yours specs as documentation. I don’t want to write code with specs any more, I don’t want to hurt my future self. So, the very next thing I wanted to do was change few of my projects to include specs (complete rewriting).</p><p>Unfortunately in Python, your method name is going to start with <strong>test </strong>and it should have your intension. Let’s assume, you want to write the spec for adding 2 numbers, you can’t name your method as test_should_be_able_toa_add_2_complex_numbers_successfully or test_should_add_2_complex_numbers or test_should_add_2_complex_numbers or test_add_2_complex_numbers. It is quite opposite to Python philosophy. I couldn’t find proper way to define the spec easily. It hurts me to write a method with such a long name. So I’ve written simple plugin for pytest named pspec which produces the specs from <strong>doc string.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c49de362fde19a2748eb08ee06d884dc/href">https://medium.com/media/c49de362fde19a2748eb08ee06d884dc/href</a></iframe><p>This produces the beautiful output which is more readable and colourful 😉 like the below one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zcb9xW5t-AaG-wFX4rvXig.png" /><figcaption>pytest report with pspec</figcaption></figure><p>I was so happy to read the specs, now it makes more sense, definitely more sense at least than the below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j6-xzlTSB13bvIzyBZJtAg.png" /><figcaption>py.test without pspec</figcaption></figure><p>Yep, explicitly is better than implicit, readability matters a lot. It’s is better to have `</p><pre>for student in classroom:<br>    student.unlearn()</pre><pre>for i in j:<br>    i.work()</pre><p>Please feel free to share your opinions and feedback. I take this opportunity to announce that GoJek is hiring. Please feel free to shootout a <a href="/service/mailto:gowtham95india@gmail.com">mail</a> if you love working and solving interesting Engineering problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=207fdffc0dd5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gowtham-sai/python-pytest-pspec-a-terminal-reporter-207fdffc0dd5">Python Pytest PSpec — A Terminal Reporter</a> was originally published in <a href="https://medium.com/gowtham-sai">Gowtham Sai</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lets Encrypt SSL for Custom Domain In Google App Engine]]></title>
            <link>https://medium.com/gowtham-sai/letsencrypt-ssl-for-custom-domain-google-appengine-python-e7c9425c5f0f?source=rss-e5a4b3a9c68e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7c9425c5f0f</guid>
            <category><![CDATA[lets-encrypt]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[app-engine]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Gowtham Sai]]></dc:creator>
            <pubDate>Sun, 01 Oct 2017 02:09:36 GMT</pubDate>
            <atom:updated>2018-04-27T18:17:27.210Z</atom:updated>
            <content:encoded><![CDATA[<p>Life before letsencrypt users has to buy ssl certificate which might cost approximately 100$ per year. Let’s encrypt try to solves the exact problem freely with automated ways.</p><blockquote><strong>Let’s Encrypt</strong> is a <a href="https://en.wikipedia.org/wiki/Certificate_authority">certificate authority</a> that launched on April 12, 2016<a href="https://en.wikipedia.org/wiki/Let%27s_Encrypt#cite_note-launch-1">[1]</a><a href="https://en.wikipedia.org/wiki/Let%27s_Encrypt#cite_note-softpedia-launch-2">[2]</a> that provides free <a href="https://en.wikipedia.org/wiki/X.509">X.509</a> <a href="https://en.wikipedia.org/wiki/Public_key_certificate">certificates</a> for <a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">Transport Layer Security</a> (TLS) encryption via an automated process designed to eliminate the current complex process of manual creation, <a href="https://en.wikipedia.org/wiki/Acceptance_testing">validation</a>, <a href="https://en.wikipedia.org/wiki/Digital_signature">signing</a>, installation, and renewal of certificates for secure websites.</blockquote><p>Google app engine provides ssl certificates for app engine’s own domain but not for the custom domains. Let’s get the ssl certificates for custom domain from letsencrypt.</p><p>Login into <a href="https://console.cloud.google.com/appengine">Google Cloud Shell</a> and click on the shell icon on top right. A linux shell will be launched right in your browser. Be sudo and be with the force always.</p><h4>Step 1: Download letsencrypt client.</h4><pre>git clone <a href="https://github.com/letsencrypt/letsencrypt">https://github.com/letsencrypt/</a><br>cd letsencrypt</pre><h4>Step 2: Generating certificate in manual mode.</h4><pre>sudo ./letsencrypt-auto -a manual certonly</pre><p>It will instruct you to fill the email address (To get notification before the cert expiration) and few others questions like acceptance for terms and conditions and etc.</p><h4>Step 3: Fill the custom domain you need ssl certificates for.</h4><pre>Please enter in your domain name(s) (comma and/or space separated)  (Enter &#39;c&#39;to cancel): gowtham-sai.com www.gowtham-sai.com</pre><p>Change gowtham-sai.com and <a href="http://www.gowtham-sai.com/">www.gowtham-sai.com</a> with your own domains for which you wish to have ssl certificates.</p><p>Wildcard domains are not supported yet. But good news is letsencrypt announced wildcard domains support. It is expected to release in January 2018.</p><blockquote><a href="https://letsencrypt.org/2017/07/06/wildcard-certificates-coming-jan-2018.html">Let’s Encrypt will begin issuing wildcard certificates in January of 2018. Wildcard certificates are a commonly requested feature and we understand that there are some use cases where they make HTTPS deployment easier. Our hope is that offering wildcards will help to accelerate the Web’s progress towards 100% HTTPS.</a></blockquote><h4>Step 4: Service Challenge (Important)</h4><p>Once you enter all the subdomains, it will request to serve one challenge for each subdomain. It will display something like below.</p><pre>Make sure your web server displays the following content at                                                                                                                              http://www.example.com/.well-known/acme-challenge/[challenge] before continuing: [response] Content-Type header MUST be set to text/plain.<br>....<br>....<br>Press ENTER to continue: </pre><p>Pay attention here, don’t press enter unless and until you are app serve the challenge. In my python app it I’ve an handler which serves the request.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e9fda84fa8c0ca4304577124ccd2da16/href">https://medium.com/media/e9fda84fa8c0ca4304577124ccd2da16/href</a></iframe><p>Once you made the above code changes and you are ready to serve the request. Deploy the app and test that your app server the request by visiting url shown in your cloud shell by letsencrypt. Once you verify, hit enter. Once you verify each subdomain successfully, hopefully you will end up with some certificates at /etc/letsencrypt/live/siteurlhere/. When connection is not persistent you might loose the certificates. I recommend you to copy them to your home directory cp -r /etc/letsencrypt/ ~/current.</p><h4>Step 5: Generating Private Keys and Uploading</h4><p>Use the following commands to get your private key</p><pre>sudo openssl rsa -inform pem -in ~/current/live/yourdomainhere/privkey.pem -outform pem | less</pre><p>Get your public key from here:</p><pre>sudo cat ~/current/live/yourdomainhere/fullchanin.pem</pre><p>Copy both the keys to notepad or text editor temporarily.</p><p>Go to <a href="https://console.cloud.google.com/appengine/settings/certificates">App engine &gt; Settings &gt; SSL Certificates</a>. Paste the fullchain in first box which is public key and the key you obtained in the first place in the second box (private key). Choose the domains you want to offer the certificate and save it.</p><p>Whah! Now you can access your domain with https certificate. You can force the website with https by changing the following content in app.yaml.</p><pre>- url: .*<br>  script: main.app<br>  secure: always</pre><p>Make sure, you don’t forget to update ssl certificates before they expire (90 days from the day you obtained). You will be notified at the email you provided in step 2. If you forget to update your ssl certificates, you will see the Red screen when users visit the site which is really bad sign.</p><h4>Edit 1:</h4><p>Finally letsencrypt launched wildcard support in Mar, 2018. Here is the link to <a href="https://community.letsencrypt.org/t/acme-v2-and-wildcard-certificate-support-is-live/55579">community post</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7c9425c5f0f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gowtham-sai/letsencrypt-ssl-for-custom-domain-google-appengine-python-e7c9425c5f0f">Lets Encrypt SSL for Custom Domain In Google App Engine</a> was originally published in <a href="https://medium.com/gowtham-sai">Gowtham Sai</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>