<?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"><channel><title><![CDATA[Tech and Programming blogs by Rahul Ahire]]></title><description><![CDATA[I talk about programming, Web Dev, AWS serverless and Personal journey that can help other. Click here to know more...]]></description><link>https://blog.rahulahire.com</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 03:46:19 GMT</lastBuildDate><atom:link href="https://blog.rahulahire.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[What is Experientia?]]></title><description><![CDATA[IBM acquired Red Hat, the makers of Red Hat Linux and other open source software for 34 Billion USD for what essentially you can rip off on GitHub for free.
In my previous article, I mentioned creating a private firm to empower everyone to do their i...]]></description><link>https://blog.rahulahire.com/what-is-experientia</link><guid isPermaLink="true">https://blog.rahulahire.com/what-is-experientia</guid><category><![CDATA[Physics]]></category><category><![CDATA[academia]]></category><category><![CDATA[Startups]]></category><dc:creator><![CDATA[Rahul Ahire]]></dc:creator><pubDate>Tue, 09 May 2023 17:11:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1683631389681/2769c2f4-1351-496b-a4d2-d4fff062f9e2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>IBM acquired Red Hat, the makers of Red Hat Linux and other open source software for 34 Billion USD for what essentially you can rip off on GitHub for free.</p>
<p>In my <a target="_blank" href="https://blog.rahulahire.com/my-10-year-career-plan">previous article</a>, I mentioned creating a private firm to empower everyone to do their independent research without the need of any university but I described it vaguely. Well, this time I want to explain all its details i.e what are the challenges and how can we solve them.</p>
<p>First, I want to give a brief overview of people's perception of physics and the research world (or at least what I think it is). When Nasa launched JWST in space, everyone was waiting to see how good it was and when Nasa released the first few images on social media, it received millions of views and likes. The show Cosmos by Nat Geo has been one of the most phenomenal shows of all time which got millions of people to get curious about space. There are many more such examples and it's the deep primal instinct to know why we are here and where we came from. Despite all of it, many people find physics or academia very challenging and very few people go on to invest their time and energy in it. But, why is that?</p>
<p>Being a self-taught developer myself, I truly love the open-source culture and most importantly the ecosystem that we have. It is what allowed me to know and write software without having any educational degree. I mean there are a ton of tutorials on how to build an app, make AI models, etc. Plus everything is documented well in the open source community which makes it easy for us to build things easier and faster. But it wasn't the case from the beginning. In 90's many IT firms had to write their own tech stack and compilers to build their products. Not only was this tedious and time consuming but also very expensive. Soon, the birth of open-source tech like Linux and others made people realise that it's better to collaborate with people and build a common solution for all which not only saves their time and money but drastically increases productivity. Many people have gone on to offer complimentary services and support to enterprises on their open source products which allowed them to maintain it sustainably. The success of Blender and Red Hat is one of the countless examples that you can find everywhere.</p>
<p>Now what does this do with making people excited about physics? First, we need to look at the aspect of the entry barrier. Now there is a limited number of good reputable colleges in every country which mean even if all the students want to go there and learn new things, they can't. Most of the universities are very expensive to build and sustain and often require grants and govt. funding. Their influence is also very limited as they operate offline and they cannot scale widely which means we are leaving enormous opportunities on the table as very few people get the opportunity to create new things. Sometimes even researchers have to compete amongst themselves for research funding which results in a zero sum environment. Even Lex Fridman mentions it in his video - <a target="_blank" href="https://youtu.be/M-ZH3psUbfU?t=410">Elon Musk: Advice for Young People | Lex Fridman Podcast Clips</a>.</p>
<p>So how does Experientia fit in this aspect? To be clear we are not meant to be a replacement for university and neither our goal is to compete but rather collaborate and create open opportunities for everyone.</p>
<blockquote>
<p><strong>Experientia aims to empower everyone to equip themselves with the right information and tools to do their independent research and contribute to the well being of humanity.</strong></p>
</blockquote>
<p>Now the question remains how and what are we gonna do? There are essentially 3 pillars of Experientia to achieve this vision</p>
<ol>
<li><p>Research and Journalism</p>
</li>
<li><p>Media Production</p>
</li>
<li><p>Comprehensive tech stack</p>
</li>
</ol>
<p>Let's try to understand how we want to approach it. Personally, I want to build this organisation without any VC or Angel funding so sustainability will be crucial in the first few years. For any business to survive it needs to have a sizeable distribution. So first we want to tell the stories of how things are made or get created. Normally in textbooks, the context is very focused on the subject eg. this theory was flawed and was later corrected by XYZ but most of us don't know why it was created, what's the detailed history behind it and how it influenced the world.</p>
<blockquote>
<p>At the time of writing this article, I'm researching on how light Bulb invented Quantum Physics, how the <a target="_blank" href="https://youtu.be/rkZzg7Vowao">Paxos algorithm</a> was sort of inspired by Einstein's Relativity and how it runs today's modern Datacenters.</p>
</blockquote>
<p>Initially, we want to package all of it in a good storytelling video production format across YouTube and other social media like what <a target="_blank" href="https://www.youtube.com/@johnnyharris">Johnny Harris</a>, <a target="_blank" href="https://www.youtube.com/@veritasium">Veritasium</a>, <a target="_blank" href="https://www.youtube.com/@RealEngineering">Real Engineering</a>, <a target="_blank" href="https://www.youtube.com/@ScienceClicEN">ScienceClic</a>, etc. are doing. After when we get a sizeable audience and especially their trust, we would like to create in-depth study material on a wide variety of Astrophysics and potentially more domain in future. For eg. Nasa has Terabytes of public archieve be it in GIS, satellite data and imagery, etc. We can take this data and educate people on this is how scientists do their analysis, this is how we can use AI/ML to get the image of black hole. Again, it's just an one simple example but the application can go beyond it and we also intent to create good documentation and arrange information neatly as right now there's no-one who is doing this on a larger scale. With this, our aim is to shorten the learning curve of physics.</p>
<p>Talking about the third pillar of creating a tech stack, I believe this is where we will earn majority of our revenue. Education alone take can only take you so far ahead and when you start working you need tools to simplify your life. Take for eg. reading or reviewing research papers. The problem with research papers is it's hard to find what you want unless you've been told to access specific papers. Especially for beginners, it's very hard to read research papers are they are written in extremely technical terms. Forget about common person even getting the gist of it. So now, what if we aggregate all those papers and create a search engine with GPT like integration that not only gets you the data for what you need but also explains you on different tiers like high school, undergrad, Ph.D., etc. and also help everyone to navigate amongst peer review. Plus, our system will automatically suggest a guided and structured path on how to master a specific topic. Yes, we'll too make our own content for it to make it more relevant.</p>
<p>To elaborate on it, Publishing houses and Journal like Nature, Wiley, Taylor and Francis, Springer, etc. are notoriously famous for charging researchers and faculty 1000's of dollars but to publish a 5MB PDF which doesn't even cost 1 USD to store lifetime and the business model of them is quite predatory as researchers have limited distribution to showcase their work. We have a better model where the papers are automatically circulated algorithmically instead of letting human bias creep in. It's kinda like your Instagram feed where the content served to you automatically gets updated based on your activity. We'll also give you a powerful analytics engine on how your paper is being accessed all around the globe so that researchers get informed feedback which is vastly better than a preprint server like ArXiv. In this way, more people's work can be appreciated and recognise thus progressing faster and substantially remove the inefficiency in academia.</p>
<p>We can also create frameworks for specific use cases. One of the things that I found is there are many professors out there who know their thing but don't have a good online presence so that people can interact with them. So, what if we can create a centralised platform where we connect everyone including universities, students, faculties and physics enthusiasts making an overall ecosystem that way ideas can flow faster and everything can be easily searchable.</p>
<p>I've just started to learn about how academia works and overall our vision is to create an end-to-end ecosystem where anyone can learn and contribute to each other. Basically, we wanna be like an AWS for Physics and academia in terms of tech products and solutions. Also, connecting physics R&amp;D with real world engineering problems as fast as possible. For example, we have known the concepts of linear algebra, calculus for centuries but it was only in the past 70-80 years we got to use it to drive the pixels on the screen, create AI/ML models, etc.</p>
<p>That's basically a brief theme of what we are trying to do with Experientia. If you have any suggestion or feedback, please let us know in the comment section. We thank you for reading this article.</p>
]]></content:encoded></item><item><title><![CDATA[My 10 year career plan]]></title><description><![CDATA[In the past, I've made a video describing my three year self learning experience after dropping out of the college. This article is a continuation to it. I actually planned for a make a video on describing the details for my future plans but thought ...]]></description><link>https://blog.rahulahire.com/my-10-year-career-plan</link><guid isPermaLink="true">https://blog.rahulahire.com/my-10-year-career-plan</guid><category><![CDATA[Career]]></category><category><![CDATA[education]]></category><category><![CDATA[Startups]]></category><category><![CDATA[technology]]></category><category><![CDATA[life]]></category><dc:creator><![CDATA[Rahul Ahire]]></dc:creator><pubDate>Tue, 12 Jul 2022 18:19:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/APvZiFU7v1A/upload/v1657556963124/4ZfjT1aME.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the past, I've <a target="_blank" href="https://www.youtube.com/watch?v=0c4reWmI5EE">made a video</a> describing my three year self learning experience after dropping out of the college. This article is a continuation to it. I actually planned for a make a video on describing the details for my future plans but thought this blog would be more appropriate for it.</p>
<p>First of all, why am I writing this? Whom I'm trying to impress - actually no-one. The thing is I want this article to set as a vision statement for what I've been brewing in mind since 2019 and lay is straight upfront to everyone whom I want to associate with my work so it become easy for them to understand why I'm doing what I'm doing. Also, during my interaction with my friends and family, I received numerous weird reaction on me telling them I'm a dropout (but I understand its a new thing for them). So hopefully, this will serve both purpose.</p>
<p>Starting with story, I've already talked what my childhood was like in the video. So, I'm not going to repeat it and come straight to point in which I want to expand within coming 10 years.</p>
<ol>
<li><p><strong>Create an independent media - research company in space science.</strong></p>
</li>
<li><p><strong>Make P2P file transferring easier for general public and create tools for media houses requiring high bandwidth.</strong></p>
</li>
<li><p><strong>A Data analytics company that could provide meaningful insight to individuals, farmers, etc.</strong></p>
</li>
</ol>
<blockquote>
<p>Long behold since the beginning of mankind we always wondered what's in the sky and why do we even exist on this blue pale dot?</p>
</blockquote>
<p>Since childhood, I've been fascinated with Nat-Geo and Discovery's space documentaries. Especially the *Cosmos *and <em>Into the wormhole</em>. So, growing up I knew I have to do something in it. But before 2016, there was no <a target="_blank" href="https://youtu.be/9Oy2dAjrUL0">jio revolution</a>. So, access to information was pretty low and all the option that I knew at that point of time was joining NASA and ISRO which to be honest are pretty tough to crack. Also, I had that feeling when I was of age 14 years that I don't want to be in backstage. As the time passed, the idea of doing something in the space science got cornered somewhere in mind and I started learning programming which I liked quite a bit and as of today i.e 2022 I know JS, Serverless stack and currently learning Go and Rust.</p>
<p>Starting from 2018-19, I've been actively watching many science creator channel like Veritasium, PBS space time and all other creator. Amongst all, the journey of Linus Sebastian aka <a target="_blank" href="https://www.youtube.com/c/LinusTechTips">Linus Tech Tips</a> amused me the most. I mean he went from graduating his college to now employing 50+ people and earning millions of dollars "just" by the power of his YouTube channel. Something clicked in my mind and that feeling came back in 2020-2021 of wanting to explore in astronomy. This is indeed the most perfect way of how I wanted the things to carry out. Before 2015, I thought you can't make money out of it but here I was proven wrong. So at the beginning of this year(2022), I thought about how to go now onward and here's some of the overview.</p>
<ul>
<li><p>One of thing that I observed is that there are indeed explanatory video on every aspect of space science but they don't go very deep and also there's not a lot of structured courses/material that could make you sufficiently good enough that you could right your own thesis or research paper without going to university. This is actually the reality of the software IT world which is build on open source and high quality coding tutorial is available for free and cheap cost.</p>
</li>
<li><p>There's tons of things that are worth discussing with regards to astronomy but in the first two years we'll just experiment on the various topics to see what works and which is more complicated. For any business to survive, having a strong distribution is essential. So, in the beginning we want to making series on the things that general audience might have thought in some way. And as we gain more and more audience, we'll create an online platform that help anyone to understand relativity, Black holes, computation in satellite imagery, etc. Basically we want people to be a self taught astrophysicist without the need of expensive college degrees. I'm pretty sure this hasn't been done before in a scale and this is something we want to bring our own uniqueness to it. This is also important in terms of keeping the company financially up-float.</p>
</li>
<li><p>I've always questioned that why the tech companies move so fast but the many scientist work tirelessly till their hair turns grey but still not able to get the recognition they deserve and why things move so slowly in astronomy. For tech companies the ROI are much instantaneous whereas in case of Mathematics and Astrophysics which runs primarily on donations, things takes at least 50-100 years to come in daily life. Look at the quantum computers, the first quantum phenomena were found in early 1900's but its now that we are able to use it. So clearly, Astrophysics isn't wastage of our money. But we need to speed things up like <a target="_blank" href="https://en.wikipedia.org/wiki/Moore%27s_law">moore's law</a>. In coming years, we aspire to bring great minds together and compensate them well enough to achieve high efficiency like <a target="_blank" href="https://www.youtube.com/watch?v=9uRK8Delzvk">neuralink</a> and do our independent research.</p>
</li>
</ul>
<p>And I'm confident enough that all of these could be achieved in next 2-3 years while keeping this venture completely bootstrapped as I don't want to opt for venture capital.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://twitter.com/MeRahulAhire/status/1516434746334920709">https://twitter.com/MeRahulAhire/status/1516434746334920709</a></div>
<p> </p>
<p><strong>Coming to second venture</strong>, I'll only begin it once we have the systems and process to run above mentioned stuff neatly so I can focus on it. When I started learning coding I watch the film <a target="_blank" href="https://www.imdb.com/title/tt1285016">Social Network</a> which is glorified movie of how FB started. While learning basics of webdev I thought facemash is a great stuff to make just for coding practice and possibly make money out of it. First of all it took a lot of time for me to be familiar with AWS. You might ask what AWS has to do here? Well my goal was to build scalable application from start and learning AWS took almost a year. By that time, I was just not into the idea of making facemash. The thing is Facemash is basically like tinder which I'm not into. So I dropped that idea.</p>
<p>But in mid 2021, I happen to saw a demo of <a target="_blank" href="https://www.youtube.com/watch?v=WmR9IMUD_CY">webRTC</a> which is a P2P way of communication. Given though, I was aware of privacy concerns regarding FB, Whatsapp, etc. I thought maybe we need something like that especially for sharing files. Texting is fast but sharing large file isn't. Take for example the gigabit broadband has reached in all major cities in India but there aren't as many services that could take advantage of it. If you want to share a large file to your friend, probably, you'd use google drive, dropbox, etc and then share the links with your friend or coworkers in which you need to wait for files to be unzipped and pay for storage cost. Let say even if you do this, the bandwidth (upload speed) is capped around 300-400 Mbps by these providers which doesn't fully utilise gigabit speed. I mean why can't send file as easily as I text someone no matter how big that file is.</p>
<p>I've been inspired by BitTorrent and WebRTC protocol to make this happen. But I realise both aren't ideal to what I want to build. WebRTC uses array buffers which makes it slow. BitTorrent is fast but has no access control i.e anyone with torrent file or magnet link can download the file. So currently I'm discovering what tools/process are available that I use to build a P2P connection that could truly saturate 1, 10 or even 100 Gbps connectivity. I want to target mostly media/content creators who want security and fast access to the file for collaboration. Also there's other aspect to it like faster cloud migration, multi cloud storage, mounting cloud storage as drives, etc. So there's a lot of networking and building of custom protocols involved here which I'm studying and hopefully to develop such application with Go/Rust.</p>
<p><strong>Lastly it's about data analytics.</strong> This is the which I'll doing at last as it required millions of Dollars in R&amp;D. This was the time in 2019, when I was lying on my bed in afternoon and casually a thought came in my mind that why don't we have automated todo list app in which we don't need to fill it, it does automatically understand what we need and based upon it, it should alert us accordingly. Just think about for a moment. Most of our time pretty much goes into online world. Every scroll, touch, likes are being recorded to serve you relevant ads. Instagram know more about you more than your parents i.e whom do you like, how many times do you visit your crush's profile, etc. You get the point what I'm trying to say.</p>
<p>So, why not to use all those data about yourself and use it to create positive habits and goals that you want to achieve and based on your data we'll help you to slowly and effectively steer your habits for better life and be productive in your work. Lets say If we know where do you live, what do you eat, how many family members you have, we can auto generate list of item to take on grocery stores so you don't need to worry about it. If you want to go to holiday, we can fetch you the info which allows you to enjoy your holiday in best way. These are just few of the many examples. It can be also used in stock market and especially for farmers to enable them with right information that's needed to them.</p>
<p>But whats worries me the most is how people will react to the privacy issue. For that, I think is better to open source it for ensuring trust and keep this on a freemium model for financial sustainability. This is still in ideation phase. We'll need to study the complexity of this problem to be sure what's coming ahead.</p>
<blockquote>
<p>And all of these are something I want to achieve before I reach 30 and be financially free by 25 i.e having 3-4 Cr. INR in bank account for financial retirement. And amongst all, the first one is my utmost priority.</p>
</blockquote>
<p>This is pretty much what my vision is. If you have any question, please let me know. Thanks...</p>
]]></content:encoded></item><item><title><![CDATA[5 Simple Steps to master DynamoDB]]></title><description><![CDATA[Serverless is pretty much the hot topic that everyone wants to join in
With the flexibility in of not managing the infrastructure while able to scale infinitely is just awesome for any company and dev as it saves overhead cost.
With that said, if you...]]></description><link>https://blog.rahulahire.com/5-simple-steps-to-master-dynamodb</link><guid isPermaLink="true">https://blog.rahulahire.com/5-simple-steps-to-master-dynamodb</guid><category><![CDATA[DynamoDB]]></category><category><![CDATA[AWS]]></category><category><![CDATA[aws lambda]]></category><category><![CDATA[serverless]]></category><category><![CDATA[education]]></category><dc:creator><![CDATA[Rahul Ahire]]></dc:creator><pubDate>Sun, 12 Dec 2021 18:10:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1639332516086/O0p1S-K8B.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Serverless is pretty much the hot topic that everyone wants to join in
With the flexibility in of not managing the infrastructure while able to scale infinitely is just awesome for any company and dev as it saves overhead cost.</p>
<p>With that said, if you want to get into the world of serverless, you might have been spending time in understanding the AWS lambda, API gateway, S3 and other service. But amongst all DynamoDB is the most painful to understand due to its completely new philosophy and the way it operates as compared to traditional SQL databases. </p>
<p>So to save your time, I have compiled down top 5 things that'll help you cut down your time while learning DynamoDB.</p>
<ul>
<li><strong>1. Simplify the Jargons</strong></li>
</ul>
<p>DynamoDB uses a lot of complicated jargon like Partition Key, Sort Key, Global Secondary index, etc. If you have worked with other databases then figure out how it co-relates with what you have learnt.</p>
<ul>
<li><strong>2. Understand how different DynamoDB is</strong></li>
</ul>
<p>Probably right now you might be dealing with normalization, joins and other things. Being NoSQL, DynamoDB has none of them. Instead, if you want to do the crud operations, you need to know how are the item stored and how it can be accessed.</p>
<ul>
<li><strong>3. Know the Access patterns</strong> </li>
</ul>
<p>If you try to compare DynamoDB with MongoDB, you'll notice that its less flexible in terms of how DynamoDB allows you to model your data and certainly there's pros and cons to it that you need to plan for data modelling in upfront considering what feature you need to give to end user. But due to this DynamoDB performs really well. Even Amazon uses DynamoDB for its prime day events which receives couple of billion request in that time frame</p>
<ul>
<li><strong>4. Integrate DynamoDB with other services</strong></li>
</ul>
<p>DynamoDB has pretty amazing set of features like streams which allows you to build real-time apps, analyze data using kinesis, redshift, etc. So, knowing how to use it will help you to design complex set of features in no time. </p>
<ul>
<li><strong>5. Learn Effectively</strong></li>
</ul>
<p>Chances are if you're reading this then you already have started learning DynamoDB. Back when I started to learn DynamoDB there was no any proper resource that could tell me how to learn it properly. Previously I had known MongoDB but learn this took me around 6 months to properly understand DynamoDB and I don't want you to go through the painful process of trial and error. </p>
<p>Instead with my own experience, I created the Ultimate DynamoDB Course that will effortless help you master all necessary concepts in just few days. You can learn more <a target="_blank" href="https://rahulahire.com">about it here</a>. I'm sure you'll love it.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1639328024621/PQ6qrOJCL.png" alt="The Ultimate DynamoDB Course - Google Chrome 10-12-2021 20_16_31.png" /></p>
]]></content:encoded></item><item><title><![CDATA[How to implement login system using DynamoDB - By Rahul Ahire]]></title><description><![CDATA[Login system is perhaps the most important component of any modern application. With the rise of serverless adoption in IT, we also need to look forward to adapt our application according to the suitable stack. DynamoDB being one of the most popular ...]]></description><link>https://blog.rahulahire.com/how-to-implement-login-system-using-dynamodb-by-rahul-ahire</link><guid isPermaLink="true">https://blog.rahulahire.com/how-to-implement-login-system-using-dynamodb-by-rahul-ahire</guid><category><![CDATA[DynamoDB]]></category><category><![CDATA[AWS]]></category><category><![CDATA[aws lambda]]></category><category><![CDATA[serverless]]></category><category><![CDATA[Databases]]></category><dc:creator><![CDATA[Rahul Ahire]]></dc:creator><pubDate>Fri, 10 Dec 2021 15:25:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1639149739459/U5gNoYlkED.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Login system is perhaps the most important component of any modern application. With the rise of serverless adoption in IT, we also need to look forward to adapt our application according to the suitable stack. DynamoDB being one of the most popular NoSQL database in AWS serverless jungle, Let see an basic example of how we can implement sign-in/up functionality.</p>
<p>Now, before going ahead one thing I'd like to mention that we all know there's a lot of aspect that goes into build a safe and secure login feature i.e. SSO, OAuth, JWT, Passwords, etc. But to simplify stuff little bit, we aren't gonna talk about it. Instead, let assume to make an application just by entering an email address just for sake of understanding it.</p>
<p>Traditionally, we had two option <code>Sign-in</code> and <code>Sign-up</code> on any website. So according to that let's create 2 Lambda function to handle that task like the following image.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1639138603977/rfyRL8ljX.png" alt="dynamodb login blog – lambda ddb flow.png" />
so the <code>/sign-in</code> and <code>/sign-out</code> with go to respective lambda handler.</p>
<p>Before proceeding any further, We need to look upon the layout/design of our DynamoDB table during its creation. Assuming that every email id on earth is unique, all we need is a single index or what DynamoDB would like to call it as a <strong>Primary Key</strong> in their technical vocabulary.</p>
<p> First let's see the code to create our DynamoDB table from local computer using <strong>Node.js</strong></p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> AWS = <span class="hljs-built_in">require</span>(<span class="hljs-string">'aws-sdk'</span>);

