<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aravind Venkatesan</title>
    <description>The latest articles on DEV Community by Aravind Venkatesan (@aravindvenkatesan).</description>
    <link>https://dev.to/aravindvenkatesan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F595962%2F69d888dd-a8cf-40b4-a578-ad69c783c1e6.jpg</url>
      <title>DEV Community: Aravind Venkatesan</title>
      <link>https://dev.to/aravindvenkatesan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aravindvenkatesan"/>
    <language>en</language>
    <item>
      <title>7 Mindful Tips For Writing Clean Code</title>
      <dc:creator>Aravind Venkatesan</dc:creator>
      <pubDate>Sun, 17 Mar 2024 02:43:10 +0000</pubDate>
      <link>https://dev.to/aravindvenkatesan/7-mindful-tips-for-writing-clean-code-3gf0</link>
      <guid>https://dev.to/aravindvenkatesan/7-mindful-tips-for-writing-clean-code-3gf0</guid>
      <description>&lt;p&gt;Writing clean and maintainable code is essential for every single developer, whether they're just starting or have many years of experience.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Psstt… It’s hard to train AI bots to do mindful coding but not for humans like you and me !!! 🤖🤖🤖&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Clean code improves readability, scalability, and maintainability, making it easier to work with. In this short article, let’s quickly explore some of the important practical tips to improve the quality of your overall project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tip 1 - Keep it Simple Stupid 😀
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;“Keeping it simple”&lt;/em&gt; is the single motto that every single developer should have in mind when they start to think about something.&lt;/p&gt;

&lt;p&gt;The systems may be complex, frameworks may be gigantic but keeping the code simple at every level, helps the project to scale faster and makes the delivery more efficient.&lt;/p&gt;

&lt;p&gt;Keeping it simple doesn’t mean NO BUGS. People write bugs most of the time, it is just that they are not aware of it.&lt;/p&gt;

&lt;p&gt;Setting simple goals and outcomes for every task in your project and keeping the coding principles/guidelines consistent across the codebase will force the contributors in your team to write the desired code.&lt;/p&gt;

&lt;p&gt;By reducing complexity it makes our life a lot easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tip 2 - Don’t reinvent the wheel 🛞
&lt;/h3&gt;

&lt;p&gt;Most of the developers that I work with always fall into this cycle. They want to build every single system, every minute feature from scratch. It may be good for your learning journey but it is not a really good practice when you want to build a working product. &lt;em&gt;Don’t try to reinvent the wheel.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Example: Let’s say you want to write a program to convert your local time to UTC. It is better to use the available methods in your programming language libraries (frameworks) instead of writing your conversion logic.&lt;/p&gt;

&lt;p&gt;This saves your time + makes your code less error-prone as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tip 3 - Meaningful Variable Names 🎯
&lt;/h3&gt;

&lt;p&gt;Choose variable names that &lt;em&gt;accurately&lt;/em&gt; describe their purpose, avoiding cryptic abbreviations or single-letter names.&lt;/p&gt;

&lt;p&gt;As Robert C. Martin said,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The ratio of time spent reading (code) versus writing is well over 10 to 1."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Tip 4 - Modularization 🗃️
&lt;/h3&gt;

&lt;p&gt;Break down your code into smaller, reusable functions or classes to promote reusability and simplify debugging.&lt;/p&gt;

&lt;p&gt;Always follow the &lt;em&gt;DRY&lt;/em&gt; method. &lt;em&gt;Don’t Repeat Yourself.&lt;/em&gt; Make sure you write the code modular and reuse it when necessary. While performing code reviews try to institute the same habits across your team members.&lt;/p&gt;

&lt;p&gt;This habit is highly effective and the effect will compound as the codebase matures by saving a lot of time and effort spent on the maintenance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tip 5 - Error Handling ❌✅
&lt;/h3&gt;

&lt;p&gt;Implement r*obust error-handling mechanisms* in your code to handle exceptions gracefully and provide meaningful error messages.&lt;/p&gt;

&lt;p&gt;I cannot stress this rule enough.&lt;/p&gt;

&lt;p&gt;We may have urgent deadlines to complete the project. We may be providing support for multiple stakeholders at once within our software org.&lt;/p&gt;

&lt;p&gt;But just step back, pause, and think for a moment.&lt;/p&gt;

&lt;p&gt;Proper error handling will save a lot of time in debugging those weird, unknown issues. This habit will save you from the tiring on-call that lasts for hours with your whole war room squad, and finally to figure out that some config was not turned on!&lt;/p&gt;

&lt;h3&gt;
  
  
  Tip 6 - Mindful Refactoring 🏗️
&lt;/h3&gt;

&lt;p&gt;Regularly refactor your code to eliminate duplication, improve readability, and maintain consistency.&lt;/p&gt;

&lt;p&gt;Try to follow the &lt;em&gt;Boy Scout Rule&lt;/em&gt;, which means, leave the place better than you found it. Instilling this practice across your software team will improve the code quality and less maintenance overhead during tough times.&lt;/p&gt;

&lt;p&gt;Also, be very mindful when performing refactoring because you have no idea what your code is capable of doing when it has an organization-wide usage.&lt;/p&gt;

&lt;p&gt;Remember, &lt;em&gt;"Refactoring always comes with a cost."&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Tip 7 - Observability as a practice 🕵🏼‍♂️
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Observability&lt;/em&gt; in software engineering refers to the ability to understand the internal state of a system by examining its outputs or external behavior. This includes monitoring, logging, and tracing.&lt;/p&gt;

&lt;p&gt;While working on your piece of task you may never think about observability. There is a high chance you may never even implement observability in your project. Please stop developing more features just right now and focus on adopting some basic observability tools available today.&lt;/p&gt;

&lt;p&gt;This habit is also called &lt;em&gt;predictive maintenance&lt;/em&gt; → which simply translates to faster debugging and troubleshooting of your code which resolves a lot of issues before the end user can spot it.&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882"&gt;Clean Code Book - By Robert C. Martin&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.amazon.com/Art-Clean-Code-Practices-Complexity/dp/1718502184"&gt;The Art Of Clean Code Book - By Christian Mayer&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://refactoring.guru/refactoring"&gt;Best Website To Learn About Refactoring&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;This article was originally published &lt;a href="https://aravindvenkatesan.hashnode.dev/7-mindful-tips-for-writing-clean-code"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Follow me &lt;a href="https://aravindvenkatesan.hashnode.dev/"&gt;here&lt;/a&gt; to read and learn new things !!!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>productivity</category>
      <category>cleancode</category>
      <category>learning</category>
    </item>
    <item>
      <title>Importance Of Scalability In Software</title>
      <dc:creator>Aravind Venkatesan</dc:creator>
      <pubDate>Sat, 23 Sep 2023 06:03:31 +0000</pubDate>
      <link>https://dev.to/aravindvenkatesan/importance-of-scalability-in-software-18p2</link>
      <guid>https://dev.to/aravindvenkatesan/importance-of-scalability-in-software-18p2</guid>
      <description>&lt;h3&gt;
  
  
  🕸️Understanding practical use cases
&lt;/h3&gt;

&lt;p&gt;Applications built today are scalable by default. Every developer must understand the importance of scalability in software.&lt;/p&gt;

