<?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 Sagar Gavhane on Medium]]></title>
        <description><![CDATA[Stories by Sagar Gavhane on Medium]]></description>
        <link>https://medium.com/@sagar_gavhane?source=rss-d222507ad56------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2wnohA4sC4RSQT0cm31h6g.jpeg</url>
            <title>Stories by Sagar Gavhane on Medium</title>
            <link>https://medium.com/@sagar_gavhane?source=rss-d222507ad56------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 15:49:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sagar_gavhane/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[Level Up Your Sprints: How I’m Using AI to Plan Like a Boss]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@sagar_gavhane/level-up-your-sprints-how-im-using-ai-to-plan-like-a-boss-de28f63b6f54?source=rss-d222507ad56------2"><img src="https://cdn-images-1.medium.com/max/2600/1*I0kiTqTrBOer1nvhtbWREQ.jpeg" width="5472"></a></p><p class="medium-feed-snippet">Leveraged AI this week to supercharge our feature planning&#x200A;&#x2014;&#x200A;excited about how seamless and smart the process is becoming!</p><p class="medium-feed-link"><a href="https://medium.com/@sagar_gavhane/level-up-your-sprints-how-im-using-ai-to-plan-like-a-boss-de28f63b6f54?source=rss-d222507ad56------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@sagar_gavhane/level-up-your-sprints-how-im-using-ai-to-plan-like-a-boss-de28f63b6f54?source=rss-d222507ad56------2</link>
            <guid isPermaLink="false">https://medium.com/p/de28f63b6f54</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[product-management]]></category>
            <dc:creator><![CDATA[Sagar Gavhane]]></dc:creator>
            <pubDate>Sun, 14 Sep 2025 08:43:08 GMT</pubDate>
            <atom:updated>2025-09-14T08:43:08.983Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Building a blog with Next.js]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@sagar_gavhane/building-a-blog-with-next-js-63a33edcd0eb?source=rss-d222507ad56------2"><img src="https://cdn-images-1.medium.com/max/1920/1*TL02rQtWMO1xo2K0wGCRmQ.jpeg" width="1920"></a></p><p class="medium-feed-snippet">Building a blazing-fast blog with next.js</p><p class="medium-feed-link"><a href="https://medium.com/@sagar_gavhane/building-a-blog-with-next-js-63a33edcd0eb?source=rss-d222507ad56------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@sagar_gavhane/building-a-blog-with-next-js-63a33edcd0eb?source=rss-d222507ad56------2</link>
            <guid isPermaLink="false">https://medium.com/p/63a33edcd0eb</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[blogging]]></category>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sagar Gavhane]]></dc:creator>
            <pubDate>Sun, 31 May 2020 17:00:47 GMT</pubDate>
            <atom:updated>2020-06-05T16:34:41.382Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[React Performance Optimization]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@sagar_gavhane/react-performance-optimization-7535564c7bec?source=rss-d222507ad56------2"><img src="https://cdn-images-1.medium.com/max/2400/1*xWWB8ZcBjtOYJ_xKsVE3Yg.jpeg" width="2400"></a></p><p class="medium-feed-snippet">Boost performance of React component.</p><p class="medium-feed-link"><a href="https://medium.com/@sagar_gavhane/react-performance-optimization-7535564c7bec?source=rss-d222507ad56------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@sagar_gavhane/react-performance-optimization-7535564c7bec?source=rss-d222507ad56------2</link>
            <guid isPermaLink="false">https://medium.com/p/7535564c7bec</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[Sagar Gavhane]]></dc:creator>
            <pubDate>Sun, 26 Apr 2020 18:06:23 GMT</pubDate>
            <atom:updated>2020-05-02T21:08:06.349Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Reactive Programming in JavaScript with RxJS.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@sagar_gavhane/reactive-programming-in-javascript-with-rxjs-9db53c07ef14?source=rss-d222507ad56------2"><img src="https://cdn-images-1.medium.com/max/1000/1*QvXom5S0ajSJnKYL-zkwpw.jpeg" width="1000"></a></p><p class="medium-feed-snippet">RxJS is JavaScript library for transforming, composing and querying asynchronous streams of data. RxJS can be used both in the browser or&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@sagar_gavhane/reactive-programming-in-javascript-with-rxjs-9db53c07ef14?source=rss-d222507ad56------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@sagar_gavhane/reactive-programming-in-javascript-with-rxjs-9db53c07ef14?source=rss-d222507ad56------2</link>
            <guid isPermaLink="false">https://medium.com/p/9db53c07ef14</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Sagar Gavhane]]></dc:creator>
            <pubDate>Sat, 20 Oct 2018 13:46:19 GMT</pubDate>
            <atom:updated>2018-11-05T12:13:26.187Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Build a RESTful API with the Serverless Framework]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@sagar_gavhane/build-a-restful-api-with-the-serverless-framework-d8cc548f8e0f?source=rss-d222507ad56------2"><img src="https://cdn-images-1.medium.com/max/1000/1*FUlUsdjjV1YvsRRxTNsEmA.jpeg" width="1000"></a></p><p class="medium-feed-snippet">Today, we&#x2019;re going to implement serverless RESTful API services by using &#x201C;Serverless Framework&#x201D;. There are many cloud services provider&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@sagar_gavhane/build-a-restful-api-with-the-serverless-framework-d8cc548f8e0f?source=rss-d222507ad56------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@sagar_gavhane/build-a-restful-api-with-the-serverless-framework-d8cc548f8e0f?source=rss-d222507ad56------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8cc548f8e0f</guid>
            <category><![CDATA[express]]></category>
            <category><![CDATA[serverless-framework]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Sagar Gavhane]]></dc:creator>
            <pubDate>Sat, 20 Oct 2018 13:24:09 GMT</pubDate>
            <atom:updated>2018-10-20T13:25:19.577Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Code splitting in React]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@sagar_gavhane/code-splitting-in-react-f475a0da4c3e?source=rss-d222507ad56------2"><img src="https://cdn-images-1.medium.com/max/1000/1*QvXom5S0ajSJnKYL-zkwpw.jpeg" width="1000"></a></p><p class="medium-feed-snippet">Hi, I&#x2019;m Sagar working as a senior software engineer. I love to write articles which will help developers to understand the magic of&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@sagar_gavhane/code-splitting-in-react-f475a0da4c3e?source=rss-d222507ad56------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@sagar_gavhane/code-splitting-in-react-f475a0da4c3e?source=rss-d222507ad56------2</link>
            <guid isPermaLink="false">https://medium.com/p/f475a0da4c3e</guid>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sagar Gavhane]]></dc:creator>
            <pubDate>Wed, 17 Oct 2018 13:41:40 GMT</pubDate>
            <atom:updated>2018-10-20T13:48:21.449Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Three dots ( … ) in JavaScript ]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@sagar_gavhane/three-dots-in-javascript-7b46bc05d5c3?source=rss-d222507ad56------2"><img src="https://cdn-images-1.medium.com/max/1000/1*IFSQOMdNDP7tgXpAMo2o0g.jpeg" width="1000"></a></p><p class="medium-feed-snippet">Learn about spread and rest operators</p><p class="medium-feed-link"><a href="https://medium.com/@sagar_gavhane/three-dots-in-javascript-7b46bc05d5c3?source=rss-d222507ad56------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@sagar_gavhane/three-dots-in-javascript-7b46bc05d5c3?source=rss-d222507ad56------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b46bc05d5c3</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[webdev]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sagar Gavhane]]></dc:creator>
            <pubDate>Sat, 15 Sep 2018 17:45:44 GMT</pubDate>
            <atom:updated>2019-08-15T15:08:07.714Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Implement a serverless CI/CD pipeline with AWS (Amazon Web Services).]]></title>
            <link>https://medium.com/@sagar_gavhane/implement-a-serverless-ci-cd-pipeline-with-aws-amazon-web-services-7c14d168d1e3?source=rss-d222507ad56------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c14d168d1e3</guid>
            <category><![CDATA[serverless-framework]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Sagar Gavhane]]></dc:creator>
            <pubDate>Sat, 15 Sep 2018 10:19:52 GMT</pubDate>
            <atom:updated>2018-09-15T10:19:52.100Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*xUdocSMIvkeMTc27OXsGrw.jpeg" /></figure><h4>This article series focused on implementing a serverless CI/CD with AWS services, During the implementation process we are going introduce lots of new AWS services. Due to topic complexity, the article has been divided into 2 parts. Your reading first part of the article where we will implementing Continuous Integration (CodeBuild Project, CodePipeline and test case with jest).</h4><p>To follow the steps mentioned in this article, you should have your own <a href="https://aws.amazon.com/free/">AWS free tier account</a>.</p><p>What should you know before starting implementing this article series?</p><ol><li>Basic understanding of <a href="https://sandofsky.com/blog/git-workflow.html">git workflow</a>.</li><li>We are implementing CI/CD with <a href="https://aws.amazon.com/codebuild/">CodeBuild</a>, <a href="https://aws.amazon.com/codepipeline/">CodePipeline</a>, <a href="https://aws.amazon.com/s3/">S3</a>, and <a href="https://serverless.com/">Serverless Framework</a> etc. So you have required a good knowledge of this AWS services.</li><li>If you stuck in between process, you’re curiosity help you to get rid of the obstacle.</li></ol><p><em>If you don’t know about AWS services, I will try to explain to you as simple as possible.</em></p><h3>Let’s jump into understanding CI/CD</h3><p><strong>What is Continuous Integration (CI) / Continuous Delivery (CD)?</strong></p><p><strong>Continuous Integration(CI)</strong> is a development and testing phase of the software development. As developers make changes to software code, these changes are immediately checked into a shared source code. When the code is checked in, automated build processes and tests are triggered to make sure that the changes did not break the software application. It helps us to caught coding errors more quickly, and this avoids bugs before code merges into the shared source code.</p><p><strong>Continuous Delivery (CD)</strong> means that as coding changes, new feature or bug fixes passes the automated build tests, then we have to do a set of configuration before ship changes to users land and deliver it rapidly as possible.</p><p>In this article, we are going to create a weight watcher application which asks for weight on every day and we store storing this weight inside the database.</p><p>We are going to create a new repository at GitHub. Give a name weight-watchers to the repository and feel free to skip description then hit on Create Repository Button. After the successful creation weight-watchers repository, we are ready to clone this repository to the local machine for writing magical code. Clone repository using SSH or HTTP method as per your convenience.</p><p>If you stuck with cloning repository hit this link <a href="https://help.github.com/articles/cloning-a-repository/">help you</a></p><p>git clone git@github.com:sagar-gavhane/weight-watchers.git</p><p>For sake of simplicity, we are using GitHub. If you want to use CodeCommit feel free to create a repository on AWS CodeCommit and clone it.</p><h4><strong>What is AWS CodeCommit?</strong></h4><p>AWS CodeCommit is a version control service hosted by Amazon Web Services that you can use to privately store and manage source code in the cloud. We can state that it’s alternative to GitHub only difference is that you can’t make your repository public. CodeCommit has great integration with CodeBuild and CodePipeline over other version control services.</p><h4>Add necessary files and packages to project</h4><p>Add .gitignore file to ignore tracking folders and files which are generated at run-time or some secret files to avoid uploading to the repository. Paste the raw content of <a href="https://www.gitignore.io/api/node">https://www.gitignore.io/api/node</a> to created .gitignore file.</p><p>touch .gitignore &amp;&amp; gedit .gitignore</p><p>Let’s create a package.json file using npm init command.</p><p>npm init --y</p><p>We are using express-js for creating API endpoints. Install project dependencies by hitting npm below command.</p><p>npm install aws-sdk body-parser express serverless-http --save</p><p>Okay, wait for a while let me quickly explain project dependencies.</p><p><strong>aws-sdk</strong>- The aws-sdk provides an API for AWS services you can use to build applications. The API lets developers build libraries or applications that make use of AWS services. There are different aws-sdk for different languages, we are using aws-sdk for JavaScript.</p><p><strong>body-parser</strong> — body-parser extract the entire body portion of an incoming request stream and exposes it on req.body. Means whatever we send data using post method are stored inside req.body.</p><p><strong>express</strong> — Express is a light-weight web application framework to help organize your web application into an MVC architecture on the server side. We are using for creating API endpoints.</p><p><strong>serverless-http</strong> — serverless-http module allows you to ‘wrap’ your express API for serverless use. It’s not handling any HTTP server, ports or sockets.</p><p>One more step, Let’s add a buildspec.yml file to our project, create a file with name buildspec.yml and add below code snippets. Later, I will explain to you the role of the buildspec file in the CI/CD pipeline.</p><p><strong>buildspec.yml</strong></p><pre>version: 0.2<br>phases:<br>  install:<br>    commands:<br>      - npm install<br>      - npm test</pre><p>It’s a good time to commit changes to the repository. Move on to next section of creating a solid CI/CD pipeline.</p><p>git add . &amp;&amp; git commit -m &quot;initial commit&quot;</p><p>git push origin master</p><h4><strong>Settings S3 bucket (Simple Storage Service)</strong></h4><p>Amazon S3 is object storage built to store and retrieve any amount of data from anywhere. Before we start to creating pipeline we have to setup S3 bucket to store our build artifacts. Build artifacts are files outputted from our builds that we want to save for future use.</p><p>Goto to AWS console and select S3 service from services dropdown, Click Create bucket and enter a name for your bucket. Here, I’m using weight-watchers-artifacts. So I’ve appended -artifacts to S3 bucket to make my bucket easier to find. S3 bucket name is unique so you have to enter suffix random numbers. Choose a region and click Next. Set default settings to S3 bucket as it is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/0*fxuQ1hRlosTo_pAs" /></figure><p>I strongly recommended that, stick with one region during this article. I’m sticking with US East (N. Virginia) region and also checkout necessary services are available to the your selected region.</p><h4>Configure AWS CodeBuild project</h4><p>AWS CodeBuild is a continuous integration service that compiles source code, runs tests, and produces software packages that are ready to deploy. We have just required to create CodeBuild project with proper settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PRruF-0SzWua1efr" /></figure><p>Find CodeBuild service from services dropdown, once you’re on CodeBuild dashboard hit on create project button. For the naming convention, I have given a name weight-watchers-builder to the project. Choose source provider to GitHub (If you&#39;re using CodeCommit then choose CodeCommit). It will prompt you for GitHub authentication, authenticate your GitHub account. Enter your repository complete URL, I entered https://github.com/sagar-gavhane/weight-watchers repository URL. In Source: What to build section skip remaining settings as default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/0*AA2xH44x4g4ThEmO" /></figure><p>Move onto Environment: How to build section. There is two way of selecting a building environment, either you can use AWS CodeBuild image or specific docker image. I&#39;m sticking with AWS CodeBuild image. I have chosen an operating system as Ubuntu with runtime environment as nodejs, with specific runtime version to aws/codebuild/nodejs:8.11.0.</p><p>Build specification, We will use buildspec.yml file which is located in the root of the repository. Right now just select Use the buildspec.yml in the source code root directory and buildspec name to buildspec.yml.</p><p><em>If you know building setting then feel free to toggle settings as per your requirements.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/0*miTqf_s_cH01-HKB" /></figure><p>Now, it’s time to tell our CodeBuild project to save artifacts in that S3 bucket we created. Artifacts: Where to put the artifacts from this build project section select type as Amazon S3 and set name, the path to empty. Bucket name, I will choose weight-watchers-artifacts and artifacts packaging to zip.</p><p>And remaining settings: Cache, Service Role, and VPC. We don’t need to do anything with Cache and VPC for this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/0*jdnzIkhAXafB6aI0" /></figure><p>Move over to Service role section, In this section, we will need an IAM service role when your build runs, it will assume this role. This service role will give it permissions to do write logs to CloudWatch and write artifacts to S3. Choose create a service role in your account it will create a service role for us. I have given role name to codebuild-weight-watchers-builder-service-role.</p><p>Okay, we don’t need to change any advanced settings. Hit on continue button to review what we have built so far.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YO9qZNU_O4j38Pmc" /></figure><p>Congratulations!! You have successfully created a CodeBuild project. Take a break, I know sticking with this article until this point is hard but step by step we will improve our knowledge and skills.</p><h4>Configure CodePipeline</h4><p>AWS CodePipeline is a continuous delivery service that helps us to rapidly and reliably deliver features and updates. You can define your release process workflow and describes how a new code change progresses through your release process.</p><p>A pipeline comprises a series of stages (e.g., build, test, and deploy). each stage is made up of a sequence of actions, which are tasks such as building code or deploying to test environments.</p><p>Enough theory!!. Let’s focus on creating our own pipeline. select CodePipeline from services dropdown. CodePipeline creation divided into 6 steps as Name, Source, Build, Deploy, Service Role, Review.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bgWcPbf7g9ijLTuT" /></figure><p>In Name step, enter your pipeline name, for a naming convention, I will choose pipeline name as weight-watchers-pipelinethen hit next step button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qhEvFYS1Xron2SeR" /></figure><p>In Source step, Choose source provider as GitHub repository (If your created repository on CodeCommit then select CodeCommit). It will prompt you for GitHub authentication. Authenticate your GitHub account. Once you successfully authenticate then you&#39;re ready to enter repository name and branch name. I will go with the repository name http://github.com/sagar-gavhane/weight-watchers and branch name as master. Skip Change detection optionssection. then move onto the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L5Auw4XouCQbiBco" /></figure><p>In Build step, choose the build provider that you want to use, I&#39;m sticking with CodeBuild. Move onto Configure your project section, select your project builder name. We already created a project builder in starting of this article so, I will choose weight-watchers-builder then move to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/0*Nt7PZp9Nnp95au7d" /></figure><p>In Deploy step, choose deployment to provide as No Deployment. Later we will edit our pipeline and add one deployment stage. move to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VlHETYUe0cnlk7F9" /></figure><p>In Service Role step, Our pipeline needs a role that gives permission for access CodeBuild project, watching CloudWatch events. Now, we&#39;re selecting ready-made service role AWS-CodePipeline-Service. However, if that selected your custom role and role is not configured correctly, AWS CodePipeline might not work as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cH3zDIx1t5x9xpha" /></figure><p>Finish, you have done CodePipeline configuration, just given quick review on the pipeline and then hit create pipeline button.</p><p>Congratulations!! your pipeline successfully created.</p><h4>Configure the testing environment with Jest.</h4><p>Jest is a delightful JavaScript testing framework created and maintained by a community of open source contributors and Facebook employees.</p><p>Write a simple unit test for check given number is prime or not using a jestjs. In __test__ directory create a file named primeNumber.test.js and copy paste below code snippets. In code snippets, we wrote a function which returns true if the given number is prime else return false.</p><p>Before writing code, install jestjs as a development dependency.</p><p>npm install jest --save-dev</p><p><strong>primeNumber.test.js</strong></p><pre>function isPrime(num) {<br>  for (var i = 2; i &lt; num; i++) if (num % i === 0) return false;<br>  return num !== 1;<br>}</pre><pre>describe(&quot;test prime number&quot;, () =&gt; {<br>  it(&quot;17 is a prime number&quot;, () =&gt; {<br>    expect(isPrime(17)).toBe(true);<br>  });<br>});</pre><p>Make little changes to our package.json file add the script as &quot;test&quot;: &quot;jest&quot; in script section. We have to run npm test command during CodeBuild execution.</p><pre>&quot;scripts&quot;: {<br>  &quot;test&quot;: &quot;jest&quot;<br>},</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/0*iibifvRQ5QwEn30F" /></figure><p>Okay! Whatever you have done modification with weight-watcher project in local machine, commit your changes to GitHub and check release change in weight-watchers-pipeline pipeline. If your both phase successfully passed you&#39;re created your own CI pipeline.</p><p>Thanks for reading this article, I understood that maybe you’re stuck with the problem or you have a good suggestion for this article. Don’t forget to like and comment on your question or feedback.</p><p>In the next article, we will implement CD (Continues Delivery) so keep in touch with me. Have a good day!!</p><p><strong>Happy Coding…</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c14d168d1e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brief explanation of AWS Lambda]]></title>
            <link>https://medium.com/@sagar_gavhane/brief-explanation-of-aws-lambda-b7ef9863fa2c?source=rss-d222507ad56------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7ef9863fa2c</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[Sagar Gavhane]]></dc:creator>
            <pubDate>Sun, 09 Sep 2018 10:52:34 GMT</pubDate>
            <atom:updated>2018-09-09T10:52:34.840Z</atom:updated>
            <content:encoded><![CDATA[<p>As we know things are changing so fast. Most enterprise companies are focusing on on-demand services or pay as you go services. Companies don&#39;t want to pay for the ideal time. In a traditional way, if a company want to host their application on to the cloud, the company have to buy a server. Servers are costly and cost depends on the configuration of the server also company have to maintain that server. All these things are increasing the operation cost of the company.</p><p>In the market, There are big companies like Google, Amazon, Microsoft trying to solve the operational cost problem. Hence Amazon comes with the solution of AWS Lambda.</p><p>Now the question is that what is AWS Lambda? and how does it solve the operational cost issue? Let&#39;s dive into AWS Lambda step by step.</p><p><strong>What is AWS Lambda?</strong><br>AWS Lambda is a service provided by Amazon. In a simpler way, you have to store your function on to cloud and trigger stored function with events like API calls, database modifications and many more etc. Behind the scene, Amazon manages running servers handling function execution and needed resources to successfully complete function execution.</p><p><strong>How does it work?</strong><br>First, you have to upload your code to AWS Lambda then setup trigger for invoking that function. Once function invoked, rest of the computing resources handled by AWS Lambda itself.</p><p>Let&#39;s focus on the advantages and limitation of AWS Lambda.</p><p>(Note: This article is not sponsored by AWS, So article will truly mention the realistic advantages and limitation of AWS Lambda)</p><p><strong>Advantages and limitation of AWS Lambda</strong></p><ul><li>No servers to manage - I completely agree with AWS that managing servers are a daunting task required a specialized team. For small companies, it&#39;s a deserving big value.</li><li>Continuous scaling - Definitely AWS Lambda take care of need resources and continuous scaling as a server to successfully running function. This overcome headache of scaling application and also we can allow or prevent the function from accessing resources.</li><li>Reduce operational cost - One of the biggest strengths of AWS Lambda functions is the reduced cost of execution. You don&#39;t pay anything when your code isn&#39;t running. The most application has 60-40% API rule means that 60% API are rarely called and 40% API are frequently gets called it will increasing cost for 40% lambda functions and remaining 60% lambda functions cost will be normal.</li><li>Architectural complexity - Implementing CI &amp; CD pipeline with AWS Lambda cumbersome to manage too many functions and ignoring granularity will end up creating mini-monoliths. And also what about code reusing, design pattern, testing lambda functions, and the local development process are much harder to maintain as compared to traditional client-server architecture. There are AWS SAM and Serverless framework it doesn&#39;t help you in maintaining source code design pattern, build code for a different environment and deploying an application with deployment staging.</li><li>Long-running processes - If you have a long-running process (a function that runs for more than 5 minutes), AWS Lambda is probably not for you because that’s the maximum execution time at the moment. However, you can do a recursive invocation as a workaround for the long-running process.</li><li>Programming languages - AWS Lambda supports following programming languages: Node.js (JavaScript), Python, Java (Java 8 compatible), and C# (.NET Core) and Go. If your team have different skill sets then you have to forcibly switch to a supported language.</li><li>Cold startup (startup latency) - Serverless architecture executes commands and functions on temporarily created containers. When you invoke function call then Lambda have to first establish an environment to execute that function. If continuously running function have not required to establish an environment but if some functions are rarely invoked then it took more than few(5-6) seconds for a response and it varied from one request to another.</li><li>Concurrent running lambda functions - Currently one AWS account can run 1000 lambda function concurrently. If your application is big your application needed more than 1000 lambda functions running concurrently then you have to manage another account for the handling other functions calls.</li><li>Security and bug related issue - If a hacker finds out that your company usages AWS lambda functions for handling computation tasks then hacker might do a denial-of-service attack (DoS attack) to increase the cost of lambda functions. Another case is that due to a bug in application some function gets called lambda function recursively then its might increase cost.</li><li>Vendor control and vendor lock-in - One of the issues about using AWS Lambda is that the third-party applications used or the Hardware and Software patches etc. all get to be decided by AWS. Thus, working with AWS Lambda means giving away a lot of control over your application.</li><li>Computational restrictions - Being based on these temporarily created containers, the usable memory is limited to about 2GB of RAM and the time to about 5 minutes for your Lambda to execute. This means that functions which require a lot of processing cannot be handled by AWS Lambda.</li><li>Issues with working in a virtual private cloud (VPC) - Many clients use a Virtual Private Cloud (VPC) for applications or processes which need an extra layer of security. However, if your Lambda needs to work with any such function which resides within a VPC, it cannot then talk to any other resources which are outside the VPC. In such cases, using AWS Lambda also entails some additional delay over and above the cold start mentioned above as the VPC creates something called ENIs or Elastic Network Interfaces for security purposes and this takes some time.</li></ul><p>I have faced this advantages and limitation when working with AWS Lambda. Have you faced any of these issues? What are the typical workarounds you use? I’d love to know what your thoughts about AWS Lambda are, so please do comment below and share your thoughts</p><p>I hope you have like this article, don&#39;t forget to hit clap or like.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7ef9863fa2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>