<span class="hljs-keyword">const</span> dynamodb = <span class="hljs-keyword">new</span> AWS.DynamoDB({
    <span class="hljs-attr">region</span>: <span class="hljs-string">'ap-south-1'</span>
});

<span class="hljs-keyword">var</span> params = {
    <span class="hljs-attr">TableName</span>: <span class="hljs-string">'itemOps'</span>,
    <span class="hljs-attr">AttributeDefinitions</span>: [
        {
            <span class="hljs-attr">AttributeName</span>: <span class="hljs-string">'email'</span>,
            <span class="hljs-attr">AttributeType</span>: <span class="hljs-string">'s'</span>
        }
    ],
    <span class="hljs-attr">KeySchema</span>: [
        {
            <span class="hljs-attr">AttributeName</span>: <span class="hljs-string">'email'</span>,
            <span class="hljs-attr">KeyType</span>: <span class="hljs-string">'HASH'</span>
        }
    ], 
    <span class="hljs-attr">BillingMode</span>: <span class="hljs-string">'PAY_PER_REQUEST'</span>
};
<span class="hljs-comment">//documentClient dont support creation of Table</span>

dynamodb.createTable(params, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">err, data</span>) </span>{  
    <span class="hljs-keyword">if</span> (err)
        <span class="hljs-built_in">console</span>.log(err, err.stack); <span class="hljs-comment">// an error occurred</span>
    <span class="hljs-keyword">else</span> <span class="hljs-built_in">console</span>.log(data); <span class="hljs-comment">// successful response</span>
});
</code></pre>
<p>What it does is, it creates the table like below</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>email</td><td>attribute(info)</td></tr>
</thead>
<tbody>
<tr>
<td>abc@abc.com</td><td>[...data] </td></tr>
<tr>
<td>xyz@abc.com</td><td>[...data]</td></tr>
</tbody>
</table>
</div><p>Essentially we specified in params that create a table <code>itemOps</code> which only contains one index i.e <code>email</code>.</p>
<pre><code><span class="hljs-keyword">var</span> <span class="hljs-keyword">params</span> = {
    TableName: <span class="hljs-string">'itemOps'</span>,
    AttributeDefinitions: [
        {
            AttributeName: <span class="hljs-string">'email'</span>,
            AttributeType: <span class="hljs-string">'s'</span>
        }
    ],
};
</code></pre><p>Lets starts implementing a <code>sign-up</code> function. We'll ignore the lambda handler code for now and straightaway see how can we do that.</p>
<p>Initially you might think to check if user exists or not is, first try to use <a target="_blank" href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#getItem-property"><code>getItem</code></a> and use <code>try</code> and <code>catch</code> block to do post processing. Well, you can do that but its unnecessary extra round trip which is comparatively expensive. Instead, DynamoDB offers you a parameter called <code>ConditionalExpression</code> i.e its a way to set condition before doing something.</p>
<p>These are the six conditions you can use in DynamoDB.</p>
<ul>
<li><code>attribute_exists</code></li>
<li><code>attribute_not_exists</code></li>
<li><code>attribute_type</code></li>
<li><code>begins_with</code></li>
<li><code>contains</code></li>
<li><code>size</code></li>
</ul>
<p><strong>1.</strong>  For <code>Sign-up</code>, we need to add data when the email isn't present in our table. For that <code>attribute_not_exists</code> is perfect for us.</p>
<pre><code><span class="hljs-attribute">ConditionExpression</span>: <span class="hljs-string">'attribute_not_exists(email)'</span>
</code></pre><pre><code>const AWS <span class="hljs-operator">=</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'aws-sdk'</span>);