&lt;p&gt;From a general user perspective, scalability matters more. Just that they don’t know how to define it in technical terms. Usually, you hear them say,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The screen has been showing a loading symbol for a long time!!!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Within a blink of an eye, the wicket was gone and we lost the match. Looks like the match was frozen for a moment and then it was already over…&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I wanted to buy the new phone released in last month's flash sale. But I had to wait a long time only to know that my app had crashed 😂&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the above 3 general user sentiments, as engineers, we were able to observe the level of expectations from the customer. They want your app to be working whenever they open it. Neat and Simple.&lt;/p&gt;

&lt;p&gt;Starting from handling huge user traffic, serving streaming content without interruption, and giving the users a seamless experience to purchase from your app during peak sales periods.&lt;/p&gt;

&lt;p&gt;Everything points to a very important concept called Scalability.&lt;/p&gt;

&lt;p&gt;The number of users is increasing day by day in the online world. We as developers should accept the ground reality and try to design the system in a highly available and scalable manner.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Every single user of your application should have the same experience irrespective of the region (where) or time (when)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  🙋🏽‍♂️ What is Scalability?
&lt;/h3&gt;

&lt;p&gt;Scalability in simple words can be defined as,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A system should be able to handle the increasing amount of workloads → without a decrease in performance or efficiency of the system.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here part one of the definition means, the system that you are building should be able to handle the dynamic workload. The system should not get stuck when the workload increases.&lt;/p&gt;

&lt;p&gt;The second part of the definition specifies about the performance of the system. This means, that when the workload becomes heavy, the system should perform in the same efficient manner similar to the situation when the load was light.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqm65ayjibr1wxg8xzqsi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqm65ayjibr1wxg8xzqsi.jpg" alt="Server Rack - Datacenter"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Software Scalability is needed in most of the applications. Some of the common examples you can see are mentioned below;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Increase in the number of users for your web app (in general terms)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increase in the number of API requests when a flash sale is happening&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increase in the number of financial transactions per second&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increase in the amount of data transferred&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In all the above-mentioned situations, &lt;em&gt;your system should be able to handle the increase in workload without affecting the performance of the system&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯How to achieve Scalability?
&lt;/h3&gt;

&lt;p&gt;Let’s imagine we are building an app that sells Ice Cream. I mean why not?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;An exclusive app to sell just Ice Cream!!!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcvmfy541tmohgnsxpn54.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcvmfy541tmohgnsxpn54.jpg" alt="Icecream Truck - Minion"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s try to understand the requirements first and try to follow the scalable design notion.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Main Consideration:&lt;/strong&gt; Need to ensure that we meet the needs and demands before we build the system.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Scalability in software can be achieved in certain ways. Some of the main items are listed as follows,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🏗️ Distributed Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Logically separate the responsibilities and make the system distributed which can cooperate to perform the duties. Develop separate microservices for &lt;em&gt;user management, order processing, and payment handling&lt;/em&gt;. Each service can scale independently based on demand. By doing this, we can scale the components independently based on our needs.&lt;/p&gt;

&lt;p&gt;Let’s say the number of users signing up is increasing at the moment, we have to scale only the user management service to handle the traffic. If a flash sale is happening the order management system has to be scaled on demand. This dynamic handling of workload is achievable by setting up &lt;em&gt;scaling policies&lt;/em&gt; in your organization.&lt;/p&gt;

&lt;p&gt;Apart from this the distributed architecture also has a lot of advantages such as failure isolation, easier development among huge teams of developers, and so on. Distributing the system into multiple services (microservices) also introduces lots of complexity such as &lt;em&gt;sharding, partitioning, data replication, handling message queues, and failure management&lt;/em&gt; which are the usual pitfalls that software architects have to take into consideration while designing large-scale distributed systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚖️ Load balancing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your system should be able to balance the workload (set of tasks) among the available resources in an efficient manner. &lt;em&gt;Distribute the traffic evenly among the server instances.&lt;/em&gt; Make sure there is no bottleneck in your system.&lt;/p&gt;

&lt;p&gt;Implementing a load balancer that evenly distributes incoming requests to multiple server instances that are handling different microservices in your distributed system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔝🔛 Scaling Methods&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Satisfy user demand at any given point in time. This can be done by vertical or horizontal scaling. &lt;em&gt;Vertical scaling&lt;/em&gt; is growing the size of the server in the system. &lt;em&gt;Horizontal scaling&lt;/em&gt; means adding more servers to the system. There is always a hardware limit on how big the server can grow.&lt;/p&gt;

&lt;p&gt;Based on a case-to-case basis, apps decide on the type of scalable approach to follow. Let’s say in for our ice cream app we have users around the globe (since we don’t want to count the minions 😂), so we go ahead with horizontal scaling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🤖 Autoscaling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Configure auto-scaling for server instances or containers based on CPU and memory usage metrics. Ensure that resources scale up during &lt;em&gt;peak ordering times&lt;/em&gt;. Most of the cloud providers today offer autoscaling services which acts as fully managed service. The configuration options range from system-level metrics such as CPU and memory usage to business metrics such as click rates, time spent on checkout, and so on.&lt;/p&gt;

&lt;p&gt;Scaling your web server instances is one side of the coin. Scaling DB instances is the other. Database scaling can be achieved by creating read replicas and write instances. Indexing the required data and optimizing the db queries also helps in improving the performance of the system on a larger scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🌵 Caching&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Caching&lt;/em&gt; is one of the important parts of the system that can reduce the load on the server for &lt;em&gt;frequently accessed data&lt;/em&gt;. Implement Redis caching for frequently accessed data like user sessions and ice cream menu items.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🏋🏽‍♂️ Load Testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In larger organizations usually, the application is put into load testing. They conduct periodic load testing trial runs by &lt;em&gt;simulating the high traffic&lt;/em&gt; that they expect to receive during peak hours. All the metrics should be captured and monitored properly.&lt;/p&gt;

&lt;p&gt;Based upon these tests, we can identify the bottlenecks in your systems like slow API endpoints, inefficient db queries, cache misses, and so on. This will help us to accommodate for future changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🎰 Continuous Improvement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finally, there should be &lt;em&gt;continuous improvement&lt;/em&gt;. Monitor the app closely with the logging and metrics tools and adjust the requirements based on the need. Regularly review system performance and scalability requirements as and when the user base expands for your application.&lt;/p&gt;

&lt;p&gt;Using these monitoring tools will &lt;em&gt;help you track&lt;/em&gt; server response times, API time taken, server resource consumptions, db performance, and error rates hit in your system. Apart from this keep the technology stack up to date and consider incorporating new practices and effective tools that can improve the scalability of your application.&lt;/p&gt;

&lt;h3&gt;
  
  
  🍦A flow through the ice cream ordering app
&lt;/h3&gt;

