<?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 mridul shukla on Medium]]></title>
        <description><![CDATA[Stories by mridul shukla on Medium]]></description>
        <link>https://medium.com/@mridulshukla037?source=rss-db1f48b35d52------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*D21W_VQ9LE1bCQJ29cxi9Q.png</url>
            <title>Stories by mridul shukla on Medium</title>
            <link>https://medium.com/@mridulshukla037?source=rss-db1f48b35d52------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 11:18:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mridulshukla037/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[Creating first Serverless AWS Lambda API in Node.js]]></title>
            <link>https://mridulshukla037.medium.com/creating-first-serverless-aws-lambda-api-in-node-js-3ab73856011d?source=rss-db1f48b35d52------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ab73856011d</guid>
            <category><![CDATA[serverless-architecture]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[deploy-first-serverless]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[mridul shukla]]></dc:creator>
            <pubDate>Fri, 29 Jan 2021 09:25:10 GMT</pubDate>
            <atom:updated>2021-01-29T09:25:10.038Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS Lambda functions are event-driven and serverless — triggered to process a piece of code and return a result. In this article, we are going to walk through creating one Node.js API.🤓</p><h3>So…Why use Serverless?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*s_KlF0px5uygoDKg" /></figure><p><strong>Lower-Cost:</strong>💸</p><p>In a serverless architecture, you will pay only for what you use. There is no waste of capacity, no resources are wasted, or money.</p><p>(⚠️: If by mistake you through your API in public group R.I.P to your AWS bill)</p><p><strong>No need to manage the Server:</strong>🥺</p><p>Forget the headache of backend infrastructure management. No Server down, no prearrangement or maintaining of servers ever again.</p><p><strong>Unlimited Scalability:</strong>✨</p><p>You can scale the functions according to users. Scaling up or down is as simple as executing a few lines of code you could handle large traffic.</p><h3>Prerequisites</h3><ul><li>AWS account with access to IAM and Lambda.</li><li>Node.js 8 or later.</li><li>NPM</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D2XNoc1v3iAHVNy1.jpeg" /></figure><h3>Setting Up Serverless framework</h3><pre>npm install -g serverless</pre><p>running the above command will install serverless in you’re local.<br>The next step is setting up you’re serverless project🙃</p><pre>## Create a new Serverless service/project run command ##<br>$ serverless</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jHyEbCF-rjyeiqRb.png" /></figure><p>after that do “<em>yes</em>” for the new project and select <em>AWS Node.js </em>as the environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mbt3ZN3CUBWomXRe.png" /></figure><p>Give your project an appropriate name. Do “yes” to the rest of the steps to create your folder.</p><pre>&gt;&gt; cd {your app name}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/0*kG1_cvEsicTC16XH.png" /></figure><p>after that and you will see a</p><h3>handler.js</h3><p>The handle.js file is for your writing your business logic.</p><h3>Serverless.yml</h3><p>Your application is deployed using the Serverless framework based on the serverless.yml configuration file.</p><p>The below link is a list of all available properties in serverless.yml when the provider is set to aws</p><pre><a href="https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/">https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/</a></pre><p>now we need three dependency</p><pre>&quot;express&quot;: &quot;^4.17.1&quot;,  // for node.js routing and api<br>&quot;pg&quot;: &quot;^8.5.1&quot;,        // for postgress-db querry for node.js<br>&quot;serverless-http&quot;: &quot;^2.6.0&quot;          // This module allows you to &#39;wrap&#39; your API for serverless use</pre><blockquote>Rename your <strong>handler.js</strong> file to app.js .</blockquote><blockquote>….Your <strong>app.js</strong> will look like</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/0*wOY1hjdcizPM9oWW.png" /></figure><p>Import’s + DB query + wrapping “app” in the serverless handler.🤯</p><pre>.then(()=&gt;client.end()); //at this point we are closing the db conn</pre><p>the serverless.yml file would not be changed majorly. except for the function part, we will add the HTTP events (Simply put, events are the things that trigger your functions to run.</p><p>If you are using AWS as your provider, all events in the service are anything in AWS that can trigger an AWS Lambda function, like an S3 bucket upload, an SNS topic, and HTTP endpoints created via <a href="https://serverless.com/amazon-api-gateway/">API Gateway</a>. )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/0*QBV4VhWhIWoVzvm0.png" /></figure><p>now the final time to deploy the app….🧐<br>run command</p><pre>serverless deploy (or sls deploy)</pre><p>though sls deploy re-deploys the entire stack through cloud formation and can be noticeably slooowww🐌.</p><p>On the flip side, sls deploy function -f myFuncName only zips up the code (&amp; any dependencies) and updates the Lambda function only. This is much faster than waiting for an entire stack update.</p><pre># Redeploy entire stack through cloud formation<br>sls deploy<br><br>4# Redeploy only the code + dependencies to update the AWS lambda function<br>sls deploy function -f myFuncName</pre><h3>Offline Emulation</h3><p>Now you might be asking, what about offline emulation? It’s absolutely a way to speed up dev cycles without having to re-deploy anything.</p><pre>npm install serverless-offline</pre><p>Then add the plugins key in serverless.yml</p><pre>plugins:<br>   - serverless-offline</pre><p>Now you should have the serverless offline commands for testing on localhost the function before deploying.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ab73856011d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating first Serverless AWS Lambda API in Node.js]]></title>
            <link>https://medium.com/tech-carnot/creating-first-serverless-aws-lambda-api-in-node-js-c5e91b5ad8f6?source=rss-db1f48b35d52------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5e91b5ad8f6</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[mridul shukla]]></dc:creator>
            <pubDate>Sat, 26 Dec 2020 06:48:09 GMT</pubDate>
            <atom:updated>2021-01-29T13:19:51.753Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS Lambda functions are event-driven and serverless — triggered to process a piece of code and return a result. In this article, we are going to walk through the creation of one Node.js API.🤓</p><h3>So…Why use Serverless?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*EK4bkOz9hkwy52zn" /></figure><p><strong>Lower-Cost:</strong>💸</p><p>In a serverless architecture, you will pay only for what you use. There is no waste of capacity. No resources or money are wasted either.</p><p>(⚠️: If by mistake you share your API in a public group, R.I.P to your AWS bill)</p><p><strong>No need to manage the Server:</strong>🥺</p><p>Forget the headache of backend infrastructure management. No server downtimes, no prearrangement or maintaining of servers ever again.</p><p><strong>Unlimited Scalability:</strong>✨</p><p>You can scale the functions according to users.</p><h3>Prerequisites</h3><ul><li>AWS account with access to IAM and Lambda.</li><li>Node.js 8 or later.</li><li>NPM</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AY0JG7GD9OvGBQKE39RRmQ.jpeg" /></figure><h3><strong>Setting Up Serverless framework</strong></h3><pre>npm install -g serverless</pre><p>running the above command will install serverless in you&#39;re local.<br>The next step is setting up you&#39;re serverless project🙃</p><pre>## Create a new Serverless service/project run command ##<br>$ serverless</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ky1BUvgydyFHF6mbzKbFUg.png" /></figure><p>after that do “<em>yes</em>” for the new project and select <em>AWS Node.js </em>as the environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SUIonIUewVQzUjnHVheqUA.png" /></figure><p>Give your project an appropriate name. Do “yes” to the rest of the steps to create your folder.</p><pre>&gt;&gt; cd {your app name}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*nnZKgyo7Jgg3oxLsoa0Msg.png" /></figure><p>after that and you will see a</p><h4>handler.js</h4><p>The handle.js file is for your writing your business logic.</p><h4>Serverless.yml</h4><p>Your application is deployed using the Serverless framework based on the serverless.yml configuration file.</p><p>The below link is a list of all available properties in serverless.yml when the provider is set to aws</p><pre><a href="https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/">https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/</a></pre><p>now we need three dependency</p><pre>&quot;express&quot;: &quot;^4.17.1&quot;,  // for node.js routing and api</pre><pre>&quot;pg&quot;: &quot;^8.5.1&quot;,        // for postgress-db querry for node.js</pre><pre>&quot;serverless-http&quot;: &quot;^2.6.0&quot;          </pre><pre>// This module allows you to &#39;wrap&#39; your API for serverless use.</pre><blockquote>Rename your <strong><em>handler.js </em></strong>file to<strong> <em>app.js</em></strong><em> .</em></blockquote><blockquote><em>….</em>Your <strong>app<em>.j</em></strong><em>s </em>will look like</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*WLepmZPGoPqKEXt4b2RSyQ.png" /></figure><p>Import’s + DB query + wrapping “app” in the serverless handler.🤯</p><pre>.then(()=&gt;client.end()); //at this point we are closing the db conn.</pre><p>the serverless.yml file would not be changed majorly. except for the function part, we will add the HTTP events (Simply put, events are the things that trigger your functions to run.</p><p>If you are using AWS as your provider, all events in the service are anything in AWS that can trigger an AWS Lambda function, like an S3 bucket upload, an SNS topic, and HTTP endpoints created via <a href="https://serverless.com/amazon-api-gateway/">API Gateway</a>. )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*K5jz4YJV7oWlFjszBGUtmQ.png" /></figure><p>now the final time to deploy the app….🧐<br>run command</p><pre>serverless deploy (or sls deploy)</pre><p>though sls deploy re-deploys the entire stack through cloud formation and can be noticeably slooowww🐌.</p><p>On the flip side, sls deploy function -f myFuncName only zips up the code (&amp; any dependencies) and updates the Lambda function only. This is much much faster than waiting for an entire stack update</p><pre># Redeploy entire stack through cloud formation<br>sls deploy<br><br>4# Redeploy only the code + dependencies to update the AWS lambda function<br>sls deploy function -f myFuncName</pre><h3>Offline Emulation</h3><p>Now you might be asking, what about offline emulation? It’s absolutely a way to speed up dev cycles without having to re-deploy anything.</p><pre>npm install serverless-offline </pre><p>Then add the plugins key in serverless.yml</p><pre>plugins:<br>   - serverless-offline</pre><p>Now you should have the serverless offline commands for testing on localhost the function before deploying.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5e91b5ad8f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-carnot/creating-first-serverless-aws-lambda-api-in-node-js-c5e91b5ad8f6">Creating first Serverless AWS Lambda API in Node.js</a> was originally published in <a href="https://medium.com/tech-carnot">Tech@Carnot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Back to Backtracking]]></title>
            <link>https://mridulshukla037.medium.com/back-to-backtracking-ea22456006d5?source=rss-db1f48b35d52------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea22456006d5</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[mridul shukla]]></dc:creator>
            <pubDate>Wed, 11 Sep 2019 16:35:00 GMT</pubDate>
            <atom:updated>2019-09-22T03:39:57.217Z</atom:updated>
            <content:encoded><![CDATA[<p>Backtracking is concept to build a solution using recursion,going through all possible <strong>states</strong> and rejecting the state which did not satisfy the <strong>constraints</strong> till we reach the final<strong> goal </strong>state<strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*KErbR-daO29bC8MkelReXA.png" /></figure><p>For understanding this we will solve problem name:</p><h4>Generate all N matched parentheses.</h4><p><strong>INPUT </strong>is :Integer N<br><strong>OUTPUT</strong> is :String of parentheses “<strong>(</strong>“ or “<strong>)</strong>”..the string should be balanced<br>by <em>BALANCED </em>I mean(number of “<strong>(</strong>“ open== number of “<strong>)</strong>” brackets)<br>So for input:</p><p><strong>N</strong>=1 output is [“ <strong>()</strong> “] <br>{note 1: opening should be before closing}</p><p><strong>N</strong>=2 output is [ <strong>“</strong> <strong>(()) “,” ()() “</strong>]<br> {note 2: we have to print all possible solution permutation}</p><p><strong>N</strong>=3 output is [<strong>“ ((())) “,” (())() “,” ()()() “, “ (()()) “,”()(()) “</strong>]</p><p>**The three key to recursion**</p><ol><li><strong><em>Our Choice</em></strong><br> {either use ( or ) }</li><li><strong><em>Our constraints </em></strong><br> {we can not use “)” before “(“}</li><li><strong><em>Our Goal </em></strong><br> {total 2*N character should be used {N -&gt;”<strong> ( “</strong> } + {N -&gt; <strong>“)”</strong> } }</li></ol><p>now we move step by step to solve the problem for N=3</p><figure><img alt="this is how some what the recursion tree would look like" src="https://cdn-images-1.medium.com/max/319/1*SFCFnmzFRkJhBkAP9CYWJQ.png" /></figure><p>When the number of open <strong>“(“</strong> bracket is zero we start decreasing count of closing brackets <strong>“)”</strong> or<strong> </strong>when <em>open &lt; close</em></p><p>We gonna approach by taking input N and using a recursive function <strong>Back_track()</strong> with Parameter:</p><p>(<em>number of</em><strong><em> </em>“(”</strong>, <em>number of</em> <strong>“)”</strong>,<strong><em>Empty string</em> </strong>which will be filled in each recursion step with either <strong>( or ),</strong> <strong>vector</strong> of string to store the filled strings set)</p><blockquote><strong>class Solution {<br>public:<br> void Back_track(int open,int close,string bracket,vector&lt;string&gt;&amp;v){<br> if(open==0 &amp;&amp; close==0)<br> {<br> v.push_back(bracket);<br> return;<br> }<br> if(open&gt;0){ <br> Back_track(open-1, close, bracket + ’(‘ , v );<br> }<br> if(open&lt;close){<br> Back_track(open , close-1 , bracket + ’)’ , v );<br> }<br> <br>}<br> <br> vector&lt;string&gt; generateParenthesis(int n) {<br> <br> string bracket=””;<br> int open=n,close=n;<br> vector&lt;string&gt;v;<br> Back_track(open,close,bracket,v);<br> return v;<br> <br> }<br>};</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea22456006d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>