const docClient <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> AWS.DynamoDB.DocumentClient({
    region: <span class="hljs-string">'ap-south-1'</span>
});

<span class="hljs-keyword">var</span> params <span class="hljs-operator">=</span> {
    TableName: <span class="hljs-string">'itemOps'</span>,
    Item: {
        email: <span class="hljs-string">'abc@example.com'</span>,
        data:<span class="hljs-string">'this is a random data'</span>
    },
    ConditionExpression: <span class="hljs-string">'attribute_not_exists(email)'</span> <span class="hljs-comment">// &lt;------- here</span>
};

docClient.put(params, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">err, data</span>) </span>{
    <span class="hljs-keyword">if</span> (err)
        console.log(err, err.stack); <span class="hljs-comment">// an error occurred</span>
    <span class="hljs-keyword">else</span> console.log(data); <span class="hljs-comment">// successful response</span>
});
</code></pre><p><strong>2.</strong>  Same is the case for <code>Sign-in</code>, except we need to use this <code>attribute_exists</code></p>
<pre><code> <span class="hljs-attribute">ConditionExpression</span>: <span class="hljs-string">'attribute_not_exists(email)'</span>
</code></pre><p>and the code remains the same except for conditional expression.</p>
<pre><code>const AWS <span class="hljs-operator">=</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'aws-sdk'</span>);