&lt;p&gt;Let’s try to keep the design as simple as possible and try to imagine a design flow for the ice cream ordering application.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Identify key components of your App → &lt;em&gt;UI, Backend, DB, Message Queues, External Payment Integrations&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;User Interface: The place where your customers can place orders. It can be a website or mobile app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Backend Server: Handles order processing, user authentication, and communication with the database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Database: Stores user profiles, orders, inventory, and so on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Message Queues: Handles async heavy tasks in both pre and post-ordering processes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;External Payment Gateway: Integrates with 3rd party payment services such as Stripe, PayPal, or some payment gateway.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5h0phzw433dztsmzjroe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5h0phzw433dztsmzjroe.png" alt="Icecream Ordering App - Design Flow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we have a basic understanding of our components in the system. Let’s try to understand the &lt;em&gt;step-by-step flow of this app&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The Ice Cream Ordering Client Application is at the top. This is the UI part which is available to the customer where they can place their orders.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Content Delivery Network (CDN) serves static assets like images of the ice cream available on our menu.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The next part is the Load Balancer. It distributes incoming traffic among the multiple available application servers. It also helps us to route the traffic and direct the requests to the respective service in your system.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Let’s say if the request comes in to create a new order, it is directed to the order processing microservice.&lt;/li&gt;
&lt;li&gt;If another request comes in for payment, it is handed over to the payment service.&lt;/li&gt;
&lt;li&gt;The most important thing to understand at this time is scaling. Here each service can be independently scaled depending on the load at the current moment.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;The application servers interact with a distributed database cluster which includes a distributed database like Cassandra for storing the order data and a simple relational database with read replicas for storing and retrieving the user profiles.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;The message queues available in the system are kept for handling the asynchronous tasks both pre and post-ordering time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;These are designed to handle all the asynchronous tasks in your system such as updating inventory, initiating the delivery process, sending notification emails, and so on.&lt;/li&gt;
&lt;li&gt;Apart from this if there are any heavy time-consuming tasks to be performed in your system, the event-based message queues are the best way to handle these scenarios.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;There are also cache servers built into the system to help reduce the load on the application servers. Frequently accessed data are returned directly from the cache servers.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Please note that this is a &lt;em&gt;high-level representation&lt;/em&gt;, and in a real-world scenario, there may be additional components, security systems, logging and monitoring tools, and more detailed interactions among different components of your system.&lt;/p&gt;

&lt;h3&gt;
  
  
  🤔What happens if there is no scalability?
&lt;/h3&gt;

&lt;p&gt;If a system lacks scalability, it can lead to several significant issues and limitations, including:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Performance Degradation:&lt;/strong&gt; Without scalability, as the user load or data volume increases, the system's performance may degrade significantly. Users may experience slow response times, timeouts, and a poor overall user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Limited Growth Potential:&lt;/strong&gt; Without scalability, the system's capacity is limited by its initial design and infrastructure. It becomes challenging to accommodate a growing user base, add new features, or adapt to changing business needs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Resource Constraints:&lt;/strong&gt; A non-scalable system may struggle to handle spikes in traffic or increased demand. This can lead to resource constraints, such as overutilized CPU and memory, causing system crashes or downtime.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Competitiveness:&lt;/strong&gt; In a competitive environment, businesses that cannot scale their systems may struggle to meet customer expectations, innovate quickly, or expand their market share, ultimately putting them at a disadvantage.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In summary, a lack of scalability can lead to poor performance, resource limitations, affecting business growth, increased operating costs, and eventually running out of business.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔗References Used
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Scalability" rel="noopener noreferrer"&gt;What is Scalability?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.geeksforgeeks.org/what-is-scalability-and-how-to-achieve-it-learn-system-design/" rel="noopener noreferrer"&gt;How to achieve scalability&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.freecodecamp.org/news/how-to-scale-a-distributed-system/" rel="noopener noreferrer"&gt;Scaling a distributed system&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://thenewstack.io/microservices/microservices-101/" rel="noopener noreferrer"&gt;Learn about microservices&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aws.amazon.com/elasticloadbalancing/" rel="noopener noreferrer"&gt;Load Balancing&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aws.amazon.com/autoscaling/" rel="noopener noreferrer"&gt;Autoscale your applications&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Originally this article was published &lt;a href="https://aravindvenkatesan.hashnode.dev/importance-of-scalability-in-software" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kindly support and subscribe to my newsletter and follow me here for future articles :)&lt;/p&gt;

</description>
      <category>distributedsystems</category>
      <category>systemdesign</category>
      <category>aws</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Diving into AWS - Understanding IAM</title>
      <dc:creator>Aravind Venkatesan</dc:creator>
      <pubDate>Sun, 03 Sep 2023 06:21:11 +0000</pubDate>
      <link>https://dev.to/aravindvenkatesan/diving-into-aws-understanding-iam-1afb</link>
      <guid>https://dev.to/aravindvenkatesan/diving-into-aws-understanding-iam-1afb</guid>
      <description>&lt;p&gt;AWS has a plethora of services under its hood. Among them, one of the critical services that every developer should be familiar with is &lt;em&gt;AWS IAM - Identity and Access Management&lt;/em&gt;. This service was initially launched in May 2011 and features were built incrementally to make it the primary identity system to use the AWS cloud platform and its services.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Yes, IAM is one of the crucial components of AWS.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Learning and understanding about IAM helps us to have a better understanding of how AWS handles its resources in an effective, safe, and secure manner.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔐Authentication and Authorization
&lt;/h3&gt;

&lt;p&gt;Before learning about IAM and its features, let's have a solid understanding of Authentication and Authorization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oiPaL89d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbpg3pigh3otbfvqpitm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oiPaL89d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbpg3pigh3otbfvqpitm.png" alt="Understanding Authentication and Authorization" width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In software applications, maintaining the security of the system is highly important. Both Authentication and Authorization are fundamental aspects of security for the software system that we want to build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Authentication&lt;/em&gt;&lt;/strong&gt; is the process of determining the identity of the user &lt;em&gt;who&lt;/em&gt; is currently accessing the software system. &lt;strong&gt;&lt;em&gt;Authorization&lt;/em&gt;&lt;/strong&gt; on the other hand is the process of checking the &lt;em&gt;permissions/rights&lt;/em&gt; of the user who is accessing the resources of the software system.&lt;/p&gt;

&lt;p&gt;Authentication can be performed in multiple ways. One standard way of doing this is a username and password combination which we all use day-to-day. Authorization on the other hand also happens daily like a user is allowed to access a certain webpage or not.&lt;/p&gt;

&lt;p&gt;Do note that authentication &lt;em&gt;always happens before&lt;/em&gt; the authorization. The user’s privileges, permissions, or access rights cannot be determined before the user has logged in to the system.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Examples of Authentication&lt;/em&gt; are Username and password Auth, Passwordless Auth, 2FA or MFA (Multi-Factor Authentication), SSO (Single Sign-On), and so on.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Examples of Authorization&lt;/em&gt; are JWT (JSON Web Token Authorization), RBAC (Role Based Access), OpenID, OAuth, and so on.&lt;/p&gt;

&lt;h3&gt;
  
  
  🕸️Let’s learn about &lt;strong&gt;IAM&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;IAM stands for &lt;strong&gt;&lt;em&gt;Identity and Access Management&lt;/em&gt;&lt;/strong&gt; in AWS. It is one of the primary web services in AWS which helps to securely access and control the AWS resources.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I7TuOcAi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n2qtyz57dj6z1ycgbxua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I7TuOcAi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n2qtyz57dj6z1ycgbxua.png" alt="AWS — IAM" width="800" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When a person signs up for an AWS account for the first time, the created account is called the &lt;em&gt;Root Account&lt;/em&gt;. This is the primary account of the user where they can manage all the secure controls and overall cloud platform management. It is a best practice not to use this root account to perform non-important activities.&lt;/p&gt;

&lt;p&gt;From this root account, we can create multiple user accounts (via the IAM service) to perform the desired actions on the cloud platform and its services. Usually in big enterprises, IAM accounts will be managed by a team of administrators who provide access to the users only on a required or need-to-know basis.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A person should know only things that they should know!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;IAM is also a &lt;em&gt;global service&lt;/em&gt; in AWS which means that it is common across all regions in AWS. Yes, AWS has multiple regions 😃 (which we shall explore and learn about in future articles)&lt;/p&gt;

