<?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 aesher9o1 on Medium]]></title>
        <description><![CDATA[Stories by aesher9o1 on Medium]]></description>
        <link>https://medium.com/@aesher9o1?source=rss-12897968aefc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*7CWpsnkG1Qo7ZwXLJXCCnw.jpeg</url>
            <title>Stories by aesher9o1 on Medium</title>
            <link>https://medium.com/@aesher9o1?source=rss-12897968aefc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 01:42:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aesher9o1/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[Deploying Weights and Biases on GCP and Istio]]></title>
            <link>https://aesher9o1.medium.com/deploying-weights-and-biases-on-gcp-and-istio-96f6ffbb1161?source=rss-12897968aefc------2</link>
            <guid isPermaLink="false">https://medium.com/p/96f6ffbb1161</guid>
            <dc:creator><![CDATA[aesher9o1]]></dc:creator>
            <pubDate>Wed, 07 Dec 2022 12:40:55 GMT</pubDate>
            <atom:updated>2022-12-07T12:40:55.710Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_ANkKpBmZgj6Rtdn.jpg" /></figure><p>A lot goes into training a model: cleaning your data, versioning it, splitting your data for training and validation, and then the painstaking process of training your model and sharing the findings with your team members.</p><p>If you work in an NLP-focused company like mine, which relies on ML models and researcher collaboration to share data and models, the entire lifecycle management process can quickly become a disaster.</p><p>Until we arrived at weights and biases.</p><p>Keeping marketing jargons aside, Let me quickly walk you through how to deploy it on your private cloud.</p><p>Infra required:<br>1. Redis<br>2. Pub/Sub<br>3. Cloud Storage<br>4. MySQL<br>5. Kubernetes cluster</p><p>Notice: We will not be focusing on the security of the resources here, it would help you a lot to deploy these resources with appropriate security compliances as per your company.</p><h3>Deploying Redis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGzDMbM8alXVrqE7yTYoAQ.png" /></figure><p>Head over to the memory store, where you should be able to create an instance. Enable AUTH for the instance. <br>Head over to the security section of the instance, and you should be able to see the AUTH string for your Redis instance.</p><pre>REDIS: redis://:&lt;REDIS_PASSWORD&gt;@&lt;REDIS_IP&gt;:&lt;REDIS_PORT&gt;/0</pre><p>Save this string to be used later.</p><h3>Creating a service account with required permissions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XeafSr2P8GzXeqQjc8a4fg.png" /></figure><p>Go to service accounts and make a service account that has the right permissions to use pub/sub and cloud logging.</p><h3>Creating a Pub/Sub Queue and cloud bucket</h3><p>Create a pub/sub queue and a cloud bucket for W&amp;B to access.</p><p>Give the service account you created admin rights to your bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ezepZcD47alDejNhGnQGw.png" /></figure><p>We will then need to setup a notification channel on pub/sub for W&amp;B to know about the changes in the bucket. That you can do by running the following command:</p><pre>gcloud storage buckets notifications create gs://BUCKET_NAME --topic=TOPIC_NAME</pre><h3>Creating your SQL server</h3><p>Go ahead and create an SQL instance for W&amp;B to use. Make sure to change the network settings so that the pods in your K8s cluster are able to communicate to the SQL server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HjI4sCT4BLDme45qsqyDVQ.png" /></figure><p>You should then have a user with a password to access this SQL instance.</p><pre> MYSQL: mysql://&lt;MYSQL_USER&gt;:&lt;MYSQL_PASSWORD&gt;@&lt;MYSQL_DATABASE&gt;/&lt;DATABASE_NAME&gt;</pre><h3>Deploying your kubernetes service</h3><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: wandb-config<br>data:<br>  LICENSE: &lt;W&amp;B_ENTERPRISE_LICENSE&gt;<br>  MYSQL: mysql://&lt;MYSQL_USER&gt;:&lt;MYSQL_PASSWORD&gt;@&lt;MYSQL_DATABASE&gt;/&lt;DATABASE_NAME&gt;<br>  BUCKET: gs://&lt;BUCKET_NAME&gt;<br>  HOST: &quot;https://wandb.quillbot.dev&quot;<br>  REDIS: redis://:&lt;REDIS_PASSWORD&gt;@&lt;REDIS_IP&gt;:&lt;REDIS_PORT&gt;/0<br>  BUCKET_QUEUE: pubsub:/&lt;GOOGLE_PROJECT_NAME&gt;/&lt;TOPIC_NAME&gt;/&lt;SUBSCRIPTION_NAME&gt;<br>  LOGGING_ENABLED: &quot;true&quot;<br>  SLACK_CLIENT_ID: &quot;858162898657.1612441232960&quot;<br>  SLACK_SECRET: 366951cdad42a3a561f97de0951a9930<br>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: wandb<br>spec:<br>  selector:<br>    matchLabels:<br>      app: wandb<br>  template:<br>    metadata:<br>      labels:<br>        app: wandb<br>    spec:<br>      volumes:<br>        - name: google-cloud-key<br>          secret:<br>            secretName: service-account-credentials<br>      containers:<br>        - name: wandb<br>          volumeMounts:<br>            - mountPath: /var/secrets/google<br>              name: google-cloud-key<br>          image: wandb/local<br>          envFrom:<br>            - configMapRef:<br>                name: wandb-config<br>          env:<br>            - name: GOOGLE_APPLICATION_CREDENTIALS<br>              value: /var/secrets/google/key.json<br>          resources:<br>            limits:<br>              memory: &quot;1G&quot;<br>              cpu: &quot;500m&quot;<br>          ports:<br>            - containerPort: 8080<br>---<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: wandb<br>spec:<br>  type: ClusterIP<br>  selector:<br>    app: wandb<br>  ports:<br>    - port: 80<br>      targetPort: 8080<br>---<br>apiVersion: networking.istio.io/v1alpha3<br>kind: Gateway<br>metadata:<br>  name: dev-gateway<br>spec:<br>  selector:<br>    istio: ingressgateway # use Istio default gateway implementation<br>  servers:<br>    - port:<br>        number: 443<br>        name: https<br>        protocol: HTTPS<br>      tls:<br>        mode: SIMPLE<br>        credentialName: tls-certs<br>      hosts:<br>        - &quot;*&quot;<br>---<br>apiVersion: networking.istio.io/v1alpha3<br>kind: VirtualService<br>metadata:<br>  name: wandb-ingress<br>spec:<br>  hosts:<br>    - &quot;*&quot;<br>  gateways:<br>    - dev-gateway<br>  http:<br>    - route:<br>        - destination:<br>            host: wandb<br>            port:<br>              number: 80<br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96f6ffbb1161" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Autoscale large images faster using Longhorn (distributed storage)]]></title>
            <link>https://aesher9o1.medium.com/autoscale-large-images-faster-using-longhorn-distributed-storage-618d0cf01ba2?source=rss-12897968aefc------2</link>
            <guid isPermaLink="false">https://medium.com/p/618d0cf01ba2</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[scaling]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[gke]]></category>
            <dc:creator><![CDATA[aesher9o1]]></dc:creator>
            <pubDate>Sat, 20 Aug 2022 18:21:46 GMT</pubDate>
            <atom:updated>2022-08-20T18:21:46.166Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q_oxR9az6YR1NOmB.png" /></figure><p>While running ML models in production is already a difficult task, doing so on Kubernetes takes the game to a whole new level. The biggest issue it introduces is the absurd image sizes, which in my case ranged from 20GB to more than 40GB. These images take an absurd amount of time to autoscale.</p><h3>Understanding the problem</h3><p>The model data in our images was clearly the cause of our large image sizes. As a result, we had to extract the model from the image so that it could be downloaded faster from the registry and scaled. There are two obvious solutions to this problem:</p><h4>Downloading model data from GS Bucket</h4><p>This reduces the size of the docker images, but our models will not be able to start until the data is available to our code, and remember that the network is the bottleneck here.</p><p>PS: You can quickly copy data from cloud storages by using some handy utilities, which I’ll link to at the bottom. This would have reduced image size as well as model spin up time, but we are looking for a better solution.</p><h4>Using a NFS in Kubernetes</h4><p>We decided to use a <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/">persistent volume</a> to save all of our models and then use a <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes-1">claim</a> to mount the volumes in the pod. This solves the network bandwidth issue because the data is available in our cluster and we only have to download it once.</p><p>Longhorn, when compared to Filestore, theoretically provided the same benefits at a 6 times lower cost.</p><p>So let’s get started.</p><h3>Architecture Diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wI24ywjV2Fyd9drw2BddGA.png" /></figure><ol><li>Fire pipeline to download model data from the Google Cloud Storage</li><li>Pipeline connects to a bastion host which exec’s into a pod in the cluster dedicated to update the persistent volume claim</li><li>The pod downloads data from Google Cloud Storage</li><li>The pod then syncs the data to the persistent volume claim</li><li>Once the data has been updated in the volume, a fresh deployment is launched to create new pods that will use the new data. We wanted to have a manual trigger to switch to the new model because the model file is so large to make sure the download is clean.</li></ol><p>We have the gitlab agent to sync all the yaml from the gitlab repository to our cluster. Hence we can just push the code to our codebase while gitlab agent does the heavy lifting to sync it to the cluster.</p><h3>Longhorn Installation</h3><h4>GKE Prerequisite</h4><p>GKE requires a user to manually claim themselves as cluster admin to enable role-based access control. Before installing Longhorn, run the following command:</p><pre>kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=&lt;name@example.com&gt;</pre><h4>Creation of node pool</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*HOUYDDN06K4QwQ1_BSXJ4w.jpeg" /></figure><p>Create a new node pool in your GKE cluster just for Longhorn. For CSI driver compatibility, it is <strong>critical to change the image type to Ubuntu</strong>. You can also change the boot disc to an SSD for faster I/O.</p><h4>Installation</h4><p>Copy the content of the <a href="https://longhorn.io/docs/1.3.1/deploy/install/install-with-kubectl/">official installation yaml</a> in a yaml file</p><pre>kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.3.1/deploy/longhorn.yaml</pre><p>Add the node affinity blocks listed below to all deployments and daemonset. Longhorn will now only be scheduled in the specialised nodepools you’ve created for it.</p><pre>affinity:<br>  nodeAffinity:<br>     requiredDuringSchedulingIgnoredDuringExecution:<br>       nodeSelectorTerms:<br>         - matchExpressions:<br>           - key: cloud.google.com/gke-nodepool<br>             operator: In<br>             values:<br>               - <strong>&lt;YOUR_NODE_POOL_NAME&gt;<br>               - &lt;YOUR_NODE_POOL_NAME2&gt;</strong></pre><p>You can <a href="https://longhorn.io/docs/1.3.1/deploy/accessing-the-ui/longhorn-ingress/">then follow this guide to expose your longhorn UI outside the cluster.</a></p><p>Once you have created a volume and PVC you should then easily be able to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*zNLX2vz-F9Z5c3bO5Z-7lA.png" /></figure><h3>Other hacks to improve performance by over 50%</h3><ol><li>If you’re on GKE, <a href="https://cloud.google.com/blog/products/containers-kubernetes/introducing-container-image-streaming-in-gke">container image streaming</a> is a must. Even for large image like ours GKE is able to spin pods up blazingly fast.</li><li>Use the <a href="https://cloud.google.com/blog/products/storage-data-transfer/new-gcloud-storage-enables-super-fast-data-transfers">gcloud alpha command</a> to take benefits of multi threading while downloading. This easily increases the download performace by 79%–94%. On AWS you can use <a href="https://github.com/peak/s5cmd">S5CMD</a>.</li></ol><h3>Reading Materials</h3><ol><li><a href="https://docs.gitlab.com/ee/user/clusters/agent/">Gitlab agent for GKE</a></li><li><a href="https://longhorn.io/docs/1.3.1/deploy/accessing-the-ui/longhorn-ingress/">Longhorn Doc</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=618d0cf01ba2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting a rogue Nodejs function in production]]></title>
            <link>https://aesher9o1.medium.com/detecting-a-rogue-nodejs-function-in-production-182d80cc17f1?source=rss-12897968aefc------2</link>
            <guid isPermaLink="false">https://medium.com/p/182d80cc17f1</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[aesher9o1]]></dc:creator>
            <pubDate>Fri, 25 Feb 2022 05:05:41 GMT</pubDate>
            <atom:updated>2022-09-09T10:53:29.152Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*3a3UTZfJSeT0j6H6dIyCsg.png" /><figcaption>Node process with 100% CPU usage</figcaption></figure><p>Unlike a node process that uses 100% MEM, where the node generally breaks due to heap exhaustion failure. When the CPU is at 100%, the thread is blocked, and the node is unable to accept new connections. This is frequently caused by an infinite loop in your code, which are notoriously difficult to locate. Worse, your single-threaded node process may not restart, causing that server to just sit there devouring your resources.</p><p>In my opinion, you may ask the Kubernetes scheduler to terminate such pods if you do proper liveness checks. But today’s not the time to choose that path.</p><p>Let’s set the mood with a dummy rogue code.</p><pre>function one() {<br>  two()<br>}</pre><pre>function two() {<br>  three()<br>}</pre><pre>function three() {<br>  four()<br>}</pre><pre>function four() {<br>  rogue()<br>}</pre><pre>function rogue() {<br>  const str = &#39;username:kenp username:dillonf&#39;<br>  let match<br>  <em>while</em> ((match = /username:(\w+)/g.exec(str)) !== null){<br>    console.log(match)<br>  }<br>}</pre><pre>one()</pre><p>The above code simulates a production-like environment in which one function calls the next, which calls another, and somewhere down the ladder lies a function with an edge case that you may not be aware of. YET</p><p>If you execute the code, you may see what is known as an unending print statement written in this manner.</p><pre>... [&quot;username:kenp&quot;, &quot;kenp&quot;, index: 0, input: &quot;username:kenp username:dillonf&quot;] [&quot;username:kenp&quot;, &quot;kenp&quot;, index: 0, input: &quot;username:kenp username:dillonf&quot;] [&quot;username:kenp&quot;, &quot;kenp&quot;, index: 0, input: &quot;username:kenp username:dillonf&quot;] [&quot;username:kenp&quot;, &quot;kenp&quot;, index: 0, input: &quot;username:kenp username:dillonf&quot;] [&quot;username:kenp&quot;, &quot;kenp&quot;, index: 0, input: &quot;username:kenp username:dillonf&quot;] [&quot;username:kenp&quot;, &quot;kenp&quot;, index: 0, input: &quot;username:kenp username:dillonf&quot;] [&quot;username:kenp&quot;, &quot;kenp&quot;, index: 0, input: &quot;username:kenp username:dillonf&quot;] [&quot;username:kenp&quot;, &quot;kenp&quot;, index: 0, input: &quot;username:kenp username:dillonf&quot;] ...</pre><p>Your system is unstable now. Right off the bat what you might want to see would be the processes running on the host. Here’s our first command.</p><pre>&gt; top</pre><pre>PID    COMMAND      %CPU  TIME     #TH    #WQ  #PORT MEM    PURG</pre><pre>53763  Terminal     111.9 02:34.96 9/1    3    328-  4967M+ 8992K-</pre><pre>53913  node         53.1  01:08.65 7      0    29    219M   0B</pre><p>The top command displays a dynamic real-time picture of the system in use. This command often displays the system’s summary information as well as a list of processes or threads that are presently controlled by the Linux Kernel.</p><p>My mac masks the CPU used by the node as the CPU used by the terminal. Oh my god! there is 111% CPU usage!</p><h3>Step 1: Enter debugging mode</h3><pre>kill -SIGUSR1 53913</pre><p><strong>Replace 533913 with the PID you got with </strong><strong>top the command.</strong></p><p>Don’t worry this will not kill the node process. This only signals node to start listening for debugging messages.</p><h3>Step 2: Inspect the code</h3><pre>node inspect -p 53913</pre><p>This will open a debugger for you in your command line.</p><p>If you are on your local computer and want to spawn a whole V8 debugger on chrome you can instead use</p><pre>node inspect -p 53913</pre><p>But if you are like me and do not want to go through a hierarchy to allow a firewall rule that might allow port forwarding and other networking messes. You will be better off with the first command.</p><p>Your terminal should now look like this</p><pre>debug&gt;</pre><h3>Step 3: See where the code is paused</h3><p>Use the command pause to see where the code is paused at</p><pre>debug&gt; pause<br>break in node:internal/console/constructor:359<br> 357 <br> 358 const consoleMethods = {<br>&gt;359   log(...args) {<br> 360     this[kWriteToConsole](kUseStdout, this[kFormatForStdout](args));<br> 361   },<br>debug&gt;</pre><p>And voila. Node tells you it’s stuck at a console.log statement.</p><p>This might not look too helpful in this example. But to be honest, your production would be more than a console log.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=182d80cc17f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Private NPM registry with Google Artifact Registry]]></title>
            <link>https://aesher9o1.medium.com/private-npm-registry-with-google-artifact-registry-778a7daa3784?source=rss-12897968aefc------2</link>
            <guid isPermaLink="false">https://medium.com/p/778a7daa3784</guid>
            <category><![CDATA[google-cloud]]></category>
            <category><![CDATA[artifact-registry]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[aesher9o1]]></dc:creator>
            <pubDate>Fri, 05 Nov 2021 06:03:37 GMT</pubDate>
            <atom:updated>2021-11-05T06:03:37.872Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uqL2ZGonCgBNrzZ3.png" /></figure><p>If you’re here, it’s reasonable to presume you’re familiar with NPM and may have your reasons for not hosting your packages in the public npm registry or purchasing the offering from npm. So, without further ado, let’s do it one step at a time.</p><p>Before proceeding with the video, ensure that you have the gcloud SDK installed on your laptop; instructions may be found <a href="https://cloud.google.com/sdk/docs/install">here.</a></p><h3>Setting up an IAM account with the right privileges and an artifact project</h3><p>First and foremost. If you are a manager, you may delegate the registry setup to a developer. As we all know, IAM roles manage everything in the cloud console. As a result, you would need to provide the developer with a minimal set of permissions in order for them to experiment with the repository.</p><p>Google gives you a basic set of roles with specified rights that you may utilise right away. However, if you want to provide users with additional fine-grained restrictions, you may examine all available permission settings <a href="https://cloud.google.com/artifact-registry/docs/access-control#permissions">here</a>.</p><p>The out of box provided roles are:<br><strong>1. Artifact Registry Administrator: </strong>Artifact Registry Administrator<br>Create and manage repositories and artifacts<strong><br>2. Artifact Registry Reader: </strong>Artifact Registry Repository Administrator<br>Read, write, and delete artifacts<strong><br>3. Artifact Registry Repository Administrator: </strong>Artifact Registry Writer Read and write artifacts<strong><br>4. Artifact Registry Writer: </strong>Artifact Registry Reader<br>View and get artifacts</p><p>For our demo project, we’ve chosen Artifact Registry Administrator for our demo user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I0L8fLcA0jpvwuKLD20mvg.jpeg" /><figcaption>Giving IAM privileges to users.</figcaption></figure><p>Head over to the artifact registry page and click <strong>create a repository. </strong>Enter the name, choose npm as a format specify the location type and you are good to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*PNHc5xedYOsdFi6eFlp6DA.png" /></figure><h3>Publishing your first package</h3><p>I’ll assume you have your package setup, if not you can clone this <a href="https://github.com/aesher9o1/demo-npm-package">project</a> to follow along.</p><p>Step 1: Create a <strong>.npmrc</strong> file in the root directory of your project.<br>Step 2: In the google cloud console open your artifact project, on the top panel click setup instructions and copy the script given to the .npmrc file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nCAvyQi52Vhh2qi7ZQJETw.png" /></figure><p>Step 3: Replace the SCOPE in the .npmrc with the required <a href="https://docs.npmjs.com/about-scopes">npm package scope.</a><br>Step 4. Name your package appropriately in the pacakge.json and copy the script ar-login from the below snippet to your pacakge.json</p><pre>{</pre><pre>“name”: “@quillbot/demo-repo”,</pre><pre>“version”: “1.0.0”,</pre><pre>“description”: “”,</pre><pre>“main”: “index.js”,</pre><pre>“scripts”: {</pre><pre>“test”: “echo \”Error: no test specified\” &amp;&amp; exit 1&quot;,</pre><pre>“ar-login”: “npx google-artifactregistry-auth — repo-config=./.npmrc”</pre><pre>},</pre><pre>“license”: “ISC”</pre><pre>}</pre><p>Step 5. Run gcloud init to log in to the project and set up your machine. <br>Step 6: Run npm run ar-login to configure the package and refresh tokens to access the registry. You should see a success message when you’re logged in successfully.<br>Step 7: Run npm publish to push your code to the artifact registry.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl7fdqmHQ1jCg2HzQlx%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl7fdqmHQ1jCg2HzQlx%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl7fdqmHQ1jCg2HzQlx%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/918c91999afb249a42d8b8e7dbe33da0/href">https://medium.com/media/918c91999afb249a42d8b8e7dbe33da0/href</a></iframe><h4>Hurraaaaaaaaaaay and you’ve hosted your very own artifact registry!!!!!!!</h4><h3>Footnote</h3><ol><li>To use the package in your projects run steps 1–4 in the repo you want to use the package, run npm i [pacakge-name] to download the package.</li><li>Due to restrictions from npm, you’ll have to update the version on your npm package if you have to publish an update to the package.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=778a7daa3784" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Raft consensus algorithm and leader election in MongoDB vs CoachroachDB]]></title>
            <link>https://medium.com/geekculture/raft-consensus-algorithm-and-leader-election-in-mongodb-vs-coachroachdb-19b767c87f95?source=rss-12897968aefc------2</link>
            <guid isPermaLink="false">https://medium.com/p/19b767c87f95</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[coachrochdb]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[aesher9o1]]></dc:creator>
            <pubDate>Tue, 17 Aug 2021 10:20:11 GMT</pubDate>
            <atom:updated>2021-08-18T06:25:19.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQBrWHPiyN3YQQiClCaGnQ.png" /></figure><p>We live in a distributed world, whether we like it or not. Distributed systems are everywhere, from Kafka and Cassandra to your Mongo DB cluster. Because of this, as a developer, you don’t have to worry about your cluster failing due to replication issues or clock misalignment issues. Instead, you can consider all of the state machines (replicated state machines) as if they’re one entity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*KXZKRSLSWdT7m2P50RJKbA.png" /><figcaption>Consensus Module architecture</figcaption></figure><p>For fault-tolerant, strongly consistent distributed systems, the distributed consensus is an essential primitive. A replicated log is often used to create replicating state machines. There is a log on each server, which contains a series of commands that are executed by the state machine in order. So, each state machine executes the same set of commands. The consensus algorithm’s job is to maintain consistency in the replicated log. A server’s consensus module takes commands from clients and logs them. To ensure that every log finally contains the same requests in the same sequence, even if some servers fail, it connects with consensus modules on other servers.</p><p>In the context of MongoDB, this may be seen as you providing command and the consensus algorithm handling replication throughout the replica set.</p><p>For those of us who have tried to comprehend Paxos, it has left us scratching our heads and frantically searching for a consensus algorithm that is both efficient and understandable. Or maybe trying to understand how Mongo DB works internally, you’ve come to the right place and are in for a ride. Let’s start.</p><h3>Let’s build a RAFT</h3><p>Before creating the algorithm, let’s set up a few limitations to simplify our design.<br>1. The systems are <strong>non-byzantine: </strong>AKA, we can trust all machines in our cluster.<br>2. <em>broadcastTime &lt;&lt; electionTimeout &lt;&lt; MTBF: </em>Before it can begin catering to requests, the algorithm is heavily reliant on an elected leader. Because of this, the time needed to communicate with the other computers should be shorter than the election timeout (will be discussed later). Because the average duration between failures ranges from a few hours to several months, we may not have to worry about it too much in real-world scenarios.</p><h4>Basics</h4><p>Raft, unlike Paxos, establishes consensus by first electing a distinguished leader and then delegating all responsibility for administering the replicated log to the leader. The leader collects log entries from clients, duplicates them on other servers, and notifies servers when log entries can be safely applied to their state machines. Any machine can be in any of the three states at any given time:<br><strong>1. Leader:</strong> The leader is the bad boy that caters to all the requests.<br><strong>2. Candidate: </strong>When a leader dies any follower can stand for an election and this is called the candidate.<br><strong>3. Follower:</strong> A follower simply takes commands from the leaders and if anyone from the outside tries to communicate with it, the follow redirects the request to the last leader it knows of.</p><h4>Leader Election</h4><p>A leader is chosen through a procedure known as election (as if that wasn’t obvious enough). Every server has a random timeout, which resets whenever the follower receives a heartbeat from the leader. If the follower does not hear from the leader for an extended period of time, the follower becomes a candidate and begins soliciting votes to become a leader via the “RequestVote RPC”.</p><p>Raft keeps track of the passage of time using a counter called “term” When a new leader is elected, the term count is increased and the current term is sent with every pulse and Append Entry RPC. Any follower, candidate, or leader with terms less than those obtained in the heartbeat admits that it is running in an outdated state and immediately resolves to a follower state.</p><p>In the current term, all followers can vote for only one leader. Once a follower has voted for a specific term, they can only vote for candidates standing for the next term or above. Given below is the parameters that is sent when a candidate asks for a vote and under what condition the vote is granted to the candidate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*Dguk6JCqg__pKCcjYYm2TA.png" /></figure><p>Let’s see an election in action.</p><p><strong>Step 1: The cluster starts. <br></strong>Because no leader has been nominated when the cluster begins, it will be unable to service any requests. All of the servers’ timers begin to tick. You can notice the initial term for all the servers has been initialized to 1. Hence term 1 has no leaders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*_jsAz-6Mgf26iMYmDUPdMw.png" /></figure><p><strong>Step 2: The first election</strong></p><p>When a follower reaches the end of its term, it promotes itself to a candidate for the next term’s election. Term 2 in this example. The candidate then begins soliciting votes and keeps track of the number of votes received. When the followers vote, they extend their term and recognise that there is a new leader.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*P51qnMH9roBKVh-mNp_pNQ.png" /></figure><p><strong>Step 3: Heartbeat and retaining control</strong></p><p>Once a leader is elected, the leader sends out heartbeats regularly to retain its influence. The heartbeat prevents the followers from timing out, and the clocks are reset whenever a follower receives a heartbeat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*P-gUgJgm5nXwmIxZ-oaAGw.png" /></figure><h4>Log Insertion</h4><p>Now that we have a leader. The cluster can resume normal operations and accept commands from the client. When the leader receives a command from a client, it first adds the entry to its log and then sends a “AppendEntry RPC” to all the other servers. The AppendEntry RPC’s arguments are listed below. Let’s dig a little deeper into it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*umM8g_OqvguvSdlRJa1j3Q.png" /></figure><p><strong>Step 1: Receiving a request from the client</strong></p><p>As we can see, S5 is the current term’s leader (2). When the leader receives a request, it first adds it to its log entry before sending the AppendEntry RPC to other servers with the above-mentioned arguments. The leader informs the followers of the term he is on, the index he wants the followers to add the entry to, and the format of his previous log entry. It’s worth noting that a heartbeat is an AppendEntry RPC with no data to append.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*_jA7Sp1V0khrcRB3tV4_Jg.png" /></figure><p><strong>Step 2: The followers acknowledge the RPC</strong></p><p>When the followers receive an AppendEntry RPC, they first check to see if the leader is legitimate. If the follower’s current term is greater than the leader’s term, the follower rejects the AppendEntry RPC, informing the leader that he is stale, and the leader instantly enters the follower state. However, if the words match the follower, verify its log entries; if the follower’s previous log entry does not match the leader’s, the follower rejects the RPC and awaits correction (more on this later). If all goes well, the follower adds the entry to its log and waits for the leader to issue a commit command. See the dotted lines? That means the entry is still not committed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*vCfMMSF335-PU6NKuwgnkA.png" /></figure><p><strong>Step 3: Commit</strong></p><p>When the majority of the followers acknowledge the leader, the leader knows it’s safe to commit the log. The leader then requests that everyone commit the log. For followers who respond slowly, or the leader keeps retrying until an acknowledgement is received. It is important to remember that a log is duplicated to the followers but can only be considered persistent once the leader asks everyone to commit it, which it will not do unless it hears from the majority of the followers. In other words, an uncommitted log is likely to be erased by other leaders. Raft, on the other hand, assures that any log that has been committed cannot be deleted under any circumstances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*SazYRHdO-t9eSEpIUJmxQQ.png" /></figure><h4>Log Correction</h4><p>Many times, a follower or leader may have been offline and was unable to keep up with the most recent update. Let’s examine how Raft deals with a failed leader and how the failed leader is brought up to speed with the rest of the servers.</p><p><strong>Step 1: The falling of the leader</strong></p><p>Assume S3 was the current term’s leader and it fails. The clocks on the other servers will continue to tick until an election timeout on any of the servers is reached. The server will position itself as a contender and begin soliciting votes to become the leader.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*05bsNOHlYkatNYgNW7Znbw.png" /></figure><p><strong>Step 2: Starting off a new term</strong></p><p>Three additional terms have passed while server S3 was offline, and server S3 still believes he is the leader while he is down. The new leader, on the other hand, continues to work as usual while overseeing the cluster. It’s now time to bring up S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*2V-0CbORrBaflD45eO2EhA.png" /></figure><p><strong>Step 3: Rise of S3</strong></p><p>Server S3 wakes up and believes he is the leader. If he sends a command to any of the followers, the followers will alert S3 to the presence of a new leader, and it will instantly revert to the follower state and await commands from S4. This completes the leader correction. Let us now bring S3’s logs back up to date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*lQiAehCkRE_Ws3b9TnoDRA.png" /></figure><p><strong>Step 4: A new request in the cluster</strong></p><p>Assume a new request has been made to the leader. The leader broadcasts an AppendEntry RPC to all followers, together with the previous log-term and log entries. Except for S3, all of the followers agree with the RPC. Raft guarantees that the logs will be free of holes. Since S3’s logs have not been updated, it is unable to add anything new to its log. While S3 waits for log rectification, the other followers accept the logs and commit them to their logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*DwMybaxPR0SWBrKx2i3_dQ.png" /></figure><p><strong>Step 5: Begining log correction for S3</strong></p><p>Inconsistencies are handled by the leader by pushing the followers’ logs to duplicate their own. Conflicting entries in follower logs will be overridden by entries from the leader’s log. To reconcile a follower’s log with the leader’s, the leader must locate the most recent log entry where the two logs agree, delete any entries in the follower’s log after that point, and transmit the follower all of the leader’s entries after that point. All of these activities occur in response to the AppendEntries RPCs’ consistency check. The leader keeps a nextIndex for each follower, which is the index of the next log entry sent to that follower by the leader. When a leader takes power for the first time, it sets all nextIndex values to the index directly after the last one in its log. If a follower’s log differs from the leader’s, the AppendEntries consistency check will fail in the subsequent AppendEntries RPC. The leader decrements nextIndex and retries the AppendEntries RPC after a rejection. NextIndex will eventually reach a point when the leader and follower logs match. When this occurs, AppendEntries succeeds, removing any conflicting entries from the follower’s log and appending entries from the leader’s log (if any). When AppendEntries succeeds, the follower’s log matches the leader’s, and it will remain that way for the duration of the term.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*m1WWvssyarWflsEkcB_QIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*JV7kIONZRikTc0SZuyLfkA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*eGADcfurDdgcTiiul90zxg.png" /></figure><p>The leader now finds the point where the leader’s log and S3’s logs match. Now the leader will start populating S3’s log with the latest logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*bAc6KriiblgX3XQF53lfPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*c8aA6NYgYVtJ00yB68nf5w.png" /></figure><p>The replication happens one by one until S3 is up to pace with S4.</p><h3>Raft in Coachroach DB</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tlFbJ_wtkCsViL0HRcY4-A.png" /></figure><p>If you’ve heard of cockroach DB. You may have heard that data is stored in what is known as keyspaces. Keyspaces are a linearly ordered set of key-value pairs that include where it lives as well as the row’s primary key. The cluster then separates the keyspaces into what are known as ranges. Ranges are 64MB data blocks that are duplicated across at least three nodes in the cluster to ensure consistency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*0__bp_3q3YOs6KaQ.png" /></figure><p>You may want to replicate these ranges across geolocations to encourage faster reads across zones. Cockroach DB divides the ranges into their own consensus group. Because a node can store several ranges. Because of this architecture, a node can be a member of numerous consensus groups. As more nodes are added to the cluster, the number of heartbeats necessary to keep the leader grows. As a result, just from the heartbeat, there is a massive spike in traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*QzyuPE43q7vpzqEP.png" /></figure><p>The above graphic clearly shows that there is a lot of traffic in the system even when the system is idle. Furthermore, the number of ranges is far greater than the number of nodes in the cluster, so traffic only multiplies when new nodes are added. To address this issue, Cockroach DB created a new feature in Raft called a multi raft.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*6JP7lGU-BrAuDqsu.png" /></figure><p>The problem of increased traffic is solved by utilising MultiRaft (and just one Raft instance per Node — Store in Cockroach source code language — rather than per Range). CockroachDB coalesces/uncoalesces heartbeats in a single response/request.</p><p>Coachrach DB caches rpc connections between nodes and uses the periodic heartbeat to compute clock skew and link latency. Individual raft consensus groups communicate over these established links as needed, but they do not generate the heartbeats. To assess whether to become candidates, followers in consensus groups examine the health of connections (i.e. whether or not a heartbeat was received inside the last heartbeat interval) after their timeouts expire.</p><p>Here’s how the transport looks like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*a_mFCuk-EKZ1lYSb_fVmgg.png" /></figure><h3>Raft in Mongo DB</h3><p>Then there’s everyone’s favourite Mongo DB. Except for a few variations, Mongo DB and raft have a lot in common. Let’s go through the differences 1 by 1.</p><ol><li><strong>Apply first then replicate:</strong> When the commander receives a new command in the raft. Before committing to the changes, the leader first communicates them to the followers. Mongo DB takes a different approach, with the primary returning an acknowledgement that the data has been written to one of the nodes right away. Changes are then propagated between nodes, giving rise to the concept of read and write concerns in Mongo DB.</li><li><strong>Pull vs push based algorithm: </strong>In contrast to raft, where the leader is responsible for propagating changes among nodes. Chained replication is a feature of Mongo DB that allows a node to bring in updates from the nearest follower, allowing for faster replication and reduced strain on the primary aka leader.</li><li><strong>Configurable Election Timeouts: </strong>Raft sends election timeouts to machines at random, however, if the primary network is slow, this can result in a lot of elections in the network. Mongo DB allows users to change the election timeout (rule of thumb: average time of the network going down).</li><li><strong>Priorities: </strong>Mongo DB also allows you to assign server priorities. Whereas priority 0 indicates that the server will never run for election, if you have a data centre that you know is exceptionally strong, you might assign it the highest priority so that it can frequently become a leader.</li></ol><h3>References:</h3><ol><li><a href="https://www.youtube.com/watch?v=6JZdJ2J6mek&amp;ab_channel=MongoDB">pv0 to Hero: A Brief History of the Consensus Protocol</a></li><li><a href="https://raft.github.io/raftscope/index.html">Raft Scope</a></li><li><a href="https://www.youtube.com/watch?v=vYp4LYbnnW8&amp;t=338s&amp;ab_channel=DiegoOngaro">Designing for Understandability: The Raft Consensus Algorithm</a></li><li><a href="https://arxiv.org/pdf/2004.05074.pdf">Paxos vs Raft: Have we reached consensus on<br>distributed consensus?</a></li><li><a href="https://raft.github.io/raft.pdf">In Search of an Understandable Consensus Algorithm</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19b767c87f95" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/raft-consensus-algorithm-and-leader-election-in-mongodb-vs-coachroachdb-19b767c87f95">Raft consensus algorithm and leader election in MongoDB vs CoachroachDB</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Going Online. A look into how domain names turn to IP addresses.]]></title>
            <link>https://medium.com/swlh/going-online-a-look-into-how-domain-names-turn-to-ip-addresses-6f60f422536a?source=rss-12897968aefc------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f60f422536a</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[intenet]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[aesher9o1]]></dc:creator>
            <pubDate>Sat, 06 Mar 2021 08:06:27 GMT</pubDate>
            <atom:updated>2021-03-06T08:14:57.929Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YlppS_CC8aX5yyDT9gh0eQ.png" /></figure><p>We have been exploring the internet for ages. Typing in the domain name and somehow find the website magically open. This Saturday I try to demystify most of the stuff and try to crunch in as many information about how your domain name is resolved into a website.</p><h4>Table of content</h4><ul><li><a href="#5043">DNS records (getting your website live)</a></li><li><a href="#6ba6">DNS Lookup</a></li><li><a href="#0bac">OSI models</a></li><li><a href="#5fc6">TLS Handshake</a></li><li><a href="#8a32">SSL Certificate Verification</a></li><li><a href="#06f8">Perfect Forward Secrecy and Diffie Helman</a></li><li><a href="#589c">Extras: DNS Poisoning</a></li><li><a href="#cd7c">Extras: How to shut down the internet and DNSSEC</a></li></ul><h3>DNS records (getting your website live)</h3><p>Getting a domain is easy. Few clicks, few dollars and bam you have your fancy new website. Thereafter lies a few technical stuff you should know before you can host your website and emails and show them off to the world. Let’s understand the necessary DNS records you need to know to set up your server.</p><ol><li>NS Records (Nameserver Records): NS Resource Records are records in the DNS database to determine which authoritative name servers are used for the domain. The DNS database is used to convert (sub)domain names to IP addresses. They work as a distributed telephone book. Records are kept in cache for a time (mostly 24 hours) that’s why it often requires at least 24 hours to change a domain. (Else the old value van still be stored somewhere in a cache. Supposedly you buy your domain from GoDaddy then by default GoDaddy will be the authoritative server pointing to your website. <strong>NS records exist SOLELY to define WHICH NAMESERVERS are responsible for a particular domain.</strong></li><li>A Records (Address Mapping records): Once your machine finds the authoritative server having the details of your website. The machine then queries for the A records for the domain. The A records contain the hostname as well as the IP address of the server where your files/website are hosted. The A records consist of the name of the record, the address of the server and the TTL (Time to live for the record), this specifies the amount of time the record is allowed to be cached by a resolver. The A records stores IPv4 addresses.</li><li>AAAA Records (IP Version 6 Address record): Same functionality as A records but it saves the IPv6 records.</li><li>CNAME Records (Canonical Name record): A CNAME record is used to point a domain to another domain. When a DNS client requests a record that contains a CNAME, which points to another hostname, the DNS resolution process is repeated with the new hostname.</li><li>MX Records (Mail Exchange records): Specifies an SMTP email server for the domain, used to route outgoing emails to an email server.</li><li>PTR Records (Reverse-lookup Pointer records): A DNS pointer record (PTR for short) provides the domain name associated with an IP address. A DNS PTR record is exactly the opposite of the ‘A’ record, which provides the IP address associated with a domain name. They are used for reverse domain lookups. Some email anti-spam filters use reverse DNS to check the domain names of email addresses and see if the associated IP addresses are likely to be used by legitimate email servers. If a domain has no PTR record, or if the PTR record contains the wrong domain, email services may block all emails from that domain.</li><li>CERT Records (Certificate record): Stores encryption certificates — PKIX, SPKI, PGP, and so on. CERT records are used for generically storing certificates within DNS and are most commonly used by systems for email encryption. To create a CERT record, you must specify the certificate type, the key tag, the algorithm, and then the certificate, which is either the certificate itself, the CRL, a URL of the certificate, or fingerprint and a URL.</li><li>SRV Records (Service Location records): A record that advertises a service and how to connect with it. SRV records help with service discovery. For example, SRV records are used in Internet Telephony to define where a SIP service may be found. An SRV record typically defines a symbolic name and the transport protocol used as part of the domain name. It defines the priority, weight, port, and target for the service in the record content.</li><li>TXT Records: Text records were originally intended to be human-readable metadata but now they are mostly served as placing machine-readable metadata to verify domain ownership etc.</li></ol><h3>DNS Lookup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/0*cOwfSYUWmvFHltTc.gif" /></figure><ol><li>A client sends a recursive query to a <strong>DNS name server</strong> to request the IP address that corresponds to the name ftp.contoso.com. A recursive query indicates that the client wants a definitive answer to its query. The response to the recursive query must be a valid address or a message indicating that the address cannot be found.</li><li>Because the DNS server is not authoritative for the name and does not have the answer in its cache, the DNS server uses root hints to find the IP address of the DNS root server.</li><li>The DNS name server uses an iterative query to ask the <strong>DNS root server</strong> to resolve the name ftp.contoso.com. An iterative query indicates that the server will accept a referral to another server in place of a definitive answer to the query. The query lands on one of the 13 DNS root servers. Now to clear things out, the root servers work in a cluster and are accessible to the world by only 13 IP addresses. Because the name ftp.contoso.com ends with the label com, the DNS root server returns a referral to the Com server that hosts the com zone.</li><li>The DNS server uses an iterative query to ask the Com server (<strong>Top Level Domain Server for com domain</strong>)to resolve the name ftp.contoso.com. Because the name ftp.contoso.com ends with the name contoso.com, the Com server returns a referral to the Contoso server that hosts the contoso.com zone.</li><li>The DNS server uses an iterative query to ask the Contoso server to resolve the name ftp.contoso.com (<strong>Authoratative Name Server</strong>). The Contoso server finds the answer in its zone data and then returns the answer to the server.</li><li>The server then returns the result to the client.</li></ol><h3>OSI Model</h3><p>Now that we know how do we tell the name servers where we exist and how our PC will ask the name server where our website exists. Let’s talk a bit about what happens during the connection. For that, we’ll first take a glance at the OSI Model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*RTq8rsdSn_C22w2G.jpg" /></figure><p>A quick mnemonics I use to remember the order is<strong> A Penguine said that nobody drinks Pepsi. </strong>Just a handy tip. Since most of the things are covered in the diagram I’ll try to explain OSI with a short story.</p><p>Suppose you are the CEO of a French company and want to transfer some document to an English speaking company. You being the CEO at the <strong>application layer</strong>, act as the point of contact and are involved with all the communication. Suppose you draft a 400-page message to be transferred to another company. It’s then the role of the presentation layer to convert your document written in French to English. As the <strong>translator</strong>, the<strong> presentation layer </strong>converts the data sent by the application layer of the transmitting node into an acceptable and compatible data format based on the applicable network protocol and architecture. Upon arrival at the receiving computer, the presentation layer translates the data into an acceptable format usable by the application layer. The function could include Character-Code Translation, Data Conversion, Data Compression, Data Encryption and Decryption etc. Then the document is passed on to the <strong>session layer, </strong>who’s job is to call the other company and establish communication that a document will be sent to them. The session layer tracks the dialogues between systems, which are also called sessions. This layer manages a session by initiating the opening and closing of sessions between end-user application processes. At the <strong>transport layer, </strong>the document sent by the application layer is broken down into segments so that it can be sent as a chunk. Suppose a chunk is misplaced then the whole document will not be lost. This includes taking data from the session layer and breaking it up into chunks called segments before sending it to layer 3. The transport layer is also responsible for flow control and error control. Flow control determines an optimal speed of transmission to ensure that a sender with a fast connection doesn’t overwhelm a receiver with a slow connection. The transport layer performs error control on the receiving end by ensuring that the data received is complete, and requesting retransmission if it isn’t. The packet is then sent to the <strong>network layer </strong>which decides the route to take to reach the other company. The network layer also finds the best physical path for the data to reach its destination; this is known as routing. And is responsible for the frame creation adding a to and from the address on the frames. It talks about IP addresses and routing of packets to achieve end-to-end communication. The <strong>data link layer talks about </strong>Ethernet, WiFi, Bluetooth, etc. — talks about network cards, links between them and allows the creation of local networks (via dedicated or shared media). In the OSI model Network layer is responsible for the <strong>‘source-to-destination’</strong> delivery of a packet possibly across <strong>multiple networks( links )</strong>, whereas the data link layer oversees the delivery of the packets btw <strong>‘two’</strong> systems on the same network. And then the <strong>physical layer</strong> converts the data into electrical signals and the data is thus sent.</p><h3>TLS Handshake</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MW7AhwkrBemSJZEu.png" /></figure><p>The TLS Handshake involves the following steps.</p><ol><li>Client Hello: The client expresses their interest in connecting with the server. The client presents it’s cypher suites to the server. The server makes the decision of what cypher suite will be ultimately used for the communication based on the latest version of the suite that it can support. There are various parts to a cypher suite. <br>1. Protocol: TLS 1.3, TLS 1.2, SSL V3, SSL V2 <br>2. Key Exchange: Diffie Helman or RSA<br>3. Authentication (used to authenticate the server): RSA, Elliptic Curve Digital Signature Authentication<br>4. Cipher (dictates the algorithm that will be used to encrypt the data): Advanced Encryption Standard(GCM/CBC), Camellia<br>5. Message Authentication Code (dictates the method the connection will use to carry out data integrity checks.): Secure Hash Algorithm, MD5<br>So a dummy cypher suite might look like <strong><em>TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, </em></strong>which says that the protocol that will be used is TLS, They key exchange method will be an elliptic curve, Diffie Helman, with RSA mechanism for a handshake and AES with 128 session encryption size AES GCM version of cypher with SHA 256 digest size</li><li>Server Hello: The server chooses the cypher suite that it will be using along with the certificate that contains the public key of the server that initiates the asymmetric encryption that is necessary to begin the symmetric encryption. The client then uses that public key to encrypt things it’ll be sending to the server. Also, the client then checks for the certificate validity.<br>The certificate contains the following thing.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*CtTOhSccvjch2Pn7o89gdg.png" /></figure><p>1. Version Number: X.509 is a standard format for public key certificates, digital documents that securely associate cryptographic key pairs with identities such as websites, individuals, or organizations.<br>2. Serial Number: Unique number assigned by the certificate authority<br>3. Signature Algo: The algorithm used by the certificate authority to sign the certificate RSA or SHA 256<br>4. Signature Hash Algorithm: The big certificate is hashed into a small chunk and Signature Hash Algo defines the algorithm used for it(SHA 256)<br>5. Issuer: Certificate Authority<br>6. Valid from and Valid to<br>7. Subject: Common Name, State, Locality etc<br>8. Public Key: The key that will be used by the client to communicate with the server<br>And more…</p><p>The server then also responds with a Hello Done message saying all the information has been communicated to the client.</p><p>3. Change Cypher Spec (Client Finished): At this point, the client has the public key of the server. The client then generates the pre-master secret key and sends it back to the server. The client also then sends a client finished message saying that it has sent all the necessary details for the server. The client also calculates a symmetric key and stores it to itself for future bulk encryption use.</p><p>4. Change Cypher Spec (Server Finished): The server calculates the symmetric key and saves it for further communication</p><p>5. Bulk Data Transfer: The communication started now.</p><h3>SSL Certificate Verification</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/0*0vipsgo81LHPHhdp.png" /></figure><p>During SSL/TLS connections, the server authenticates according to the handshake and record protocols. When initiating the handshake protocol, the server presents a signed X.509 certificate to the client. The X.509 certificate’s signature must be verified by the client before establishing an HTTPS connection. The required format and information contained in an X.509 certificate enable the client to confidently authenticate and verify the integrity of the certified identity.</p><p>Client browsers and applications rely heavily on their trust in Certificate Authorities(CA) for proper validation of X.509 certificates. Every client application and Operating System (OS) maintains a list of trusted Root CA Certificates, this list is called a “Trust Store.” For example, at the current time of writing, the Firefox trust store holds 150 root certificates that are automatically trusted by their web browser.</p><p>As part of the X.509 verification process, each certificate must be signed by the same issuer CA named in its certificate. The client must be able to follow a hierarchical path of certification that recursively links back to at least one root CA listed in the client’s trust store.</p><p>There are three basic types of entities that comprise a valid chain of trust: Root, Intermediate, and End-entity.</p><ol><li>Root Certificate (Trust Anchor): A Root certificate is a self-signed certificate that follows the standards of the X.509 certificate.</li><li>Intermediate Certificate (The Issuing CA): At least one intermediate certificate will almost always be present in an SSL certificate chain. They provide a vital link to enable the Root CA to extend its trustworthy reputation to otherwise untrustworthy end-entities. The issuing CA functions as middlemen between the secure root and server certificate. This allows the Root CA to remain securely stored offline, providing an extra level of security. Trust in the root CA is always explicit. Each operating system, 3rd party web browsers, and custom applications ship with over 100 pre-installed trusted root CA certificates. In contrast, non-root certificates are implicitly trusted and are not required to be shipped with an OS, web browser, or certificate-aware application.</li><li>Server Certificate (The End Entity): The end-entity provides critical information to the issuing CA via a Certificate Signing Request form. The certificate is then signed and issued by a trusted CA, attesting that the information provided was correct at the issuance time. The SSL connection to a server will fail if the certificate has not been verified and signed.</li></ol><h3>Perfect Forward Secrecy and Diffie Helman</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*VGsjQcOb9nBcWSoE3-s9RA.png" /></figure><p>In normal traffic encryption, the client uses the server’s public key to generate a per master secret and the server then uses its private key to help generate a session secret. If in future the server’s private key is compromised all communication, past and future can be decrypted and read by the malicious actor. Perfect forward secrecy is an attempt to solve this problem.</p><p>In cryptography, forward secrecy (FS), also known as perfect forward secrecy (PFS), is a feature of specific key agreement protocols that gives assurances that session keys will not be compromised even if long-term secrets used in the session key exchange are compromised.</p><p>For HTTPS, the long-term secret is typically the Private signing key of the server. Forward secrecy protects past sessions against future compromises of keys or passwords. By generating a unique session key for every session a user initiates, the compromise of a single session key will not affect any data other than that exchanged in the specific session protected by that particular key.</p><p>One of the widely used algorithms for this is the Diffie Helman. Let’s look at how it works.</p><p>Suppose Alice and Bob want to talk to each other securely without Eve knowing what they are talking about. And the communication needs to take place through symmetric cryptography.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3SGxJoGowqYY_4-aAk6tIQ.png" /></figure><p>Let’s try to understand the above diagram with a bit of math.</p><p>Alice and Bob agree to use the prime p = 941 and the primitive root g = 627. Alice chooses the secret key a = 347 and computes A = 390 ≡ 627347 (mod 941). Similarly, Bob chooses the secret key b = 781 and computes B = 691 ≡ 627781 (mod 941). Alice sends Bob the number 390 and Bob sends Alice the number 691. Both of these transmissions are done over an insecure channel, so both A = 390 and B = 691 should be considered public knowledge. The numbers a = 347 and b = 781 are not transmitted and remain secret. Then Alice and Bob are both able to compute the number the secret key 470.</p><h3>Extras: DNS Poisoning</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*52Q8h6Hxz-9e86GlTCXQtw.png" /></figure><p>As explained above. DNS queries are cached every time your ISP or your PC resolves it. The cache remains valid until the TTL(time to live) for the cache does not expire.</p><p>Instead of using TCP, which requires both communicating parties to perform a ‘handshake’ to initiate communication and verify the identity of the devices, DNS requests and responses use UDP or the User Datagram Protocol. With UDP, there is no guarantee that a connection is open, that the recipient is ready to receive, or that the sender is who they say they are. UDP is vulnerable to forging for this reason — an attacker can send a message via UDP and pretend it’s a response from a legitimate server by forging the header data. If a DNS resolver receives a forged response, it accepts and caches the data uncritically because there is no way to verify if the information is accurate and comes from a legitimate source. Despite these major points of vulnerability in the DNS caching process, DNS poisoning attacks are not easy. Because the DNS resolver does actually query the authoritative nameserver, attackers have only a few milliseconds to send the fake reply before the real reply from the authoritative nameserver arrives.</p><h3>Extras: How to shut down the internet and DNSSEC</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9uudXVyWFB6rV-_RTzqOqg.png" /></figure><p>DNS lookup happens over UDP. The main downside of UDP is that unlike TLS UDP does not require a handshake for communication. Thus is much vulnerable to man in the middle attacks. Suppose your root server asks the authoritative server the location of medium.com. A man in the middle, if he is fast enough to read the packet can quickly give some other IP for the query and the root server will trust it.</p><p>To protect us from this impersonation, <strong>The Domain Name System Security Extensions</strong> (DNSSEC) was introduced. DNSSEC ensures that the source is actually the source it’s claiming to be. To understand how it works I’ll introduce one more term to you called the <strong>Chain of Trust.</strong></p><p>As mentioned in the above section. Your query from your ISP goes to the root server, which then forwards it to the respective top-level domain which forwards them to the correct authoritative server to resolve the IP of a website. For this to happen correctly. The ISP must trust the root servers saying that it’ll give the correct answer, the root servers must trust the Top Level Domain Servers and the TLDs must trust your server. This is how the chain is established. Since it is such a crucial part of the internet and organization called <strong>The Internet Corporation for Assigned Names and Numbers </strong>(ICANN) oversees the process to see it happens smoothly.</p><p>ICANN in 2010 signed the 13 root servers, saying that they trust these resources thereby letting the root server delegate some judicial powers. The TLDs in turn then gets a certificate from the root servers since the trust the root servers. And the root servers can trust the TLDs now based on the signatures they have given to them. The TLDs then give certificates to the authoritative name servers signing their DNS records.</p><p>To sum up, when the recursive server asks the root server the location of google.com. The root server replies with the IP of the TLD server and the corresponding public key of the server. Since we trust the root server we trust the public key provided by the root server. TLD when sending the referral for the authoritative name server sends the public key to the authoritative name server, we receive the request, since we had the key to the TLD we can verify if the response is received by the TLD and finally by google.com’s authoritative name server.</p><p>Now with that out of the way. How do we shut off the internet then? Remember ICANN? The one that signs the 13 name servers. For signing the name servers they use asymmetric cryptography. The public key is then distributed to everyone and the private key is stored in a very very very safe location by ICANN in a safe with FBI grade security. The private keys are stored in 4 hardware security modules. 2 at a place and the rest 2 placed 2500 miles apart just for redundancy. To get to the HSM modules apart from military-grade security need smart cards. Which are held by 7 people in the world (actually 14, 7 people more for redundancy). If the DNS is compromised. 5 of the 7 people are required to visit the facility to open the HSMs to reset the private key or worst shut down the DNS which will invalidate the root servers and all other servers down the chain.</p><p>References</p><ol><li><a href="https://i.imgur.com/5T2fJsG.png">Big diagram of the blog</a></li><li>Cloudflare blog</li><li><a href="https://www.youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg">Hussein Nasser</a></li><li><a href="https://www.youtube.com/channel/UCtVHX3fmQVjVgj_cGRIxRSg">F5 DevCentral</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f60f422536a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/going-online-a-look-into-how-domain-names-turn-to-ip-addresses-6f60f422536a">Going Online. A look into how domain names turn to IP addresses.</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitoring PageSpeed and CrUX scores across builds]]></title>
            <link>https://aesher9o1.medium.com/monitoring-pagespeed-and-crux-scores-across-builds-acb479a3be74?source=rss-12897968aefc------2</link>
            <guid isPermaLink="false">https://medium.com/p/acb479a3be74</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[page-speed]]></category>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[aesher9o1]]></dc:creator>
            <pubDate>Sat, 02 Jan 2021 21:04:59 GMT</pubDate>
            <atom:updated>2021-01-02T21:04:59.609Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*Fixb7NQOm8pQjPwQ.png" /><figcaption>Automating web audits with AutoWebPerf</figcaption></figure><p>“Today we’re announcing that the page experience signals in ranking will roll out in May 2021. The new page experience signals combine Core Web Vitals with our existing search signals including <a href="https://webmasters.googleblog.com/2015/02/finding-more-mobile-friendly-search.html">mobile-friendliness</a>, <a href="https://webmasters.googleblog.com/2016/09/more-safe-browsing-help-for-webmasters.html">safe-browsing</a>, <a href="https://webmasters.googleblog.com/2016/11/heres-to-more-https-on-web.html">HTTPS-security</a>, and <a href="https://webmasters.googleblog.com/2016/08/helping-users-easily-access-content-on.html">intrusive interstitial guidelines</a>.” Said <a href="https://developers.google.com/search/blog/2020/11/timing-for-page-experience">a blog</a> published on November 10, 2020. That’s when the world started taking page speed scores seriously.</p><p>Previously our team would go measure the scores of our website on PageSpeed Insights. Repeat the experiment multiple times and average out the result to get a clear picture of the score. This consumed a significant time in our ship cycle.</p><p>Introducing <a href="https://web.dev/autowebperf/">Autowebperf</a>, the tool enables automatic gathering of performance data from multiple sources Chrome UX Report, PageSpeed Insights, or WebPageTest and can be set to continuously monitor the site performance in one place.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FxT1XGzXhVgWRLN1Cco%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FxT1XGzXhVgWRLN1Cco%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FxT1XGzXhVgWRLN1Cco%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/295664dee0ade338fbf1a1f288589bd7/href">https://medium.com/media/295664dee0ade338fbf1a1f288589bd7/href</a></iframe><h4>Step 1: Clone the project</h4><pre>1. git clone https://github.com/GoogleChromeLabs/AutoWebPerf.git<br>2. npm install</pre><h4>Step 2: Generating the service account for google sheets</h4><pre>1. Visit: <a href="https://console.cloud.google.com/iam-admin/serviceaccounts">https://console.cloud.google.com/iam-admin/serviceaccounts</a> and create a new service account</pre><pre>2. Add a key for the newly created service account and download it. BEWARE the key cannot be downloaded again so keep it safe.</pre><pre>3. Copy the email address given in the service account details.</pre><pre>4. Enable Sheet API for the project</pre><h4>Step 3: Generating the data dump sheet</h4><pre>1. Create a new google sheet with 2 pages, <strong>Tests</strong> and <strong>Results. </strong></pre><pre>2. The Tests sheet should have the following headers. <br><strong>-</strong> <strong>url<br>- label<br>- gatherer<br>- cruxapi.settings.urlType<br>- cruxapi.settings.formFactor<br></strong>Where gatherer says the tool you want to collect the metric from (we are using cruxapi). Hence urlType says if the URL is a PAGE or ORIGIN. and formFactor specifies if the device used should be a DESKTOP, PHONE or a TABLET.</pre><pre>3. Add the email id copied as an editor to your project.</pre><h4>Step 4: Creating CrUX API key</h4><pre>1. Visit <a href="https://developers.google.com/web/tools/chrome-user-experience-report/api/guides/getting-started">https://developers.google.com/web/tools/chrome-user-experience-report/api/guides/getting-started</a> to get a keu for the CrUX API.</pre><h4>Step 5: Test Run</h4><pre>1. Coming back to the terminal. cd into the project.</pre><pre>2. Paste the service account key in the project at key.json</pre><pre>3. Run the following command<br>SERVICE_ACCOUNT_CREDENTIALS=./key.json CRUX_APIKEY=MY_API_KEY ./awp run sheets:[MY GOOGLE SHEET ID]/Tests sheets:[MY GOOGLE SHEET ID]/Results</pre><pre>4. Visit the sheet to see if data were populated in the results section.</pre><p><strong>Step 6: Making the dashboard</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DNKovVkFxe8WWLhsuV3qUA.png" /><figcaption>Data gathering dashboard</figcaption></figure><pre>1. Click on the &quot;Use Template&quot; button on the top left of the <a href="https://datastudio.google.com/reporting/5f7b6c8c-cae2-4cf2-97a4-06af250a0039/page/X6nFB/preview">DataStudio template.</a></pre><pre>2. Click on the &quot;New Data Source&quot; Dropdown and select &quot;Create New Data Source&quot;.</pre><pre>3. Select the &quot;Google Shets&quot; Google Connector.</pre><pre>4. Look for your Google Sheets file, select the &quot;Results&quot; Tab and click on &quot;Connect&quot;.</pre><h4><strong>Step 7: Scheduling Cronjobs for automated monitoring</strong></h4><pre>1. Run crontab –e to open the editor</pre><pre>2. Add the following entry<br>0 12 * * * SERVICE_ACCOUNT_CREDENTIALS=./key.json CRUX_APIKEY=MY_API_KEY cd ~/workspace/awp &amp;&amp; ./awp run sheets:[MY GOOGLE SHEET ID]/Tests sheets:[MY GOOGLE SHEET ID]/Results<br>This will schedule a cron job to run daily at 12.00 noon.</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FSwx36wwSsU49HAnIhC%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2FSkyTV-harry-potter-drinking-slide-in-dms-Swx36wwSsU49HAnIhC&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2FSwx36wwSsU49HAnIhC%2Fgiphy.gif%3Fcid%3D790b761114da740533ac3be058b1206f0484047b6f8c45d1%26rid%3Dgiphy.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/f16027cd939472f37e11d4802ccb50c7/href">https://medium.com/media/f16027cd939472f37e11d4802ccb50c7/href</a></iframe><h3>ALL DONE.</h3><p>PS: The blog is heavily inspired by <a href="https://github.com/GoogleChromeLabs/AutoWebPerf">https://github.com/GoogleChromeLabs/AutoWebPerf</a>. Do give it a look to dive into deeper implementation and use-cases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acb479a3be74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t Sleep- Secret sauce to becoming a Sannin Developer]]></title>
            <link>https://aesher9o1.medium.com/dont-sleep-secret-sauce-to-becoming-a-sannin-developer-f738d23f05f4?source=rss-12897968aefc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f738d23f05f4</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[burnout]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[junior-developer]]></category>
            <dc:creator><![CDATA[aesher9o1]]></dc:creator>
            <pubDate>Tue, 03 Nov 2020 04:45:33 GMT</pubDate>
            <atom:updated>2020-11-05T15:46:19.644Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Yes, Genin, Chunin, Jonin, Kage and Sannin from naruto. Better than SDE I, II, III, Architect and linus torvalds mode, no?" src="https://cdn-images-1.medium.com/max/1024/1*tt47QE4PlQvlMNqLDRzpeg.jpeg" /></figure><p>Yes, you heard me right. If you want to be one of the Sannin, YOU DO NOT SLEEP. Not for a day, a minute, even a second. Before misjudging, allow me to explain further. The question to ask is, what is sleep? Google has an answer for it.</p><blockquote>Sleep: a condition of body and mind that typically recurs for several hours, in which the nervous system is relatively inactive, the eyes closed and consciousness practically suspended.</blockquote><p>I am relatively new to this world, 22 years of survival isn&#39;t a lot. But long enough to realise that there are two kinds of people, one with a clear goal, knowing where they stand, where they want to go and what steps they must take in order to reach there. The steps might not be correct, the goal might not be far fetched. But they have a goal and they know their position. The media has glorified these people for long, so I rather not talk about them.</p><p>The second kind of people are those who are pretty chilled in their life. Their <strong>nervous system is relatively inactive, </strong>they do not care about any stimulus from the outside world. Got a deadline tomorrow? While Type 1 people with fret the loss the second kind of people rather prefer to close all their senses and relax. Got an exam coming? relax. Got a meeting? relax. You know how this ends.</p><p>They <strong>keep their eyes shut </strong>and<strong> consciousness practically suspended</strong>, not keeping an eye on their competitors or any emerging technologies. I believe a healthy competition and some criticism is a must for anyone to grow. Making some friends and foes, measuring their growth against yours could help you a lot to stop procrastinating. You might be “talented and flawless” but <em>Hard work beats talent when talent doesn’t work hard. </em>Same goes for technologies, they evolve every day and if you think you “don’t” want/have the time to keep up with new trends, the tech world is not for you. As developers, we work on a lot of open-source projects, without following the existing bugs in you stack and the bugs that have been resolved during updates, you might just be reinventing the wheels.</p><p>You might trash me for saying “not sleeping for a, not for a day, a minute, even a second”. And I know it’s impossible too. Sleep metaphorically in this article is as important as it is in its literal sense. In a literal sense, sleep helps you in <strong>cellular restoration, restore brain function, emotional well-being </strong>to name some. The 8–9 hours they talk about is “necessary sleep” which in development terms you can relate to “burnouts and vacation”. Oversleeping and you might be depressing your body functions.</p><p>I am not against vacations and Netflix and treks (metaphorically referred to as sleep here). Like mentioned above those are “necessary vacations” to avoid burnout, “not sleeping for a day, a minute, even a second” is an ideality point. How much you defer from it varies from person to person. There is no one size that fits all. I do not see the “necessary vacations” as sleeping. Anything that makes you better than what you were yesterday is obviously training. It’s oversleeping that I count as <strong>sleep </strong>in my metaphors. Partying when you don’t have to, drinking when you had to finish the review paper once and for all, lying when you have a list of promises you made to yourself that’s what I call <strong>sleeping</strong>.</p><p>I know it’s all complicated and I must have failed to explain most of my thoughts. Afterall I am neither a writer nor a doctor. Just a Genin Developer striving to become a Sannin.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f738d23f05f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Circuit Breakers in Javascript & Opossum]]></title>
            <link>https://javascript.plainenglish.io/circuit-breakers-in-javascript-opossum-bcd65c2ce9bd?source=rss-12897968aefc------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcd65c2ce9bd</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[circuit-breaker]]></category>
            <category><![CDATA[opossum]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[aesher9o1]]></dc:creator>
            <pubDate>Fri, 11 Sep 2020 03:26:39 GMT</pubDate>
            <atom:updated>2020-09-11T15:41:28.149Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding Circuit Breakers in JavaScript by dissecting Opossum</h3><h4>Understanding circuit breaker pattern and implementation on Opossum</h4><figure><img alt="This was legit just to grab your attention" src="https://cdn-images-1.medium.com/max/700/0*wE9fusMEGcI3uEhB.jpg" /><figcaption>A cute picture of a Pygmy Possum to get more people interested in failing gracefully</figcaption></figure><p>A request could hog up your resource from <a href="https://tools.ietf.org/id/draft-thomson-hybi-http-timeout-00.html#rfc.section.1.1">30 to 120 seconds </a>if it isn&#39;t given a response. In a 2 tier architecture of a client and server, this might not be as disastrous, but if your server relies on many other microservice which in turn depend on other microservices this persistent connection can cascadingly consume resource across your network. This catastrophic cascade could be easily saved by Circuit Breaker pattern.</p><p>Broadly looking, a Circuit Breaker is a wrapper over a function that watches for errors and fails the request gracefully after a certain threshold is reached. The function also keeps a count of errors and *trips* the circuit breaker blocking further requests to call the unresponsive server. Let us dive a bit more on this.</p><h3>Circuit Breaking: Understanding Opossum library</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/0*GzX-78Ci6COHpspw.png" /></figure><h4>Initial variables</h4><pre>// snippet from line 54-67 and 170-173<br>//<a href="https://github.com/nodeshift/opossum/blob/bd59b4860ce412608c520c757af1bf2b9398577b/lib/status.js#L146">https://github.com/nodeshift/opossum/blob/bd59b4860ce412608c520c757af1bf2b9398577b/lib/status.js#L146</a></pre><pre>// number of buckets in which the CB window should be divided  <br><strong>this[BUCKETS]</strong> = options.rollingCountBuckets; <strong>// DEFAULT:</strong> <strong>10</strong></pre><pre>// window length of the CB<br><strong>this[TIMEOUT]</strong> = options.rollingCountTimeout; <strong>// DEFAULT: 10000</strong></pre><pre>// Bucket where all the calculations will be stored<br><strong>this[WINDOW]</strong> = new Array(this[BUCKETS]); //<strong>QUEUE datastructure</strong></pre><pre>// rotating interval for the bucket<br><strong>const bucketInterval</strong> = Math.floor(this[TIMEOUT] / this[BUCKETS]);</pre><pre>// rotate the window bucket<br><strong>this[BUCKET_INTERVAL]</strong> = setInterval(nextBucket(this[WINDOW]),      bucketInterval);</pre><pre>// rotating logic<br><strong>const nextBucket</strong> = window =&gt; _ =&gt; {  window.pop();  window.unshift(bucket());};</pre><p>Here are the key points of the code<br>1. Make a <strong>WINDOW with 10 buckets<br></strong>2. <strong>Rotate</strong> the bucket every <strong>1 second<br></strong>3. Queue initializing variables (<a href="https://nodeshift.dev/opossum/">default variables of opossum</a>) to WINDOW and dequeue the oldest value<br>4. Store the interval reference in a variable for further use</p><h4>Firing in Opossum</h4><pre>//very very very stripped down overview of call function line 442<br><a href="https://github.com/nodeshift/opossum/blob/master/lib/circuit.js">https://github.com/nodeshift/opossum/blob/master/lib/circuit.js</a></pre><pre>call (context, ...rest) {<br>  <br>    //emit(&#39;fire&#39;);</pre><pre>if (CACHE.get(this) !== undefined) {<br>      // emit(&#39;cacheHit&#39;) and return cache value<br>    } else if (this.options.cache) {<br>      // emit(&#39;cacheMiss&#39;);<br>    }</pre><pre>if (!this.closed &amp;&amp; !this.pendingClose) {<br>      // CB is closed emit(&#39;reject&#39;, error);<br>    }<br>    // emit (&#39;success&#39;) if done<br>    // emit (&#39;timeout&#39;) if not done<br>    // emit (&#39;failure&#39;) if not done</pre><pre>  }</pre><p>The following key points happen in the code.<br>1. emit the fire event as soon as we enter the function<br>2. If caching is enabled and we hit the cache we return the cached value<br>3. If we miss the cache emit the cacheMiss event<br>4. If the circuit breaker is not closed emit the rejected event<br>5. If the function succeeds, increase the succeed counter for the current window.<br>6. If a timeout or failure occurs emit the failure and timeout event,</p><h4>Gathering Window Statistics</h4><pre>//copied from line 93<br>// <a href="https://github.com/nodeshift/opossum/blob/master/lib/status.js">https://github.com/nodeshift/opossum/blob/master/lib/circuit.js</a></pre><pre>// Function that return the default values for a bucket<br>const bucket = _ =&gt; ({  <br>failures: 0,  <br>fallbacks: 0,  <br>successes: 0,  <br>rejects: 0,  <br>fires: 0,  <br>timeouts: 0,  <br>cacheHits: 0,  <br>cacheMisses: 0,  <br>semaphoreRejections: 0,  <br>percentiles: {},  <br>latencyTimes: []});</pre><pre>get stats () {<br>    const totals = this[WINDOW].reduce((acc, val) =&gt; {<br>      if (!val) { return acc; }<br>      Object.keys(acc).forEach(key =&gt; (acc[key] += val[key] || 0));<br>      return acc;<br>    }, bucket());</pre><pre>return totals;<br>  }</pre><p>Requesting for statistics form opossum makes aggregates the statistic from the bucket that has been set by the <strong>rollingCountBuckets </strong>option. It just adds all the value in the window and returns a single object with all the sum.</p><h4>Failing</h4><pre>//this code looks almost same lol from line 678 -703<br><a href="https://github.com/nodeshift/opossum/blob/master/lib/circuit.js">https://github.com/nodeshift/opossum/blob/master/lib/circuit.js</a></pre><pre>function fail (circuit, err, args, latency) {</pre><pre>circuit.emit(&#39;failure&#39;);</pre><pre>const stats = circuit.stats;<br>  if ((stats.fires &lt; circuit.volumeThreshold) &amp;&amp; !circuit.halfOpen) return;<br>  const errorRate = stats.failures / stats.fires * 100;<br>  if (errorRate &gt; circuit.options.errorThresholdPercentage ||<br>    circuit.halfOpen) {<br>    circuit.open();<br>  }<br>}</pre><p>When the code fails we ask from <strong>stats() </strong>and check if the error rate is less than the threshold set by us. If the threshold is crossed we open the circuit breaker. Which then emits the ‘open’ event.</p><h4>Half opening</h4><pre>//again a little stripped down code from line 178 -197<br><a href="https://github.com/nodeshift/opossum/blob/master/lib/circuit.js">https://github.com/nodeshift/opossum/blob/master/lib/circuit.js</a></pre><pre>function _startTimer (circuit) {<br>    return _ =&gt; {<br>      const timer = circuit[RESET_TIMEOUT] = setTimeout(() =&gt; {<br>        circuit[STATE] = HALF_OPEN;<br>        circuit[PENDING_CLOSE] = true;<br>        circuit.emit(&#39;halfOpen&#39;, circuit.options.resetTimeout);<br>      }, circuit.options.resetTimeout);</pre><pre>};<br>  }</pre><pre>this.on(&#39;open&#39;, _startTimer(this));<br>  this.on(&#39;success&#39;, _ =&gt; {<br>    if (this.halfOpen) {<br>      this.close();<br>    }<br>  });<br> <br>}</pre><p>Half opening if the state when the circuit breaker tries to revive. Here we listen for the open event and starts a timer as soon as the event is fire. After the timeout completes we check if the changes the state of the circuit breaker to half-open. If the call succeeds we close the circuit breaker and reset all the values.</p><h3>TLDR: Circuit Breaker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*BoEoaIgll6myOSZ3.png" /></figure><p>A circuit breaker revolves between 3 states:<br><strong>Closed:</strong> When the circuit breaker is functioning normally.<br><strong>Open:</strong> When the circuit breaker has tripped. <br><strong>Half Open: </strong>When the circuit breaker tries to recover.</p><p>The execution of the events are as follows:<br>1: The breaker remains closed as long as the events are successful.<br>2. Increase the number of error count in the window as soon as a call timeouts or fails.<br>3. If the threshold of errors in the window increases a certain limit then we trip the circuit breaker.<br>4. After a certain interval, the circuit breaker tries to recover and enters the half-open state.<br>5. If the subsequent call fails the circuit breaker goes back to open state.<br>6. If the subsequent call succeeds the circuit breaker goes to the open state.</p><h3>Using Opossum in your JavaScript Project</h3><pre>const CircuitBreaker = require(&#39;opossum&#39;);<br><br>function asyncFunctionThatCouldFail (x, y) {<br>  return new Promise((resolve, reject) =&gt; {<br>    // Do something, maybe on the network or a disk<br>  });<br>}<br><br>const options = {<br>  timeout: 3000, // If our function takes longer than 3 seconds, trigger a failure<br>  errorThresholdPercentage: 50, // When 50% of requests fail, trip the circuit<br>  resetTimeout: 30000 // After 30 seconds, try again.<br>};</pre><pre>const breaker = new CircuitBreaker(asyncFunctionThatCouldFail, options);<br><br>breaker.fire(params)<br>  .then(console.log)<br>  .catch(console.error);</pre><p>Footnote: Every npm install is a cost added to your server’s memory and CPU utilization. Deeply understanding the library you install can not only help you save on the cost but also find bottlenecks and let you use the library effectively.</p><h4>JavaScript In Plain English</h4><p>Did you know that we have three publications and a YouTube channel? Find links to everything at <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcd65c2ce9bd" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/circuit-breakers-in-javascript-opossum-bcd65c2ce9bd">Circuit Breakers in Javascript &amp; Opossum</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[State of Web Assembly 2020]]></title>
            <link>https://javascript.plainenglish.io/state-of-web-assembly-2020-674ced038ea8?source=rss-12897968aefc------2</link>
            <guid isPermaLink="false">https://medium.com/p/674ced038ea8</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webassembly]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[aesher9o1]]></dc:creator>
            <pubDate>Sun, 19 Jul 2020 14:32:12 GMT</pubDate>
            <atom:updated>2020-09-11T15:39:02.122Z</atom:updated>
            <content:encoded><![CDATA[<h3>The State of Web Assembly in 2020</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vT5UOoOon2M4fzrx.png" /><figcaption>Architecture of V8</figcaption></figure><p>A benchmarking overview to help you decide when <strong>NOT </strong>to use Web Assembly.</p><p>There’s a new hype in JS world, <strong>Web Assembly. </strong>And those familiar with Turbofan’s compilation pipeline will we very right to argue that the code produced by liftoff skips a lot of steps that a normal javascript. Making your code “hot” faster. As per the rule of thumb on the official Web Assembly page: “ <strong>Use WebAssembly for computationally intensive tasks, such as games, image manipulation, math, physics, audio effects, etc…</strong>.”. The question that strikes first is, why not write every little function in web assembly? Every increment to an integer, every addition. What could the tradeoff be? Well, let’s find out.</p><h4>Configuration used for benchmark</h4><p><strong>Processor:</strong> Intel(R) Core(TM) i5–8265U CPU @ 1.60GHz<br><strong>RAM:</strong> 16GB<br><strong>OS:</strong> Ubuntu 20.04 LTS</p><p><em>Disclaimer. The benchmarking results may vary from PC to PC. The following data should not be taken as the final execution time for WASM and JS files but rather provides a relative comparision to draw a line between JS ans WASM for your calculations. Also the following data compares JS with </em><strong><em>Rust, </em></strong><em>speed with C++ or other languages may vary.</em></p><h4><strong>Aim: Measure the time taken for O(N) and O(N</strong>²<strong>) loops under the following conditions:</strong></h4><p>a. RAW loop time<br>b. Sum of elements of the array passed as a value<br>c. Allocation of memory for an array</p><h3>Benchmark for O(N) loops:</h3><h4>RAW loop time:</h4><pre><strong>//Rust example that iterates over 0 to length(variable)</strong></pre><pre>#[wasm_bindgen]</pre><pre>pub fn loop_time_1d_arr() {</pre><pre>let mut sum = 0;</pre><pre><em>for</em> i <em>in</em> 0..440000 {</pre><pre>sum += i;</pre><pre>}</pre><pre>}<br></pre><pre><strong>//Javascript loop that iterates from 0 to length1d(variable)</strong></pre><pre>function loopTime1DArr() {</pre><pre>let sum = 0;</pre><pre><em>for</em> (let i = 0; i &lt; length1d; i++) {</pre><pre>sum += i;</pre><pre>}</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*KODxwNBnADHUSotwtG89zw.png" /><figcaption>Time in milliseconds</figcaption></figure><p>WASM somehow maintained a constant execution time and resulted in 0 milliseconds execution time. The execution time for javascript however seems to increase linearly. The bump between 200,000 and 300,000 however could be because of the CPU overheating or any background task that might have been running in the background.</p><h4>Sum of elements of the array passed as a value:</h4><pre><strong>//Rust program to pass array as a value to a function to calculate the sum</strong></pre><pre>#[wasm_bindgen]</pre><pre>pub fn sum_of_arr(arr: &amp;JsValue) -&gt; i32 {</pre><pre>let mut sum = 0;</pre><pre>let elements: Vec&lt;i32&gt; = arr.into_serde().unwrap();</pre><pre><em>for</em> i <em>in</em> 0..elements.len() {</pre><pre>sum += elements[i];</pre><pre>}</pre><pre><em>return</em> sum;</pre><pre>}</pre><pre><strong>//Javascript program to pass array as a value to a function to calculate the sum<br></strong>function sumOfArr(arr) {</pre><pre>let result = 0;</pre><pre><em>for</em> (let i = 0; i &lt; arr.length; i++) result += arr[i];</pre><pre><em>return</em> result;</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*5G-sNmYYuOkrP_9zeMFMog.png" /><figcaption>Time in milliseconds</figcaption></figure><p>Hmm… WASM breezed in the previous benchmark, but what happened now? Turns out into_serde()<strong> </strong>method that is used here adds a huge load of parsing and optimizing the dynamically typed code from JavaScript thus giving us this graph.</p><h4>Allocation of memory for an array:</h4><pre><strong>//code to allocate array of dynamic length in Rust</strong></pre><pre>#[wasm_bindgen]</pre><pre>pub fn malloc_1_d_arr() {</pre><pre>let mut vec: Vec&lt;i32&gt; = [].to_vec();</pre><pre><em>for</em> i <em>in</em> 0..440000 {</pre><pre>vec.push(i);</pre><pre>}</pre><pre>}</pre><pre><strong>//code to allocate array of dynamic length in Javascript<br></strong>function malloc1darr() {</pre><pre>let result = [];</pre><pre><em>for</em> (let i = 0; i &lt; length1d; i++) result.push(i);</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*2HCgpKq94qRec9yzdZCBLQ.png" /><figcaption>Time in milliseconds</figcaption></figure><p>It can be seen here that WASM is back in business giving 4X-6X better results as compared to JavaScript.</p><h3>Benchmark for O(N²) loops:</h3><h4>RAW loop time:</h4><pre><strong>// Code to perform O(N^2) loop in rust</strong><br>#[wasm_bindgen]</pre><pre>pub fn loop_time_2d_arr() {</pre><pre>let mut sum = 0;</pre><pre>let length = 6000;</pre><pre><em>for</em> _ <em>in</em> 0..length {</pre><pre><em>for</em> j <em>in</em> 0..length {</pre><pre>sum += j;</pre><pre>}</pre><pre>}</pre><pre>}</pre><pre><strong>// Code to perform O(N^2) loop in Javascript<br></strong>function loopTime2DArr() {</pre><pre>let sum = 0;</pre><pre><em>for</em> (let i = 0; i &lt; length2d; i++)</pre><pre><em>for</em> (let j = 0; j &lt; length2d; j++) sum += j;</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*EMrjNtkkuZKrDzgJFiXcJg.png" /><figcaption>Time in milliseconds</figcaption></figure><p>The size chosen was arbitrary taken so as to generate the fastest output to fit my schedule. Same as the previous results we can see the execution time of javascript on the higher side.</p><h4>Sum of elements of the array passed as a value:</h4><pre><strong>//Sum of 2D Array passed as value Rust<br></strong>#[wasm_bindgen]</pre><pre>pub fn sum_of_n2_arr(arr: &amp;js_sys::Array) -&gt; i64 {</pre><pre>let mut sum = 0;</pre><pre>let elements: Vec&lt;Vec&lt;i32&gt;&gt; = arr.into_serde().unwrap();</pre><pre><em>for</em> i <em>in</em> 0..elements.len() {</pre><pre><em>for</em> j <em>in</em> 0..elements[i].len() {</pre><pre>sum += elements[i][j];</pre><pre>}</pre><pre>}</pre><pre><em>return</em> sum.into();</pre><pre>}</pre><pre><strong>// Sum of 2D array passed as value Javascript<br></strong>function sumOfN2Array(arr) {</pre><pre>let result = 0;</pre><pre><em>for</em> (let i = 0; i &lt; arr.length; i++) {</pre><pre><em>for</em> (let j = 0; j &lt; arr[i].length; j++) {</pre><pre>result += arr[i][j];</pre><pre>}</pre><pre>}</pre><pre><em>return</em> result;</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*5-kDL1zWIEG2iMYpQ4qwNg.png" /></figure><p>As confirmed in the previous benchmark it can be seen that the parsing time at the Rust side increases with the increase of payload.</p><h4>Allocation of memory for an array:</h4><pre><strong>//Allocation of 2D Array Rust</strong></pre><pre>#[wasm_bindgen]</pre><pre>pub fn malloc_2_d_arr() {</pre><pre>let mut vec: Vec&lt;Vec&lt;i64&gt;&gt; = [].to_vec();</pre><pre>let length = 6000;</pre><pre><em>for</em> i <em>in</em> 0..length {</pre><pre>vec.push([].to_vec());</pre><pre><em>for</em> j <em>in</em> 0..length {</pre><pre>vec[i].push(j as i64);</pre><pre>}</pre><pre>}</pre><pre>}</pre><pre><strong>// Allocation of 2D array JavaScript<br></strong>function malloc2darr() {</pre><pre>const demoArrayOfNumber = new Array(new Array());</pre><pre><em>for</em> (let i = 0; i &lt; length2d; i++) {</pre><pre>demoArrayOfNumber[i] = [];</pre><pre><em>for</em> (let j = 0; j &lt; length2d; j++) demoArrayOfNumber[i].push(j);</pre><pre>}</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*uUsCyBxHm1GcXyC7_1_DmQ.png" /><figcaption>Time in milliseconds</figcaption></figure><p>Unlike previous benchmarks, JavaScript seems to keep up with Rust and give outputs at par to Rust.</p><h4>Conclusion:</h4><p>Rust sure proves to be performant and better than Javascript in comparison to speed. However, as the benchmark shows, a huge computation is required to transfer a statically typed data from JS to Rust. Hence the performance gain can only be made visible if the data that has entered rust goes through a lot of iteration and makes the processing worthwhile. For example the present use cases of WASM as barcode scanners, games etc require a lot of computation rather than just looping through an array. If you find yourself stuck in such a computation loop where you see drop frames and laggy browser, WASM would surely prove to be a savior. Otherwise, the 2X-3X gains you get by WASM as part of its computation will easily be overshadowed by the enormous data transfer rates by WASM.</p><p>If you want to replicate the following test on your PC or see the raw data. Find all the resources below.</p><ul><li><a href="https://docs.google.com/spreadsheets/d/17Grdg1QcZNe20obsEtKp6ti0OFPhaJbDJwJ7P2Soy04/edit?usp=sharing">WASM-JS Benchmarking Data</a></li><li><a href="https://github.com/aesher9o1/wasm-boilerplate">aesher9o1/wasm-boilerplate</a></li></ul><h4>JavaScript In Plain English</h4><p>Did you know that we have three publications and a YouTube channel? Find links to everything at <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=674ced038ea8" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/state-of-web-assembly-2020-674ced038ea8">State of Web Assembly 2020</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>