const docClient <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> AWS.DynamoDB.DocumentClient({
    region: <span class="hljs-string">'ap-south-1'</span>
});

<span class="hljs-keyword">var</span> params <span class="hljs-operator">=</span> {
    TableName: <span class="hljs-string">'itemOps'</span>,
    Item: {
        email: <span class="hljs-string">'abc@example.com'</span>,
        data:<span class="hljs-string">'this is a random data'</span>
    },
    ConditionExpression: <span class="hljs-string">'attribute_exists(email)'</span> <span class="hljs-comment">// &lt;------- here</span>
};

docClient.put(params, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">err, data</span>) </span>{
    <span class="hljs-keyword">if</span> (err)
        console.log(err, err.stack); <span class="hljs-comment">// an error occurred</span>
    <span class="hljs-keyword">else</span> console.log(data); <span class="hljs-comment">// successful response</span>
});
</code></pre><p>not that you know how to use these terms, you can go on to make it complex enough with other things to be useful in real scenario.</p>
<p>To know more about the various DynamoDB terminology, <a target="_blank" href="https://github.com/MeRahulAhire/The-Ultimate-DynamoDB-Course/blob/master/attributeExpression/README.md">visit this github page</a></p>
<p>This blog was inspired from my <strong>Ultimate DynamoDB Course</strong> The most effortless way to master DynamoDB in just few days. <a target="_blank" href="https://rahulahire.com/dynamodb">Learn more</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1639147810584/vnZDGS5TT.png" alt="The Ultimate DynamoDB Course - Google Chrome 10-12-2021 20_16_31.png" /></p>
<p>If you have any thoughts, suggestion or feedback, Please do let me know about it in comment section.</p>
]]></content:encoded></item><item><title><![CDATA[How to Upload file to S3 via S3:putObject? By Rahul Ahire]]></title><description><![CDATA[So you just got started with serverless or S3 and want to know how to upload object programmatically with nodejs? Well here's an in-depth analysis about it.
This article is inspired from my YouTube tutorial - The Ultimate S3 & Nodejs Guide. 


First,...]]></description><link>https://blog.rahulahire.com/how-to-upload-file-to-s3-via-s3putobject-by-rahul-ahire</link><guid isPermaLink="true">https://blog.rahulahire.com/how-to-upload-file-to-s3-via-s3putobject-by-rahul-ahire</guid><category><![CDATA[AWS]]></category><category><![CDATA[aws lambda]]></category><category><![CDATA[Amazon S3]]></category><category><![CDATA[APIs]]></category><category><![CDATA[axios]]></category><dc:creator><![CDATA[Rahul Ahire]]></dc:creator><pubDate>Wed, 27 Oct 2021 15:34:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1635349755103/tY_Rg_ekPr.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>So you just got started with serverless or S3 and want to know how to upload object programmatically with nodejs? Well here's an in-depth analysis about it.</p>
<p>This article is inspired from my YouTube tutorial - The Ultimate S3 &amp; Nodejs Guide. </p>
<iframe width="100%" height="315" src="https://www.youtube.com/embed/6VHc41idHZs"></iframe>