&lt;p&gt;Here is the official documentation link to learn more about &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html"&gt;AWS IAM&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🤔Why IAM?
&lt;/h3&gt;

&lt;p&gt;Let’s take a step back again to understand the importance of IAM. It is a crucial component of AWS's security infrastructure, and there are &lt;em&gt;several compelling reasons why you would want to use AWS IAM&lt;/em&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Granular Access Control of your AWS environment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Security for all environments, applications, and the data itself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Compliance out of the box to abide by the standards and regulations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Identity Federation features can help to integrate with any system to perform user management or act as an identity provider for your software system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;IAM provides out-of-the-box monitoring and auditing for all the activities performed on the platform by every user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When your organization grows in size, the infrastructure also has to grow. Managing users at scale is one of the prime features provided by IAM.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/SXSqhTn2DuE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  🎬IAM in action
&lt;/h3&gt;

&lt;p&gt;IAM is used behind the scenes when you want to access the AWS platform or any AWS service. There are 3 different ways by which we can access the platform. In all these ways we have to authenticate and authorize with IAM service which acts as the entry point or guardrail for the system.&lt;/p&gt;

&lt;h4&gt;
  
  
  AWS Management Console
&lt;/h4&gt;

&lt;p&gt;AWS Management Console is the web-based interface where the users can access cloud resources. Usually, this will be IAM user login and password-based.&lt;/p&gt;

&lt;p&gt;NOTE: AWS also supports MFA which means Multi-factor Authentication via different authentication mechanisms. It can be either a digital token generator app or a physical identity token generator.&lt;/p&gt;

&lt;h4&gt;
  
  
  AWS CLI
&lt;/h4&gt;

&lt;p&gt;The next way is AWS CLI where the IAM users can access the resources. Since this is CLI-based it will be used by the pro users who know to work with the CLI.&lt;/p&gt;

&lt;p&gt;To work with AWS CLI, we will need the access key and secret for that particular IAM user. So when we want to set up the console, &lt;code&gt;aws configure&lt;/code&gt; command follows standard step-by-step instructions which help us to generate these credentials so that we don’t have to type the username and password every time. It can also be directly generated from the IAM page in the Management Console.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Access Key is similar to the username and the Secret access key is similar to the password.&lt;/em&gt; We should always safeguard this information and provide high importance as we do for our general login credentials.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;NOTE:&lt;/em&gt; If any of the unknown person has access to these keys, then they might use these to access your cloud platform and finally you might end up with a huge bill from AWS. It is the user’s responsibility to safeguard these keys.&lt;/p&gt;

&lt;h4&gt;
  
  
  AWS SDK
&lt;/h4&gt;

&lt;p&gt;AWS SDK is another way of accessing cloud resources. These are built and provided by AWS and it supports different languages and platforms. These SDKs will be used by those developers to write software and perform certain actions in the platform via code. SDKs are used at the application level and hence authentication and authorization are a must at this level too. It can be done using the same access key and secret generated for the IAM user.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔑Keywords In IAM
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XE8ZyEkf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rbkqby6op1d1l95jsbyr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XE8ZyEkf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rbkqby6op1d1l95jsbyr.png" alt="IAM — Overview" width="800" height="709"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are a few keywords that we have to understand to get a better understanding of how IAM works in general.&lt;/p&gt;

&lt;h4&gt;
  
  
  Users
&lt;/h4&gt;

&lt;p&gt;Users. Yes, users are &lt;em&gt;people like us&lt;/em&gt; who work in a project or company. Users are those people who belong to your organization. Users are the first class citizens in IAM and are considered to be the primary entity.&lt;/p&gt;

&lt;h4&gt;
  
  
  Groups
&lt;/h4&gt;

&lt;p&gt;A group is nothing but a &lt;em&gt;collection of users&lt;/em&gt;. They can be developers, testers, finance personnel, admin, etc. Multiple users come together to form a group. Users can belong to a single group or multiple groups. Yes, I am talking about that one critical resource in your team who is the developer, tester, and admin. LOL 😂&lt;/p&gt;

&lt;h4&gt;
  
  
  Roles
&lt;/h4&gt;

&lt;p&gt;Roles can be defined as the &lt;em&gt;standard assigned definition&lt;/em&gt; for a user or an AWS service to &lt;em&gt;perform allowed actions&lt;/em&gt; on the AWS platform. Mostly it will be those automated cases where one of the AWS services assumes a standard role to perform some actions on another AWS service.&lt;/p&gt;

&lt;p&gt;A few of the examples related to AWS roles are mentioned below,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A lambda function with a designated role to read objects present in a specific S3 bucket&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An EC2 instance with a standard role to access another EC2 instance present in a different AWS region&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📝Learn to write IAM Policies
&lt;/h3&gt;

&lt;p&gt;Policy is a very simple concept to understand yet it can be complicated to write. These are JSON documents that contain all the permissions and rules. These policies can be assigned to a single user, a group of users, or even for an IAM role that is assigned to a user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Policies&lt;/em&gt;&lt;/strong&gt; are the standard set of instructions that are written in the form of JSON for AWS to understand who can access what in a standard way.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"policy-0001-030923"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s3-allow-all-statement"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Principal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bruce-wayne"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s3:*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s break down the syntax step by step,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Version&lt;/em&gt; - This is the version of the policy document that AWS maintains and understands. Let’s not touch this. This is a required property.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Id&lt;/em&gt; - An identifier for the policy that we are crafting. This is an optional field.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Statement&lt;/em&gt; - This is a required field. There can be one or more statements in a single policy. In the above example, there is only one statement called &lt;code&gt;s3-allow-all-statement&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;Sid&lt;/em&gt; - This is the user-defined identifier for the policy statement. It can be anything as long as it makes sense and is understandable by your team members. Note this is an optional field.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Effect&lt;/em&gt; - It can either Allow or Deny.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Principal&lt;/em&gt; - Account or the User for this policy applies to. In the above example, it applies to &lt;code&gt;batman&lt;/code&gt; 😰 I mean &lt;code&gt;bruce-wayne&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Action&lt;/em&gt; - This field describes the actions which can be performed. It can be a list of actions or a single action. This should follow the standard syntax statements as defined by AWS. In the above example, it says &lt;code&gt;s3:*&lt;/code&gt; which means all actions are allowed on the S3 service.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Resource&lt;/em&gt; - This field refers to the list of resources this policy statement is applicable. Again this can specified to a granular level if needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So overall to explain the policy in a single sentence,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;bruce-wayne is allowed to perform any action on the S3 service on all resources&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Policy documents can be as complex as we want them. It can be nested with multiple statements to have &lt;em&gt;fine-grained control of our resources in AWS&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;NOTE: There are several AWS-defined policy documents already available which is more than what we need. Usually, these fine-grained policies will be crafted based on the user’s needs but for learning purposes, you can always use the pre-defined policy documents.&lt;/p&gt;

&lt;p&gt;AWS also provides a &lt;em&gt;live policy editor&lt;/em&gt; which can be done easily from UI that shows which permission the user has or not. In this editor, the JSON document can edited live both in raw JSON format or visual format with a long list of checkboxes.&lt;/p&gt;

&lt;h3&gt;
  
  
  📔End note
&lt;/h3&gt;

&lt;p&gt;Ultimately what matters is,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The users should have permission to do only what they need rather than everything - &lt;strong&gt;&lt;em&gt;The principle of least privilege&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not provide access to anything and everything.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Monitor the usage pattern of the users in your organization or project to understand the necessary permission for the users and fine-tune the parameters in the IAM service.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AWS always stresses the &lt;strong&gt;&lt;em&gt;shared responsibility model&lt;/em&gt;&lt;/strong&gt; which means both AWS and users have responsibility in maintaining the security of the cloud platform.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I1phF1Cf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lagdsa93lg77clkco2yr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I1phF1Cf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lagdsa93lg77clkco2yr.png" alt="AWS — Shared Responsibility Model" width="224" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS is responsible for maintaining the infrastructure, and configurations and handling compliance based on the regulatory bodies and frameworks.&lt;/p&gt;

&lt;p&gt;As a user, we are responsible for maintaining all the IAM resources, enabling security, enforcing password policies, making MFA mandatory, password rotation on a timely basis, auditing credential reports from time to time, analyzing the access pattern of your users, and so on.&lt;/p&gt;

&lt;p&gt;For the readers who are preparing for AWS certifications, this article may serve as a starting point to learn about IAM. For a detailed guide try to follow some standard tutorials available on the internet. It can be from AWS itself or some other resources. For my exam prep, I read through the &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html"&gt;AWS documentation site&lt;/a&gt; and the &lt;a href="https://tutorialsdojo.com/aws-identity-and-access-management-iam/"&gt;TutsDojo&lt;/a&gt; blogs for my exam prep. Attended several mock exams from the website as well which helped me a lot to get AWS certified efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔗References Used
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.geeksforgeeks.org/difference-between-authentication-and-authorization/"&gt;Difference Between Authentication And Authorization&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html"&gt;AWS Official IAM Docs&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/intro-structure.html"&gt;IAM Basics Explained&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html"&gt;IAM Security Best Practices&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://tutorialsdojo.com/aws-identity-and-access-management-iam/"&gt;Tutorials Dojo - Learning Guide&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>cloud</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Understanding Git and GitHub</title>
      <dc:creator>Aravind Venkatesan</dc:creator>
      <pubDate>Sun, 20 Aug 2023 13:16:29 +0000</pubDate>
      <link>https://dev.to/aravindvenkatesan/understanding-git-and-github-15n</link>
      <guid>https://dev.to/aravindvenkatesan/understanding-git-and-github-15n</guid>
      <description>&lt;p&gt;Version control is a term widely used in software engineering. In the software field, it is defined as the way of keeping track of changes and managing those changes in terms of computer programs, files, software, etc.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡In simple words, it is a system to keep track of changes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🕸️Introduction
&lt;/h2&gt;

&lt;p&gt;Git is one of the version control systems. It is a free and open-source distributed version control system. It was developed by Linus Torvalds (the same legend who is behind the creation of Linux).&lt;/p&gt;

&lt;p&gt;Git is designed to handle small-scale to large-scale projects with greater efficiency and speed. GitHub on the other hand is a cloud platform that uses Git for version control which is currently owned by Microsoft.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TpqsN7_8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58i9d3k2fe59d7yy3yv0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TpqsN7_8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58i9d3k2fe59d7yy3yv0.jpg" alt="Octocat" width="800" height="523"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🎖GitHub = Git + Additional Features such as bug tracking, task management, wikis, automation workflows, etc.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One of the first Git terminologies which we have to understand is Repositories.&lt;/p&gt;

&lt;p&gt;_Repository _- The place where the data is stored and managed. Think of it like an imaginary huge box where all of the files/folders can be stored and managed.&lt;/p&gt;

&lt;h2&gt;
  
  
  👩🏽‍💻👨🏽‍💻So why is Git a distributed system?
&lt;/h2&gt;

&lt;p&gt;Software is NOT built by a single person. It is a collaborative effort. Be it open source, service software, or some cool awesome software products which you are developing in your free time. Git is the main enabler in building software from scratch in a collaborative environment. It is a distributed system that holds the code repositories where multiple people can jump in to develop software by holding the entire copy of the source code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Yc11MQAC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v7t3vqi8zsllcgdk0664.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yc11MQAC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v7t3vqi8zsllcgdk0664.png" alt="Distributed Version Control System - GIT" width="478" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I found this interesting image on the internet &lt;a href="https://stackoverflow.com/questions/7212740/why-git-is-called-a-distributed-source-control-system"&gt;(credits to the creator)&lt;/a&gt; which explains the reason simply.&lt;/p&gt;

&lt;p&gt;Git is designed in such a way that every user who uses it has complete control over the repository.&lt;/p&gt;

&lt;p&gt;As mentioned previously, Git is the technology and GitHub is a cloud platform offering a managed version control system. Some other famous alternative platforms include GitLab, Atlassian’s Bitbucket, AWS CodeCommit, etc which are used among the community.&lt;/p&gt;

&lt;h2&gt;
  
  
  💻Installing Git
&lt;/h2&gt;