<p>First, we need to understand the various method through which we can upload file to S3 bucket</p>
<ol>
<li><strong>PutObject</strong></li>
<li><strong>Pre-Signed Url</strong></li>
<li><strong>Multipart Upload</strong></li>
</ol>
<p>For simplicity, I'll only talk about first one and we can discuss the other ones in another blog.</p>
<p><code>putObject</code> physically takes the files in binary encoding and then tries to upload it. Let's say we want to make an API that can upload the profile pic image to S3 bucket. In this case, there involves two part, first one being frontend and second one being backend. </p>
<p>For frontend we'll keep it simple. No Reactjs, nothing and for backend we'll use <code>api-gateway + Lambda</code> with serverless framework to set up our backend. </p>
<p>Let's focus of easier on frontend HTML + JavaScript and here's code below</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">input</span>  <span class="hljs-attr">type</span>=<span class="hljs-string">"file"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"putObject"</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"./frontendPutObject.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js"</span> <span class="hljs-attr">crossorigin</span>=<span class="hljs-string">"anonymous"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
</code></pre>
<pre><code class="lang-js"><span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'putObjectBtn'</span>).addEventListener(<span class="hljs-string">'click'</span>, <span class="hljs-function">() =&gt;</span> {
    <span class="hljs-keyword">const</span> putObject_fileInput = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'putObject'</span>);
    <span class="hljs-keyword">const</span> file = putObject_fileInput.files[<span class="hljs-number">0</span>];
    <span class="hljs-keyword">const</span> fileName = file.name;

    <span class="hljs-keyword">const</span> reader = <span class="hljs-keyword">new</span> FileReader();
    <span class="hljs-keyword">const</span> url = <span class="hljs-string">`https://68qb5fre0e.execute-api.ap-south-1.amazonaws.com/dev/putObject`</span>;
    <span class="hljs-keyword">const</span> config = {
        <span class="hljs-attr">onUploadProgress</span>: <span class="hljs-function">(<span class="hljs-params">progressEvent</span>) =&gt;</span>
            <span class="hljs-built_in">console</span>.log(<span class="hljs-built_in">parseInt</span>(<span class="hljs-built_in">Math</span>.round(progressEvent.loaded / progressEvent.total * <span class="hljs-number">100</span>)))
    };

    reader.onloadend = <span class="hljs-function">() =&gt;</span> {
        <span class="hljs-keyword">const</span> base64String = reader.result.split(<span class="hljs-string">'base64,'</span>)[<span class="hljs-number">1</span>];

        <span class="hljs-keyword">const</span> dataInfo = {
            <span class="hljs-attr">fileName</span>: fileName,
            <span class="hljs-attr">base64String</span>: base64String
        };

        axios
            .post(url, dataInfo, config)
            .then(<span class="hljs-function">(<span class="hljs-params">r</span>) =&gt;</span> {
                <span class="hljs-built_in">console</span>.log(r);
            })
            .catch(<span class="hljs-function">(<span class="hljs-params">err</span>) =&gt;</span> {
                <span class="hljs-built_in">console</span>.error(err);
            });
    };
    reader.readAsDataURL(file);
});
</code></pre>
<p>If you look carefully at the code, you'll notice that that we are taking the file and then converting it into base64 encoding which is what we need to send to our Lambda handler.</p>
<p>In this case, I'll assume you know how to create rest API with serverless framework or with any other deployment framework. If you don't know it, here's my video tutorial on <a target="_blank" href="https://www.youtube.com/watch?v=WolmnbYPhlU">Serverless Framework Crash Course</a>. With that said, let see how does the lambda handler looks like.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> AWS = <span class="hljs-built_in">require</span>(<span class="hljs-string">'aws-sdk'</span>);
<span class="hljs-keyword">const</span> s3 = <span class="hljs-keyword">new</span> AWS.S3({ <span class="hljs-attr">signatureVersion</span>: <span class="hljs-string">'v4'</span>, <span class="hljs-attr">region</span>: <span class="hljs-string">'ap-south-1'</span> });