&lt;p&gt;Git can be directly installed from this website. (&lt;a href="https://git-scm.com/"&gt;https://git-scm.com/&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NKvk3yj---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1fr9skmmrp1v3ujalhz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NKvk3yj---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1fr9skmmrp1v3ujalhz3.png" alt="GIT Website" width="800" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Windows users can download the installer shown on the landing page and follow the on-screen instructions to install the software.&lt;/p&gt;

&lt;p&gt;Mac users can use homebrew to install git or follow the instructions on this page for the preferred method of installation (&lt;a href="https://git-scm.com/download/mac"&gt;https://git-scm.com/download/mac&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯Let's Learn Some Git Commands
&lt;/h2&gt;

&lt;p&gt;Learning different git commands can be intimidating but at the same time, it is a required skill set for most of the developers. These are some of the important and heavily used git commands by the developers in their day-to-day workflow.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🗒 This can also be considered as a cheat sheet for interview prep or just for reference in future&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Prerequisites: Remember to download and install git in your system before executing these commands.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🗒️Git Commands - Section 1
&lt;/h3&gt;

&lt;p&gt;This is an introductory section that explains very basic Git commands and steps to get started.&lt;/p&gt;

&lt;p&gt;To display the version of the git installed on your system,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git --version

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To display the help menu for the git,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git --help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To list out the configurations of git installed on your system in a list format,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can set up the user name and email for our git repository. This can be configured for the repository level or global level. The below command sets the username and email in the global scope. (Remember to change your respective user name and email in the config command below)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.name "Bruce Wayne"
git config --global user.email "brucewayne@gotham.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check whether the configs are set properly as in the previous step we can use the below commands to display the respective key-value pairs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config user.email
git config user.name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To list all the commands available in git. Do check the output of this command and you will be surprised by the results.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git help -a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The commands in git are divided into 5 main categories such as,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Main Porcelain commands&lt;/li&gt;
&lt;li&gt;Ancillary Commands - Manipulators and Interrogators&lt;/li&gt;
&lt;li&gt;Interacting with others&lt;/li&gt;
&lt;li&gt;Low-level commands - Manipulators, Interrogators, sync repos, and internal helpers&lt;/li&gt;
&lt;li&gt;External Commands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Probably most of us would not have dug deep into Git commands before. This may be a starting point for us to explore a bit more.&lt;/p&gt;

&lt;p&gt;To get help or read a manual about a command which interests you the most, then type out the following command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git help &amp;lt;command&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git help init // to get help about the init command
git help help // to get help about the help command
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s say you plan to work on a project and you have decided to use a version control system to keep track of the changes in your project files - Git is the place where you should start first.&lt;/p&gt;

&lt;p&gt;Let’s create a new folder for the project called as &lt;code&gt;my-awesome-project&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now navigate into the project folder and open git-bash or any terminal of your choice in the project folder.&lt;/p&gt;

&lt;p&gt;To initialize a git repository,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check the status of the git repository or shows the files which have to be committed,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's assume you are creating some files inside the &lt;code&gt;my-awesome-project&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;In Git, there are 3 main stages that a developer should be aware of.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Local - refers to the local repository location (i.e.) your personal computer folder where you are currently working with your files.&lt;/li&gt;
&lt;li&gt;Staging - An intermediate area where you have added files that you want to commit.&lt;/li&gt;
&lt;li&gt;Remote - Refers to the remote repository location which is the distributed version of your repository. (i.e.) GitHub or any other cloud service which stores the files and folders which the team of developers will work on.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To add a file to the repository you need to use the below command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add &amp;lt;FILE_NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To show the difference in the files between the current state and v/s previous (committed) state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To show the difference between the files that are committed and v/s files that are staged (in the staging area),&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git diff —staged
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To stage all files in a single cmd,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you change the staged file now at this stage → You will have 3 copies of the file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One in local which has the latest changes - this is not committed yet&lt;/li&gt;
&lt;li&gt;One in the staging area - this is git added but not committed yet&lt;/li&gt;
&lt;li&gt;The final one is the committed file itself&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To understand how the add command works we can simulate its behaviour. This is a simple simulation command which shows what happens when git add . is performed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add —dry-run .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To perform a commit of the added files to the repository,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "MSG"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The -m flag denotes the message for your commit. There are more flags that we can attach with commit commands.&lt;/p&gt;

&lt;p&gt;Perform git add and git commit in a single command can be done as shown below,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -am “MSG”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🗒️Git Commands - Section 2
&lt;/h3&gt;

&lt;p&gt;In this section, we should commit ourselves to learning important commands in Git.&lt;/p&gt;

&lt;p&gt;To display the logs (the distributed activity log for the repository),&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To show the log with files changed,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log -- stat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To display logs in a single line,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log --oneline
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To show git history per commit in a single line for each commit,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log --shortstat --oneline
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To list files in the git repository,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git ls-files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some of the git gui commands (which you may never use) are listed here as well for reference. The reason why we are not seeing common usage of these commands is mainly because of the powerful GUI clients and IDE integrations which are present today. Most of the developers, don’t even need these GUI clients/IDE integrations 😉&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git gui // to start the GUI for git
gitk // start the log viewer for the git repo
git citool // start git gui to commit files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have added a file to the stage area and need to remove it, then use the following command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git restore --staged FILE_NAME
(or)
git reset FILE_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To remove the file from git indexing (after adding it to the staging area),&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rm -f FILE_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To remove the file which is already committed (including removal of git indexing),&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rm FILE_NAME
// deleted: index.css - git will track this file as deleted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we want to rename the file and git to track those changes then do the following,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git mv main.css index.css // rename arg1 to arg2 
// renamed: main.css -&amp;gt; index.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Translate the branch or tag into its SHA ID,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git revparse &amp;lt;BRANCH_NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope by this time you are very tired of typing commands. Don't give up. Take a small break 🍵&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡Let's learn a small trick that can save us from typing longer commands.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;git config can help us set store some useful aliases. This will help us replace very long commands such as below,&lt;/p&gt;

&lt;p&gt;To print the logs in a beautiful format 💅🏽 we will use this long command !!!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log --graph --decorate --pretty=oneline --all --abbrev-commit

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now set the key as lol for the log command specified above,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global alias.lol='log --graph --decorate --pretty=oneline --all --abbrev-commit'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the alias should be configured successfully. From now on we can just type,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git lol
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are so lazy or tired to even type checkout then use shorter commands like this,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global alias.co 'checkout'
git co &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The below snippet shows the summary of Setting Command Aliases 📸&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ORIGINAL_COMMAND:
git log --graph --decorate --pretty=oneline --all --abbrev-commit

CONFIGURING_ALIAS_COMMAND: (Here the configured alias is lol)
git config --global alias.lol "log --graph --decorate --pretty=oneline --a
ll --abbrev-commit"

EXECUTING_ALIAS_COMMAND:
git lol

REMOVING_ALIAS_COMMAND:
git config --global --unset alias.lol
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🗒️Git Commands - Section 3
&lt;/h3&gt;

&lt;p&gt;Let's diverge a bit here 😂 to learn about branches and tags !!!&lt;/p&gt;

&lt;p&gt;Branching means you diverge from the mainline of development and continue to do work without messing with that mainline. Tags on the other hand are simple pointers that represent the significant point in the project development timeline.&lt;/p&gt;

&lt;p&gt;To list all the branches in Git,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To create a new branch in Git,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch BRANCH_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To checkout to the branch,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout BRANCH_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To delete the created branch,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -d BRANCH_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NOTE: The user cannot delete the branch in which the user is currently checked out. So need to first checkout to another branch and then perform the deletion.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git tag TAG_NAME -m TAG_MESSAGE SHAID
git tag V1.0 -m "This is the release 1.0 version" 5083a560
git show V1.0 // display the tag details
git tag // lists all the tags
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Checkout using SHAID&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout SHAID -&amp;gt; We can checkout to any SHAID
this will create a detached HEAD state 
(because the current HEAD is changed on pointed to the newly checked out SHAID)
better to create new branches and perform the changes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create and checkout a branch in a single command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b BRANCH_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a sub-branch from the parent branch,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b sub_branch master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here the parent branch is the master or main. Usually, the parent can be anything and not necessarily be the master branch. The sub_branch is the subordinate branch created from the parent branch.&lt;/p&gt;

&lt;p&gt;To track the steps we have taken in our local git bash terminal we can use the reflog command. It helps us to show the number of times we have switched between different branches and track our activities in the git repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reflog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To stash out all of the work done in the local branch we can use the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NOTE: After stashing we can still retrieve the stashed code and no need to worry. The changes are not removed permanently but instead stashed in the holding area of Git.&lt;/p&gt;

&lt;p&gt;To display the list of stashed changes in our system,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To stash the most recent version back to life use the below command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash pop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To display the difference between the two branches,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git diff BRANCH1 BRANCH2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NOTE: This command displays the detailed changes along with the chunk.&lt;/p&gt;

&lt;p&gt;To view limited changes or differences between 2 branches, we can use a flag called —name-status. Let's take a look at an example to understand the concept a bit more,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git diff --name-status master sub_branch

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here were are adding the —name-status flag for the git diff command. Now the terminal shows only the difference in files instead of detailed changes or chunks between the 2 branches which are specified.&lt;/p&gt;

&lt;p&gt;This command helps to merge the changes between the branches.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git merge BRANCH2

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As per this example the changes from BRANCH2 are merged into the current branch.&lt;/p&gt;

&lt;h3&gt;
  
  
  🗒️Git Commands - Section 4
&lt;/h3&gt;

&lt;p&gt;So far, as you have observed we have never pushed or pulled code from the internet i.e.) remote repository. We have been locally working on our copy of the repository.&lt;/p&gt;

&lt;p&gt;Software development is a collaborative process and to make it happen we have famous platforms such as GitHub. So to understand this in detail let’s take an example of how to push the code we created in our local repository and push it to the remote (GitHub).&lt;/p&gt;

&lt;p&gt;In GitHub UI, let’s create a new repository and name it the same as our project folder my-awesome-project. Mark the repository as public and click on Create a new repository button. Leave other options as default.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ifznWmGc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ou090tepjtxdx25nhmx6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ifznWmGc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ou090tepjtxdx25nhmx6.png" alt="GitHub - Create a repository" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you have created the big empty box (distributed repo) on the cloud which you can later on share with your teammates for collaboration. But first, you need to link your local with the remote.&lt;/p&gt;

&lt;p&gt;To do that first, you must run the following command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin &amp;lt;https://github.com/OWNER/REPOSITORY.git&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will add a new upstream origin point for your repository pointing to the URL.&lt;/p&gt;

&lt;p&gt;Now we can publish or push the code to the GitHub repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push -u origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here the -u shorthand flag represents upstream. By adding this we tell our local git to always push my upstream code to the configured GitHub origin URL. Do note we are allowed to add multiple remotes and set different upstream based on our project complexity. But from a beginner learning perspective let’s stick to a single upstream source.&lt;/p&gt;

&lt;p&gt;One of your friends now wants to work on your project as well. You pass the GitHub URL and ask to clone the repository. This can be done by the following command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone &amp;lt;https://github.com/OWNER/REPOSITORY.git&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the repository is cloned they can make their changes to the files in the repository and push those changes to the GitHub. Later on, if you want their changes also to be in your system, Yes you have guessed it right. You need to pull those changes from the remote to your local.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git pull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Woah!!! 🤸🏻‍♂️ Such an exhaustive list of git commands we have learned so far.&lt;/p&gt;

&lt;p&gt;These are some of the important commands which a developer should know and be familiar with. But the list does NOT end here. There is always room for improvement and we can extend the learning to more complex commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀Next Steps
&lt;/h2&gt;

&lt;p&gt;Up until now, we have learned a few important git commands, their usages, and practical use cases. For the next steps, I shall link a few resources which I have used for my preparation to learn about Git and GitHub.&lt;/p&gt;

&lt;p&gt;In the list of resources, one of the very useful books I read was the book written by Rick Umali. It helped me to understand Git from a totally different perspective which inspired me in writing this article. For software developers like us reading books may not be the quickest form of knowledge gain compared to other resources, but it helps us to sit down, relax and inspire us about what and why we want to learn.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔗Resources Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.goodreads.com/en/book/show/26778698-learn-git-in-a-month-of-lunches"&gt;Learn Git in a Month of Lunches - Book by Rick Umali&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/"&gt;GIT-SCM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/git/"&gt;W3Schools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cs.fyi/guide/git-cheatsheet"&gt;Git Cheatsheet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=SWYqp7iY_Tc"&gt;Traversy Media Tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://about.gitlab.com/"&gt;Gitlab&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bitbucket.org/product"&gt;BitBucket&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>cheatsheet</category>
      <category>distributedsystems</category>
    </item>
    <item>
      <title>Database Consistency Matters !!!</title>
      <dc:creator>Aravind Venkatesan</dc:creator>
      <pubDate>Fri, 09 Apr 2021 10:20:16 +0000</pubDate>
      <link>https://dev.to/aravindvenkatesan/database-consistency-matters-2a4c</link>
      <guid>https://dev.to/aravindvenkatesan/database-consistency-matters-2a4c</guid>
      <description>&lt;h2&gt;
  
  
  The Need For Understanding 😀
&lt;/h2&gt;

&lt;p&gt;The distributed databases in general are reliant on the major tuning parameters. &lt;/p&gt;

&lt;p&gt;Consistency is one of the key parameters used to build distributed databases.&lt;/p&gt;

&lt;p&gt;The range of consistency tuning indicates the values to be returned from the nodes connected in the distributed cluster. &lt;/p&gt;

&lt;p&gt;Simply put the consistency of the database lies in the spectrum from &lt;strong&gt;Strong Consistency to Eventual Consistency&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Strong Consistency &amp;lt;-------------------&amp;gt; Eventual Consistency&lt;/p&gt;

&lt;p&gt;The consistency level of the database defines the rules for the nodes to return a set of values that are visible to the client. This differs based on the case-to-case basis and also reliant on the application requirement.&lt;/p&gt;

&lt;p&gt;Let me demonstrate this concept with a simple example to explain the difference between strong and eventual consistency and how to choose one over the other when you are choosing a database or even trying to build one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example ⚽
&lt;/h2&gt;

&lt;p&gt;Let's consider a foosball game between 2 teams Team A and Team B. It is the annual game party at your company and you are planning to develop an app to display the scoreboard.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Team A / Team B : 0 / 0&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1xttr2kjmaeftrwyfyd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1xttr2kjmaeftrwyfyd.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let us assume there is a concept of scorecard status at different time intervals.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initial Time (Game Started)&lt;/li&gt;
&lt;li&gt;Progression Time (Game In Progress)&lt;/li&gt;
&lt;li&gt;Final Time (Game Completed)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The scoreboard data is entered by you at different time intervals as the game progresses and you are required to display the scoreboard as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Strong Consistency 💪
&lt;/h3&gt;

&lt;p&gt;When you opt for the &lt;strong&gt;Strong Consistency&lt;/strong&gt; things you need to take care of,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;At any point in time, you need to display the last written value.&lt;/li&gt;
&lt;li&gt;Follow Rule No.1 STRONGLY.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The example below shows the series of writes done by you on the scorecard.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Write("TeamA", 1);&lt;br&gt;
Write("TeamB", 1);&lt;br&gt;
Write("TeamB", 2);&lt;br&gt;
Write("TeamA", 2);&lt;br&gt;
Write("TeamA", 3);&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;So when the read operation is carried out at the time intervals in the cluster, the latest written value is returned. This is because we have opted for a stronger consistency.&lt;/p&gt;

&lt;p&gt;Simply put, whenever the read operation for the scorecard is issued to your app, you need to observe the changes in all the previous or past writes in order to return the best possible output.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;InitialTime: Team A / Team B : 0 / 0&lt;br&gt;
ProgressionTime1: TeamA / Team B : 1 / 0&lt;br&gt;
ProgressionTime2: TeamA / Team B : 1 / 1&lt;br&gt;
ProgressionTime3: TeamA / Team B : 1 / 2&lt;br&gt;
ProgressionTime4: TeamA / Team B : 2 / 2&lt;br&gt;
ProgressionTime5: TeamA / Team B : 3 / 2&lt;br&gt;
FinalTime: TeamA / TeamB : 3 / 2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;So the best possible output for the &lt;strong&gt;Strong Consistency&lt;/strong&gt; when the game is &lt;code&gt;In Progress&lt;/code&gt; will be, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Team A / Team B : 3 / 2&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Eventual Consistency 🙏
&lt;/h3&gt;

&lt;p&gt;Now let's consider the &lt;strong&gt;Eventual Consistency&lt;/strong&gt; scenario,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;At any point in time, you are allowed to display any value written in the past.&lt;/li&gt;
&lt;li&gt;You are also allowed to return the initial state as well.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now the same write operation mentioned above takes place. The read operations with Eventual Consistency provides the below possible output,&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;InitialTime: Team A / Team B : 0 / 0&lt;br&gt;
ProgressionTime1: TeamA / Team B : {0,1,2,3} / {0,1,2}&lt;br&gt;
ProgressionTime2: TeamA / Team B : {0,1,2,3} / {0,1,2}&lt;br&gt;
ProgressionTime3: TeamA / Team B : {0,1,2,3} / {0,1,2}&lt;br&gt;
ProgressionTime4: TeamA / Team B : {0,1,2,3} / {0,1,2}&lt;br&gt;
ProgressionTime5: TeamA / Team B : {0,1,2,3} / {0,1,2}&lt;br&gt;
FinalTime: TeamA / TeamB : 3 / 2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This example systematically explains the behavior of eventual consistency although the final state and the initial state of the game don't modify. &lt;/p&gt;

&lt;p&gt;So the best possible output for the &lt;strong&gt;Eventual Consistency&lt;/strong&gt; when the game is &lt;code&gt;In Progress&lt;/code&gt; will be the range of values,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Team A / Team B : {0,1,2,3} / {0,1,2}&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Explore Further 🔭
&lt;/h2&gt;

&lt;p&gt;If you want to know the type of consistency level opted for the different types of databases here I have linked a &lt;a href="https://db-engines.com/en/ranking" rel="noopener noreferrer"&gt;one-stop solution&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the database you want to explore from the above link and check the table for the field &lt;code&gt;Consistency concepts&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Some examples include,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB, Cassandra, Dynamo DB - Eventual Consistency, Immediate Consistency&lt;/li&gt;
&lt;li&gt;PostgreSQL - Immediate Consistency&lt;/li&gt;
&lt;li&gt;Microsoft Azure Cosmo DB - Bounded Staleness, Consistent Prefix, Eventual Consistency, Immediate Consistency, Session Consistency&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Bear in mind: Strong and Eventual are not the only type of consistencies available. There are different levels of consistency that fall between the range of the spectrum that I have explained in this article. If you would like to know more about the different levels of consistencies, please do leave a comment so that I can write subsequent articles explaining them as well.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This post is a simpler version of the detailed article created by &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Terry, D. (2013). Replicated data consistency explained through baseball. Communications of the ACM, 56(12), 82-89.)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For further detailed study visit the link &lt;a href="https://dl.acm.org/doi/fullHtml/10.1145/2500500?casa_token=y2gj74QccgYAAAAA:AGcm-AItykXuR2hWNqQ38BPVzlZjYq69K25dTCh8Nu-XVQ8pHbNqFAy1dCm0sYS2fqJapdIRpcfeb7Q" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@kantea?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Ak Ka&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/foosball?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>database</category>
    </item>
    <item>
      <title>The Wrong Migration</title>
      <dc:creator>Aravind Venkatesan</dc:creator>
      <pubDate>Sun, 14 Mar 2021 11:44:32 +0000</pubDate>
      <link>https://dev.to/aravindvenkatesan/the-wrong-migration-1nhp</link>
      <guid>https://dev.to/aravindvenkatesan/the-wrong-migration-1nhp</guid>
      <description>&lt;p&gt;Imagine you are working on your first job, you make a mistake. Yes, it is acceptable. &lt;strong&gt;The team coordinates swiftly to help rectify your mistake.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine you are 10+ years experienced senior engineer working on the most critical project of your company, you make the same mistake. Yes, it is still acceptable. &lt;strong&gt;The team again coordinates swiftly to help rectify your mistake.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A person who never made a mistake never tried anything new. &lt;br&gt;
--Albert Einstein&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Microsoft's open-source step has attracted more developers into the .NET Core community. Enterprise adoptions are also improving. Learning new things is one of the important aspects for developers to stay in the current trend.&lt;/p&gt;

&lt;p&gt;And the courage to learn new things and the passion for learning them will eventually lead us to success. Of course, success is not achieved overnight. Making mistakes is one of the stepping stones to reach success.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xD5qvJtT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rsh80691nq2npjc607wc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xD5qvJtT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rsh80691nq2npjc607wc.png" alt="Database Migrations" width="800" height="699"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;dotnet-cli&lt;/code&gt; commands might look plain and straightforward. With the help of ef core additions, the database migrations have become easier compared to the legacy way of creating migrations.&lt;/p&gt;

&lt;p&gt;To create a new migration: 🆕&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dotnet ef migrations add &amp;lt;Migration-Name&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;To update the migration to the database: 🚀&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dotnet ef database update&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;To remove the wrong migration: ⛔&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dotnet ef database remove&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Seems the above commands look simple and straightforward. So the biggest question in your mind, &lt;em&gt;"Why did I even create this article if applying migrations to the database is so simple?"&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here is the catch. Working on large-scale projects with multiple teams is different.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After updating the database, we cannot use the &lt;code&gt;dotnet ef database remove&lt;/code&gt; command to remove the migration since it is already applied. 😫&lt;/p&gt;