<span class="hljs-built_in">exports</span>.handler = <span class="hljs-keyword">async</span> (event) =&gt; {
    <span class="hljs-keyword">const</span> body = <span class="hljs-built_in">JSON</span>.parse(event.body);
    <span class="hljs-keyword">const</span> fileName = body.fileName;
    <span class="hljs-keyword">const</span> base64String = body.base64String;
    <span class="hljs-keyword">const</span> buffer = Buffer.from(base64String, <span class="hljs-string">'base64'</span>);

    <span class="hljs-keyword">try</span> {
        <span class="hljs-keyword">const</span> params = {
            <span class="hljs-attr">Body</span>: buffer,
            <span class="hljs-attr">Bucket</span>: process.env.bucketName,
            <span class="hljs-attr">Key</span>: fileName,
        };

        <span class="hljs-keyword">await</span> s3.putObject(params).promise();

        <span class="hljs-keyword">return</span> {
            <span class="hljs-attr">statusCode</span>: <span class="hljs-number">200</span>,
            <span class="hljs-attr">headers</span>: {
                <span class="hljs-string">'Access-Control-Allow-Origin'</span>: <span class="hljs-string">'*'</span>,
                <span class="hljs-string">'Access-Control-Allow-Credentials'</span>: <span class="hljs-literal">true</span>
            },
            <span class="hljs-attr">body</span>: <span class="hljs-string">`file Uploaded`</span>
        };
    } <span class="hljs-keyword">catch</span> (err) {
        <span class="hljs-built_in">console</span>.log(err);
        <span class="hljs-keyword">return</span> {
            <span class="hljs-attr">statusCode</span>: <span class="hljs-number">500</span>,
            <span class="hljs-attr">headers</span>: {
                <span class="hljs-string">'Access-Control-Allow-Origin'</span>: <span class="hljs-string">'*'</span>,
                <span class="hljs-string">'Access-Control-Allow-Credentials'</span>: <span class="hljs-literal">true</span>
            },
            <span class="hljs-attr">body</span>: <span class="hljs-built_in">JSON</span>.stringify(err)
        };
    }
};
</code></pre>
<p>In this case we are using <a target="_blank" href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#putObject-property">putObject</a> API to upload our file to S3. As you can the <code>putObject</code> API only accepts the data in binary format so, we had to convert base64 to binary.</p>
<pre><code><span class="hljs-keyword">const</span> buffer = Buffer.<span class="hljs-keyword">from</span>(base64String, <span class="hljs-string">'base64'</span>);
</code></pre><p>And, that's how you can upload file to S3. But, a big but, There's a limit to this method that API gateway has time <a target="_blank" href="https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html">limit</a> of just 30 second and have max payload size of 10 MB. What that means is, if your file upload takes longer than 30s then the upload process will stop. Not the ideal case to upload large file object. In that case, you should use Pre-signed URL or Multipart Upload.</p>
<p>With that said, Thanks for reading this article and I'll see you next time.</p>
<p>Website - <a target="_blank" href="https://rahulahire.com">RahulAhire.com</a></p>
]]></content:encoded></item><item><title><![CDATA[How much area does India to completely switch over Solar Power? By Rahul Ahire]]></title><description><![CDATA[Everyone loves green energy. I mean who really wants to burn coal forever to generate electricity while risking the environment. That's why A lot of countries including India are trying to diversify their energy production portfolio and adopting sola...]]></description><link>https://blog.rahulahire.com/how-much-area-does-india-to-completely-switch-over-solar-power-by-rahul-ahire</link><guid isPermaLink="true">https://blog.rahulahire.com/how-much-area-does-india-to-completely-switch-over-solar-power-by-rahul-ahire</guid><dc:creator><![CDATA[Rahul Ahire]]></dc:creator><pubDate>Sat, 23 Oct 2021 19:50:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1635006756796/eeMoDhJ18.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Everyone loves green energy. I mean who really wants to burn coal forever to generate electricity while risking the environment. That's why A lot of countries including India are trying to diversify their energy production portfolio and adopting solar energy is essential step in that progress. </p>
<p>But, we might have question that how much land do we need to power entire country only by solar? Well, Let's find it out...</p>
<p>According to this <a target="_blank" href="https://en.wikipedia.org/wiki/Electricity_sector_in_India">Wikipedia article</a>, In year 2019-2020 India produced around 1.6 Terawatt hour of electricity. Now, we calculate electricity by kWh or Kilowatt hour which equates to 1600000000 kWh during that year. So, the per day consumption would be 4,371,584 kWh. </p>
<p>Let's come to solar panels. A typical solar panel of 1 Sq. m produces 150 Wh or 0.15 kWh. Now its comes down to basic math.</p>
<pre><code class="lang-bash">4,371,584 Sq. m / 0.15 = 29,143,893 Sq. m
</code></pre>
<p>i.e. we need 29.14 Sq. Km. of Land. But, there's catch to it that here we are assuming that solar can produce electricity 24/7 which isn't the case. Solar can only generate electricity for 6 hrs. in its peak efficiency. So, the electricity generation get quartered hence we need to multiply the land area by 4 times to cover up additional losses and given the scenario that we could store all that excess energy in batteries.</p>
<p>The ultimate land area that we need is  <strong>roughly 120 Sq. Km</strong> to provide electricity daily entirely with solar</p>
<pre><code><span class="hljs-attribute">29</span>.<span class="hljs-number">14</span> Sq. km x <span class="hljs-number">4</span> = <span class="hljs-number">116</span>.<span class="hljs-number">56</span> Sq. km
</code></pre><p>For a moment you might think that 120 Sq. km is a really big area but actually its really a small portion of Indian territory considering India's area is 3,287,240 sq. km that will just account for 0.00365%.</p>
<p>To give you an perspective, Area of Thar desert is 238,254 Sq. km which covers 7.24% of Indian landmass and we only need tiny land represented by a black dot in following image.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1635018018674/7sniPQ11a.png" alt="image.png" /></p>
<p>I hope you like this article. With that said, I'll see you next time. </p>
<p>Website - <a target="_blank" href="https://rahulahire.com">RahulAhire.com</a>. <br />
YouTube - <a target="_blank" href="https://youtube.com/rahulahireyt">youtube.com/RahulAhireYT</a><br />
Twitter - <a target="_blank" href="https://twitter.com/MeRahulAhire">twitter.com/MeRahulAhire</a></p>
<p><em>If you find any calculation mistakes then please let me know in comment box below.</em></p>
]]></content:encoded></item><item><title><![CDATA[What does your Phone number mean? By Rahul Ahire]]></title><description><![CDATA[Have you ever wondered what your phone number means and why you always can't seem to get a VIP or lucky phone number of your own choice?
This article is inspired from my recent video which you can watch below:

Now, what I'm going to mention right he...]]></description><link>https://blog.rahulahire.com/what-does-your-phone-number-mean-by-rahul-ahire</link><guid isPermaLink="true">https://blog.rahulahire.com/what-does-your-phone-number-mean-by-rahul-ahire</guid><category><![CDATA[networking]]></category><category><![CDATA[network]]></category><category><![CDATA[Technical writing ]]></category><category><![CDATA[technology]]></category><dc:creator><![CDATA[Rahul Ahire]]></dc:creator><pubDate>Mon, 11 Oct 2021 17:36:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1633952455132/YAVXQWjC_.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Have you ever wondered what your phone number means and why you always can't seem to get a VIP or lucky phone number of your own choice?</p>
<p>This article is inspired from my recent video which you can watch below:</p>
<p><iframe width="100%" height="315" src="https://www.youtube.com/embed/p6XV3SL6F4A"></iframe>
<em>Now, what I'm going to mention right here is in the context of an Indian phone number. So, the information presented is valid for Indian territory.</em></p>
<p>The logistics of the phone numbers are a bit complicated and unusual in common sense. India is a big country. Precisely the 7th largest on the planet. To manage such a large portion of the area, we need to split the land area into various administrative levels like national, state, district, cities, rural areas, etc. </p>
<p>The same goes for the Telecom industry. The total landmass is split into 4 areas- <strong>A, B, C and Metro</strong>. In total, India has 23 telecom circles.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1633954460517/8jZo4-0CJ.png" alt="Telco circle -1.png" />
Now, you might also wonder that why we Indians have only 10 digits phone numbers? Well, that's something a creation out of national numbering plan which was introduced in 2003 by Government of India which allows all of the telecom operators to allocate <strong>10 Billion</strong> phone number if you do the permutations and combination and that a lot considering that the world population is 7.5 Billion and we Indian have a total population of 1.3+ Billion and half of them uses phone every day.
and if you compare it with china they have 11 digits numbers which give them a 100 Billion numbers.</p>
<p>So who decides which telco gets which number? India currently has Airtel, BSNL, Jio and VI which are regulated by TRAI (Telecom Regulatory Authority of India) and DOT (Department of Telecommunications). According to this  <a target="_blank" href="https://en.wikipedia.org/wiki/Mobile_telephone_numbering_in_India">Wikipedia article</a>  by just knowing the first four-digit of any number you can spot to which operator does this belong and in which state this number was purchased. </p>
<p>Take for example this number which begins with 7757. This number is managed by Airtel in Maharashtra &amp; Goa circle. Similarly,</p>
<ol>
<li>9999 - managed by VI in Delhi.</li>
<li>7587 - managed by BSNL in Madhya Pradesh.</li>
<li>7020 - managed by Jio in Maharashtra and Goa.</li>
</ol>
<p>What that means is that if a person is in the state of Rajasthan and wants a VIP number starting from 7757, he/she won't get that because phone numbers are allocated as per the telecom circles. So if he/she really needs that number, he/she will need to travel to Maharashtra or tell his/her relative to buy it (if they happen to live in MH) which isn't practical just for buying a mobile phone number.</p>
<p>So it seems a game of chance and luck to get a number of our own choice. Be it Jio, Airtel or BSNL they don't give you many options when it comes to choosing your number as we saw the constraint in it. VI has started to offer  <a target="_blank" href="https://www.myvi.in/new-connection/choose-your-fancy-mobile-numbers-online">fancy numbers</a>  on their sites so if you seem to like VI and want to get a custom number then you can go for it.</p>
<p>With the rise of IoT devices and various devices that need connectivity government announced the use of 13 digit phone numbers for WIFI hotspots, dongles, EV connectivity, etc. so they don't put stress on the limited 10 digits number which is intended to use by humans.</p>
<p>We started with 9xxx series number i.e. 9000-9999 then as it started to fill up we moved to 8xxx, 7xxx series and Jio was the first to introduce 6xxx series.</p>
<p>Here's an interesting question, What happens when a telco gets bankrupt? where all the number goes? Before the Jio revolution, there were a number of options for the end consumer to whom they want to go with but when Jio came with its aggressive strategy it totally crushed many companies like Tata Docomo, Telenor, Aircel, etc. In this case, these companies could have offered the following solution:</p>
<ol>
<li>Alert end-user to port to other telcos.</li>
<li>If they get acquired by another telco (eg. Airtel bought Tata Docomo and Videocon) then it's quite possible that they will be automatically switched to the new network. eg. of Airtel.</li>
<li>If nothing happens then the number gets scrapped and get re-allocated to the existing telcos if they want to get that slot.</li>
</ol>
<p>Thanks to Mobile Portability which was introduced in January 2011 which makes things easier for the user to switch operators whenever they want. Previously they'd have to completely change the number if you want to go to idea from airtel or reliance.</p>
<p>This was for mobile number, the rules for telephone numbers are bit relaxed and they follow format which mentions the telephone code for that particular area followed by telephone number provided by any telco.</p>
<ul>
<li>11 - New Delhi, Delhi.</li>
<li>22 - Mumbai, Maharashtra.</li>
<li>33 - Kolkata, West Bengal.</li>
<li>44 - Chennai, Tamil Nadu.</li>
<li>20 - Pune, Maharashtra.</li>
<li>40 - Hyderabad, Telangana.</li>
<li>79 - Ahmedabad, Gujarat.</li>
<li>80 - Bengaluru, Karnataka.</li>
</ul>
<p>Due to the availability of multiple operators offering fixed-line (landline) services (either wired or wireless), there is an operator code for each telephone number, which is the first digit in the phone number.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Operator</td><td>Prefix</td></tr>
</thead>
<tbody>
<tr>
<td>BSNL / MTNL</td><td>2</td></tr>
<tr>
<td>Reliance</td><td>3</td></tr>
<tr>
<td>Airtel</td><td>4</td></tr>
<tr>
<td>MTS/HFCL</td><td>5</td></tr>
<tr>
<td>Tata</td><td>6</td></tr>
<tr>
<td>Datacom Solutions</td><td>7</td></tr>
</tbody>
</table>
</div><p>I hope this article was helpful. Let me know your thoughts in the comment section below.</p>
<p>This article was powered by  <a target="_blank" href="https://rahulahire.thinkific.com/courses/The-Ultimate-DynamoDB-Course">The Ultimate DynamoDB Course</a> - The only course that will effortlessly make you master in using DynamoDB. First 50 people will get 20% off if they use this code <strong>first50</strong>. Make sure to check it out, offer valid for limited period.</p>
]]></content:encoded></item></channel></rss>