&lt;p&gt;If you are working independently on your project or learning from a tutorial, simply you can add an altering migration file or even drop the database delete the migration files, and start from scratch.&lt;/p&gt;

&lt;p&gt;But do you really know how to handle the wrong migrations situation when working in teams or in your day job? &lt;/p&gt;

&lt;p&gt;The purpose of the article is catered to handle this situation. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Situation:&lt;/strong&gt; 💻&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have included a column &lt;code&gt;blog_description&lt;/code&gt; with max_length(100) and created a migration file.&lt;/li&gt;
&lt;li&gt;You applied the migration in your local database and pushed the code for review.&lt;/li&gt;
&lt;li&gt;The reviewer says, "Hmmm, I want you to change the column max_length(100) to max_length(255)"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Possible problems you might face include,&lt;/strong&gt; 🙄&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Need to modify your local development database. (Other environments if any exists)&lt;/li&gt;
&lt;li&gt;Notify your team members working on the same branch. (For whatsoever reasons)&lt;/li&gt;
&lt;li&gt;Have a track of other team's migrations changes for the same or the related entities.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The easiest workaround for this situation is submitting another migration altering the max_length of the column &lt;code&gt;blog_description&lt;/code&gt;. But this is not the right way to do it.&lt;/p&gt;

&lt;p&gt;In this situation possibly you have not done a mistake but you have got an opportunity to learn how to manage this situation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resolution:&lt;/strong&gt; ✅&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First, pull the code from the &lt;code&gt;master&lt;/code&gt; branch to get the latest good migrations if any committed by other teams. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify whether changes exist in the same or related entity. If any exists, contact the respective developer or team to arrive at a consensus about the entity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update the database with the latest good migration pulled from the master branch.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;dotnet ef database update &amp;lt;Last-Good-Migration&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove the redundant migration you have added.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;dotnet ef database remove&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;By applying the latest migrations to the database to the  simply indicates that the latest one added by you is redundant or defunct. Now once you run the remove command, the ef core cli removes the "wrong" migration added by you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nBX9hNT4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ai14u56kpfnipa0vu2n.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nBX9hNT4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ai14u56kpfnipa0vu2n.jpg" alt="Alt Text" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Handling these types of situations in the workplace is an art. It can be learned only by the virtue of experience.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Finally, you might ask me, "Hey, what about the guy who was working on the same branch?" 😂&lt;/p&gt;

&lt;p&gt;"Well, tell him not to 😈"&lt;/p&gt;

&lt;p&gt;Learn More &lt;a href="https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli"&gt;Here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
