<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Saka-Aiyedun Segun on Medium]]></title>
        <description><![CDATA[Stories by Saka-Aiyedun Segun on Medium]]></description>
        <link>https://medium.com/@Saka-aiyedun.segun?source=rss-9f413947a814------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E3lHYiw_IUlEKx0fpsIOAw.jpeg</url>
            <title>Stories by Saka-Aiyedun Segun on Medium</title>
            <link>https://medium.com/@Saka-aiyedun.segun?source=rss-9f413947a814------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 12:14:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Saka-aiyedun.segun/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding Popular Blockchain Consensus Algorithms: Proof of Stake(POS) vs Proof of Work(POW)]]></title>
            <link>https://faun.pub/understanding-popular-blockchain-consensus-algorithms-proof-of-stake-pos-vs-proof-of-work-pow-fe0b7385acd9?source=rss-9f413947a814------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe0b7385acd9</guid>
            <category><![CDATA[consensus]]></category>
            <category><![CDATA[bloackchain]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[consensus-algorithm]]></category>
            <dc:creator><![CDATA[Saka-Aiyedun Segun]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 21:59:31 GMT</pubDate>
            <atom:updated>2026-01-07T00:28:08.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yw8p0juvCuoS-zVP" /><figcaption>Photo by <a href="https://unsplash.com/@miinyuii?utm_source=medium&amp;utm_medium=referral">Duy Pham</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Think of blockchain as a giant shared notebook where everyone keeps track of things like who sent money to who, who owns what, or where products came from. The cool part? No single company can mess with or erase these records. Pretty neat, right?</p><p>Instead of trusting just one organization (like a bank) to keep records straight, blockchain lets everyone check things for themselves. But this brings up a tricky question: if no one’s in charge, how does everyone agree on what’s real?</p><p>This is where consensus algorithms come in. Don’t let the fancy name scare you they’re just rules that help everyone agree on what gets added to the blockchain. It’s like having thousands of referees watching a game instead of just one.</p><p>The two most popular ways of doing this are called Proof of Work (PoW) and Proof of Stake (PoS). They both keep the network safe(at least they’re trying), but do it differently. Bitcoin uses PoW, which needs lots of computer power kind of like solving really hard puzzles. Newer systems like Ethereum use PoS, which works more like putting up collateral to show you’ll play fair. Both methods have their pros and cons.</p><p>In this guide, we’ll break down how each method works in simple terms. Whether you’re into cryptocurrency or just curious about how blockchain could change other industries, understanding these differences matters.</p><h3>Understanding Basic Blockchain Concepts</h3><p>Before we dive into PoW and PoS, let’s get the basics straight. A blockchain is like a chain of digital boxes, where each box (called a block) contains a list of transactions or other information. Each new block is linked to the previous one, creating an unbreakable chain of information.</p><p>Decentralization is key here it means no single person or company controls the system. Instead, copies of the blockchain are stored on thousands of computers worldwide. This makes it nearly impossible for anyone to cheat or change past records.</p><h3>Proof of Work (PoW) Deep Dive</h3><p>Remember playing those math games in school? PoW is kind of like that, but for computers. Let’s dive into how it really works, in this explanation we would explain how it works at a high level in bitcoin blockchain, because bitcoin is the biggest user of the proof of work algorithm:</p><h4>How PoW Reaches Consensus</h4><p>The process begins when new transactions need to be added to the blockchain. Instead of a central authority approving these transactions, the network collects them into what’s called a block. Each block is connected to all previous blocks through a unique digital fingerprint (known as a hash), creating an unbroken chain of information. This is where the real challenge begins.</p><p>To maintain security and agreement across the network, PoW requires participants (called nodes) to solve a complex mathematical puzzle before they can add a new block. This puzzle is intentionally difficult to solve but easy to verify kind of like a Sudoku puzzle. The difficulty of solving this puzzle is what prevents any single party from controlling the network.</p><h4>The Technical Process: SHA-256 Validation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EIk8xfyrfKt5JZZDC7qELg.png" /><figcaption>PoW Consensus Process</figcaption></figure><p>At the heart of this consensus mechanism lies a sophisticated process called SHA-256 validation. When a node proposes a new block, it must include several crucial pieces of information. This includes the current version of the protocol rules, a link to the previous block, a summary of all transactions, a timestamp, the current difficulty level, and most importantly, proof that they’ve done the computational work.</p><p>The actual consensus is achieved through a fascinating process. Nodes across the network compete to find a special number (called a nonce) that, when combined with the block’s data, creates a hash value meeting specific criteria. Think of it like finding a combination to a lock, but one where there are billions of possible combinations, and you can only find the right one through trial and error.</p><p>What makes this system particularly clever is that while finding the right solution requires enormous computational power, verifying that solution is almost instantaneous. When a node finds a valid solution, other nodes can quickly check if it’s correct. If the majority of nodes confirm the solution is valid, consensus is reached, and the block is added to the chain.</p><h4>Evolution and Security</h4><p>As the network has grown, the way nodes participate has evolved dramatically. What started with regular computer processors (CPUs) soon moved to more powerful graphics cards (GPUs), and eventually led to the development of specialized hardware designed specifically for this task. This evolution reflects the increasing competitiveness and security of the network.</p><p>The beauty of PoW lies in its economic incentives. The significant computational work required makes it extremely expensive to try to cheat the system. To alter past transactions, someone would need to redo all the work from that point forward a task that becomes increasingly impossible as the chain grows longer. This makes honest participation more profitable than attempting to attack the network.</p><p>However, this security comes at a cost. The massive computational power required by PoW translates to substantial energy consumption, leading some to question its long-term sustainability. This concern has sparked interesting debates about alternative consensus mechanisms, which we’ll explore later in this article.</p><h3>Proof of Stake (PoS) Explained</h3><p>Just as PoW uses computational power to reach consensus, PoS introduces a different but equally clever approach. Instead of solving puzzles, this system works more like a security deposit system in the real world, but with some fascinating technical details underneath.</p><h4>How PoS Reaches Consensus</h4><p>The consensus process in PoS starts with validators participants who’ve locked up (or “staked”) their cryptocurrency as collateral. Think of it like putting down a deposit that says, “I promise to validate transactions honestly.” For example, on Ethereum’s network, validators must stake 32 ETH a significant amount that ensures they have a real interest in keeping the system running properly.</p><h4>The Technical Process: Block Validation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V7KW06HItUne_VqeVoGcig.png" /><figcaption>PoS Consensus Process</figcaption></figure><p>When a Proof of Stake (PoS) system adds new transactions, it follows a process that’s a bit like a lottery:<br><strong>1. Choosing a Block Proposer:</strong><br>The network picks one validator at random to create (or “propose”) the next block of transactions. It’s not completely random, though if you’ve “staked” more coins, you have more “lottery tickets,” so you’re more likely to get chosen.</p><p><strong>2. Attestation (Double-Checking):</strong><br>After a block is proposed, a group of other validators (also chosen randomly) looks it over. They check to make sure that:</p><ul><li>All the transactions are valid.</li><li>The proposer followed the rules.</li><li>The new block correctly connects to the one before it.</li><li>There are no attempts to spend the same coins twice.</li></ul><p><strong>3. Reaching Agreement:</strong><br>If around two-thirds of these validators agree that everything is correct, the block is added to the chain. This means no single validator can cheat, since they need lots of others to back them up.</p><h4>The Slashing Mechanism</h4><p>What makes PoS particularly clever is its penalty system, called “slashing.” If validators try to cheat maybe by approving invalid transactions or trying to create alternate versions of the blockchain, they lose some or all of their staked funds. Specific behaviors that get punished include:</p><ul><li>Double signing: Validating conflicting blocks at the same height</li><li>Inactivity: Not participating when you’re supposed to</li><li>Malicious behavior: Trying to rewrite history or approve invalid transactions</li></ul><p>The threat of losing their stake makes validators think twice before attempting anything dishonest. It’s like having a security deposit that gets confiscated if you break the rental agreement.</p><h4>Technical Requirements</h4><p>Unlike PoW’s energy-hungry mining rigs, PoS has much more modest hardware requirements:</p><ul><li>A reliable internet connection</li><li>A computer with decent specs (but nothing extraordinary)</li><li>The ability to stay online consistently</li><li>The required stake amount</li></ul><p>This accessibility is one reason why PoS has gained popularity — you don’t need a warehouse full of specialized equipment to participate.</p><h4>The Role of Economic Security</h4><p>PoS’s security model is based on economic game theory. The system is secure because:</p><ul><li>Validators have their own money at stake</li><li>The cost of attacking the network (in terms of required stake) is higher than the potential profit</li><li>Bad actors risk losing their entire stake</li><li>The more valuable the network becomes, the more expensive it is to attack</li></ul><h4>Real-World Example: Ethereum’s Switch</h4><p>The most significant example of PoS in action is Ethereum’s recent switch from PoW to PoS (called “The Merge”). This change dramatically reduced Ethereum’s energy consumption by over 99%, showing that large-scale blockchain networks can operate efficiently without massive computational power.</p><p>Now that we understand both systems, let’s look at how they stack up against each other:</p><h4>Security Approach</h4><p>PoW secures the network through raw computing power and electricity usage, making attacks extremely expensive. PoS, on the other hand, uses financial stakes as its security mechanism. Both approaches effectively deter bad behavior, just through different means.</p><h4>Energy Efficiency</h4><p>This is where the differences become stark. PoW consumes massive amounts of electricity. Bitcoin alone uses more energy than some countries. PoS, however, requires only the energy needed to run basic computer hardware, making it far more environmentally friendly.</p><h4>Network Participation</h4><p>PoW has become increasingly centralized due to the high costs of mining equipment and electricity. Only those with access to cheap power and expensive hardware can effectively participate. PoS, while requiring a significant initial investment, allows more people to participate since it doesn’t need specialized hardware.</p><h4>Transaction Speed</h4><p>PoS typically processes transactions faster than PoW. Since it doesn’t need to solve complex puzzles, blocks can be validated more quickly. This makes PoS better suited for networks that need to handle lots of transactions quickly.</p><h3>The Future of Consensus Mechanisms</h3><p>The blockchain world isn’t standing still. New consensus mechanisms are being developed that try to take the best parts of both PoW and PoS while addressing their weaknesses. Some exciting approaches include:</p><ul><li>Delegated Proof of Stake (DPoS): Where token holders vote for validators</li><li>Proof of Authority (PoA): Where known, trusted entities validate transactions</li><li>Hybrid systems: Combining different consensus mechanisms for different tasks</li></ul><h3>Conclusion</h3><p>Both PoW and PoS have their place in the blockchain ecosystem. PoW, with its battle-tested security, continues to power Bitcoin and other networks where maximum security is crucial. Meanwhile, PoS has opened new possibilities for efficient, scalable blockchain networks, as demonstrated by Ethereum’s successful transition.</p><p>The choice between them often depends on specific needs:</p><ul><li>Need maximum security and don’t mind the energy usage? PoW might be your answer.</li><li>Want efficiency, speed, and environmental friendliness? PoS could be the better choice.</li></ul><p>As blockchain technology continues to evolve, we’ll likely see even more innovative consensus mechanisms emerge. The key will be finding the right balance between security, efficiency, and accessibility — making blockchain technology more sustainable and accessible while maintaining its core promise of decentralization.</p><p>The most exciting part? We’re still in the early stages of this technology. The consensus mechanisms we use today might look very different from what we’ll use in the future, but the fundamental goal remains the same: creating secure, decentralized systems that everyone can trust.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*UMeLzn-FY4_PcSvM.png" /></figure><h4>👋 If you find this helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀<a href="http://from.faun.to/r/8zxxd">Join FAUN Developer Community &amp; Get Similar Stories in your Inbox Each Week</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe0b7385acd9" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/understanding-popular-blockchain-consensus-algorithms-proof-of-stake-pos-vs-proof-of-work-pow-fe0b7385acd9">Understanding Popular Blockchain Consensus Algorithms: Proof of Stake(POS) vs Proof of Work(POW)</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part Three of Infrastructure as Code(IAC) with Terraform: Best Practices]]></title>
            <link>https://faun.pub/part-three-of-infrastructure-as-code-iac-with-terraform-best-practices-9abc5a630f51?source=rss-9f413947a814------2</link>
            <guid isPermaLink="false">https://medium.com/p/9abc5a630f51</guid>
            <category><![CDATA[terraform-modules]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Saka-Aiyedun Segun]]></dc:creator>
            <pubDate>Mon, 16 May 2022 13:11:10 GMT</pubDate>
            <atom:updated>2022-07-30T08:55:20.069Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zqXfw1E1QU8iD6B_" /><figcaption>Photo by <a href="https://unsplash.com/@jontyson?utm_source=medium&amp;utm_medium=referral">Jon Tyson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hello! Welcome back to my domain. This is a follow-up to my earlier hands-on Terraform post. If you haven’t already checked it out, please <a href="https://medium.com/@Saka-aiyedun.segun/part-2-of-infrastructure-as-a-code-with-terraform-creating-an-aws-vpc-and-subnet-c7def6a2f390">click</a>. So, without further ado, let’s get everyone on board and go over some Best practices for improving your Terraform process.</p><p>Terraform is one of the most popular infrastructure as code (IAC) tools available, and if you’re just getting started with it, you might be wondering if you’re doing things correctly. As a result, in this article, you will learn NINE terraform best practices that will immediately enhance your terraform workflow.</p><ul><li><strong>Only use Terraform Commands to Manipulate the State File</strong></li></ul><p>Because the state file is a JSON file, do not manually edit it; otherwise, you can obtain unexpected results and errors. What is the source of this state file? Terraform will construct the state file locally the first time you use the apply command. Use the following command to transfer or delete a state:</p><p>(terraform state rm and terraform state mv)</p><p>But what if you’re working with a team? Other team members will need to execute Terraform commands as well, and they’ll require the state file to do so. In reality, each team member will require the most recent state file before making their own changes.</p><ul><li><strong>Always Set up a Shared Remote Storage</strong></li></ul><p>Set up a shared remote storage location for the state file. Using this shared state file, any team member can perform Terraform instructions. In reality, Amazon S3 buckets, Terraform Cloud, Azure, or Google Cloud may be used as remote storage for state files. You may also set Terraform to utilize the remote storage as a state file location. But what if two members of the team run Terraform commands at the same time? If the state file contains concurrent modifications, you may encounter a conflict or damage it.</p><ul><li><strong>Use State Locking</strong></li></ul><p>To prevent modifying Terraform state at the same moment, the following approach is to lock the state file until an update is entirely done, then unlock it for the next command. Concurrent modifications to the state file can therefore be avoided. This will be specified in the storage backend in practice. The DynamoDB service is utilized automatically for state file locking, but note that not all storage backends support this, so be aware of that when choosing remote storage for your state file. However, if it is supported, Terraform will automatically lock the state file.</p><ul><li><strong>Back-Up Your State File</strong></li></ul><p>This is accomplished effectively by allowing versioning. Simply enable the versioning feature in an s3 bucket, for example. This also means you can go back to any prior Terraform state if you wish, and you have a great history of state changes.</p><ul><li><strong>Use One State Per Environment</strong></li></ul><p>Typically, there will be numerous settings such as development, testing, and production. So, which environments are these state files associated with? Is it possible to handle all environments with a single state file? Make sure that each environment has one state file, and that each state file has its own storage backend with locking and versioning set. Instead of a large enormous state, the split will allow each team its own component to manage. Although it may be tough to manage the modules and state files, your activities will be safer and more efficient.</p><ul><li><strong>Host Terraform Code in its own Git Repository</strong></li></ul><p>Terraform code should be hosted in its own git repository, exactly as application code. This is useful not just for successful team collaboration, but also for versioning infrastructure code changes. This will provide you with a history of infrastructure code changes.</p><ul><li><strong>Use Terraform Modules</strong></li></ul><p>Use terraform modules to reuse code, especially when creating multiple resources or working with multiple environments</p><ul><li><strong>Use Counts</strong></li></ul><p>Use count and for each loop to optimize repetitive resource generation inside your modules, such as establishing numerous subnets with a single block of resource code.</p><ul><li>Avoid hard-coding your values within your resource blocks. use variables instead and centralize the values with the terraform.tfvars file</li></ul><blockquote><em>Thank you for reading! do leave a clap. You can reach out to me on</em><a href="https://www.twitter.com/kaytheog"><em> Twitter</em></a><em> or </em><a href="https://www.linkedin.com/in/segun-saka-aiyedun-3807981b9/"><em>LinkedIn</em></a><em>.</em></blockquote><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9abc5a630f51" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/part-three-of-infrastructure-as-code-iac-with-terraform-best-practices-9abc5a630f51">Part Three of Infrastructure as Code(IAC) with Terraform: Best Practices</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 2 of Infrastructure as Code with Terraform: Creating an AWS VPC, and Subnet]]></title>
            <link>https://faun.pub/part-2-of-infrastructure-as-a-code-with-terraform-creating-an-aws-vpc-and-subnet-c7def6a2f390?source=rss-9f413947a814------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7def6a2f390</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Saka-Aiyedun Segun]]></dc:creator>
            <pubDate>Sun, 15 May 2022 23:21:19 GMT</pubDate>
            <atom:updated>2022-07-18T08:21:18.784Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*G0Yx8gIN7PC-xFzj.png" /></figure><p>If you have no idea what Terraform is, why it is used, how it works and what are its benefits? You can check out this <a href="https://medium.com/@Saka-aiyedun.segun/part-one-of-infrastructure-as-code-iac-using-terraform-a-high-level-overview-cf9a7f9f022f">article </a>for that. Without further-ado Let’s get straight into it.</p><p>In this tutorial, we’ll use Terraform to create AWS VPC and Subnet.</p><h3>Requirements For This Hands-on Lab</h3><ul><li>An AWS Account: To get started with AWS, follow these <a href="https://aws.amazon.com/">instructions</a></li><li>Terraform: To install Terraform on your local machine, follow the download<a href="https://learn.hashicorp.com/tutorials/terraform/install-cli"> instructions</a></li><li>IDE: In this tutorial VS Code is going to be used but other IDE can also be used. To install VS Code follow the following <a href="https://code.visualstudio.com/download">instructions</a></li></ul><p>In this guide, a Windows OS is going to be used, but don&#39;t worry Mac and Linux users the commands are the same.</p><p>First off, Create a terraform folder named terraform, navigate inside and create a file called main.tf as we will provision our resource with that file.</p><ul><li><em>N/B: Every Terraform file ends with a</em> .tf</li></ul><p>Open themain.tf with the installed IDE. There are three methods for authenticating with AWS: environment variables, shared credentials, and IAM roles for compute resources, but for this beginner&#39;s hands-on experience we are going to use the environment variable method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*kgqQ0RtIHZMLvnJAvtkAUA.jpeg" /></figure><p>As seen above, we have identified the cloud service provider on which we will develop our infrastructure, the region in which we want to create, and the access key from our AWS account.</p><p><em>N/B: providing your AWS access key in the main.tf is not the best practice when building your infrastructure, but we are just using it here because this is a beginner hands-on</em></p><p><strong>Creating VPC and Subnet</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*YgHkCNL-FNKGkOAcUpvIqA.jpeg" /></figure><p>The above code will create a VPC and Subnet inside the VPC within the range if the Cider block is defined.</p><p>Inside the folder containing the main.tf simply perform the following command to initialize Terraform inside of the folder and also install the AWS plugin:</p><pre>terraform init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vH2WLNSpcdthd49rcYfUVA.png" /></figure><p>Terraform has been successfully initialized inside of my “<strong>terraform</strong>” folder containing my main.tf file. Now the AWS plugin has been successfully downloaded, let’s go ahead and “<strong>apply</strong>” the terraform script and create our VPC and Subnet. In order to do that we perform the following command:</p><pre>terraform apply</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*67artPN0c_kNwK0qA0E9Mw.jpeg" /></figure><p>As you run the terraform apply the command you will be faced with a prompt, type yes and hit ENTER to create the AWS VPC and Subnet.</p><p>And there you have it! we have successfully created an AWS VPC and Subnet with Terraform in just a matter of seconds. You can navigate to your VPC dashboard on your AWS Management Console to confirm this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*OPWYHwADcEgs7A8ZLuBM0g.jpeg" /></figure><p>If you wish to terminate the instance you just created, simply run terraform destroy in your terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9spqcKw743N8r-qHmWelg.png" /></figure><p>Terraform has successfully destroyed the resources described in the main.tf file.</p><p><strong>Conclusion</strong></p><p>Of course, we have only covered the very fundamentals of Terraform in this infrastructure as a code series; there is much more to Terraform (such as Data Sources, Interpolation, Overrides, Modules, and so on), but we will save that for another day. However, using the information provided in this article, you can begin building your own basic configuration files pretty quickly and offer whatever sort of infrastructure you like in a matter of minutes.</p><h3>Thank you for taking the time to read this!</h3><p><em>You can reach out to me on</em><a href="https://www.twitter.com/kaytheog"><em> Twitter</em></a><em> or</em><a href="https://www.linkedin.com/in/segun-saka-aiyedun-3807981b9/"><em> LinkedIn</em></a></p><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7def6a2f390" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/part-2-of-infrastructure-as-a-code-with-terraform-creating-an-aws-vpc-and-subnet-c7def6a2f390">Part 2 of Infrastructure as Code with Terraform: Creating an AWS VPC, and Subnet</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part One of Infrastructure as Code (IAC) with Terraform: A High Level-Overview]]></title>
            <link>https://faun.pub/part-one-of-infrastructure-as-code-iac-using-terraform-a-high-level-overview-cf9a7f9f022f?source=rss-9f413947a814------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf9a7f9f022f</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Saka-Aiyedun Segun]]></dc:creator>
            <pubDate>Sun, 15 May 2022 21:09:35 GMT</pubDate>
            <atom:updated>2022-05-17T19:23:41.287Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0PxP2fCUkM3nlVWj" /><figcaption>Photo by <a href="https://unsplash.com/@afgprogrammer?utm_source=medium&amp;utm_medium=referral">Mohammad Rahmani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When creating a cloud-native application, it is critical to establish a highly secure, robust, sustainable, and highly available infrastructure. This was done manually by software engineers, which could lead to errors, and the infrastructure is not reusable or transferable, so something had to be done. To assist with this issue, infrastructure as code (IAC) was built. There will always be errors, but this technique makes it easier to find them, reuse the infrastructure, and, if required, transfer the environment.</p><p>In order to understand Terraform, we must first define the concept infrastructure as code (IAC), since both concepts are interconnected.</p><p><strong>What is Infrastructure as Code (IAC)</strong></p><blockquote>Infrastructure as Code (IaC) is the managing and provisioning of infrastructure through code instead of through manual processes.</blockquote><p>How do you define the aforementioned “infrastructure”? Hardware, software, operating systems, and data storage are all involved. This “infrastructure” includes both cloud and on-premises infrastructure.</p><p>So, in this piece, terraform will be covered, why is so important, as well as how it connects to infrastructure as code.</p><p><strong>What is Terraform?</strong></p><blockquote>Terraform written in Go, is an open-source Infrastructure-as-Code tool created by Hashicorp. With Terraform one can build, change, and version infrastructure safely and efficiently.</blockquote><blockquote>Terraform is an open-source tool that uses declarative language meaning, with Terraform you can specify what you want and also specify the final results, Terraform will simply do the rest.</blockquote><p>Terraform is widely used to provision cloud infrastructure since it works with so many providers, including AWS, Azure, GCP, Alibaba Cloud, and Oracle Cloud. Terraform supports on-premises infrastructure but not stand-alone infrastructure; on-premises infrastructure must use OpenStack or VMWare, both of which are supported by Terraform.</p><p>Terraform allows users to conduct multi-cloud functions such as utilizing the Azure Data Factory, which is only accessible on Azure, Google BigQuery, which is only available on Google Cloud Platform, or Amazon Lambda, which is only available on Amazon Web Services. Terraform may be used to develop and manage all of the aforementioned infrastructures.</p><p><strong>Why is Terraform Important?</strong></p><p>DevOps’ major purpose is to execute more effective software delivery and to make delivery fast and speedy. We require solutions like Terraform, which assist businesses with infrastructure as code and automation. It is revolutionizing the DevOps world by altering the way infrastructure is handled, making DevOps execution faster and more efficient. For automating and provisioning software, there are tools such as Ansible, Chef, and Puppet. Terraform follows the same “infrastructure as code” principle, but it focuses on infrastructure automation. Complete cloud infrastructure, including instances, IP addresses, volumes, and networking, may be readily established.</p><p><strong>Terraform Use cases</strong></p><ul><li>Terraform supports services supplied by PaaS providers such as Heroku. Heroku is a platform for hosting web applications. Developers construct a program and then add add-ons such as a database or email provider. Its best feature is the ability to elastically scale the number of dynos or workers. Terraform is used to codify the Heroku application configuration, guaranteeing that all essential add-ons are available. Other configurations such as setting up a custom CNAME can also be done with Terraform in very little time.</li><li>Terraform allows one to spin up environments to test software in, and then dispose of the environment. Furthermore, if the operators are happy with the status of an application in the staging environment, that staging environment may be readily cloned and utilized as the production environment.</li><li>Terraform is cloud-agnostic, allowing a single configuration to manage different providers as well as cross-cloud dependencies. This reduces administration and orchestration complexity, allowing operators to develop large-scale multi-cloud systems.</li></ul><p><strong>Benefits of Using Terraform</strong></p><ul><li>Terraform allows users to commit their Infrastructure-as-Code to VCS (version control system) to foster collaboration and keep track of changes</li><li>If your chosen Terraform plugin or provider is not available on the Terraform Registry, you may simply design your own and connect it with Terraform to easily construct your infrastructure.</li><li>Teams can use Terraform to assess and comment on infrastructure. Terraform supports state management (storage, viewing, history, and locking), as well as a web interface for watching and authorizing Terraform processes.</li><li>Terraform is more concerned with server provisioning. When the entire cloud infrastructure is viewed as code and all parameters are merged in a configuration file, all team members may simply collaborate on them as they would any other code.</li></ul><p>Before we continue, there is a question that many people have about Terraform: what is the difference between Terraform and Ansible?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*yEN5df1CiJITbYbT" /></figure><p>It’s worth noting that they’re both Infrastructures as a code, which means they’re both used to automate provisioning, configuring, and maintaining infrastructure, but there are some main differences and they are :</p><ul><li>Terraform is primarily an infrastructure provisioning tool, but can also be used to deploy applications and other tools on the provisioned infrastructure. Ansible, on the other hand, is primarily a configuration tool, which means that once the infrastructure has been provisioned, Ansible can now be used to configure the infrastructure, deploy applications, and install/update software on the infrastructure.</li><li>Ansible is more mature.<strong> While</strong> Terraform is relatively new, and because of that, it changes dynamically.</li><li>Ansible is immutable, which means it cannot be altered once it has been configured, but Terraform is changeable, which means it may be updated after it has been supplied.</li></ul><p>There are overlaps in what each tool accomplishes, which might lead to misunderstanding. The essential takeaway is that Terraform is a “superior” solution for infrastructure provisioning, but Ansible is better for configuring provisioned infrastructure. It is typical practice for DevOps engineers to employ a combination of both to cover the entire setup end to end, rather than relying just on one tool.</p><p><strong>Terraform Architecture</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*t7PcPbhhzBWnfdgx" /></figure><p>There are two main components that make up its architecture. The first one is:</p><ul><li><strong>The Core</strong>: The core requires two input sources to function. The first is that it employs Terraform configuration, which allows you as a user to specify what needs to be produced or provided. The second input source is Terraform state, which is the most recent state of how the infrastructure is currently configured. As a result, the core evaluates the present state and the intended configuration, and if there is a discrepancy, it determines what has to be done to achieve the desired state.</li><li><strong>Providers:</strong> Terraform relies on plugins called <strong>“providers”</strong> to interact with cloud providers, SaaS providers, and other APIs.</li></ul><p>After determining the status of the infrastructure via the Terraform config file, the Core interacts with the selected cloud provider using the Terraform plugin to construct, update, or remove the desired infrastructure.</p><p>You now have a better understanding of how Terraform works, the advantages of using it, and some of its real-world applications. In the next post, we’ll use Terraform to provision an AWS VPC, and Subnet.</p><h3>Thank you for taking the time to read this!</h3><p><em>You can reach out to me on</em><a href="https://www.twitter.com/kaytheog"><em> Twitter</em></a><em> or</em><a href="https://www.linkedin.com/in/segun-saka-aiyedun-3807981b9/"><em> LinkedIn</em></a></p><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf9a7f9f022f" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/part-one-of-infrastructure-as-code-iac-using-terraform-a-high-level-overview-cf9a7f9f022f">Part One of Infrastructure as Code (IAC) with Terraform: A High Level-Overview</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Exactly is YAML?]]></title>
            <link>https://faun.pub/what-exactly-is-yaml-7622129e5444?source=rss-9f413947a814------2</link>
            <guid isPermaLink="false">https://medium.com/p/7622129e5444</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[configuration-management]]></category>
            <category><![CDATA[yaml]]></category>
            <dc:creator><![CDATA[Saka-Aiyedun Segun]]></dc:creator>
            <pubDate>Sun, 08 May 2022 22:24:44 GMT</pubDate>
            <atom:updated>2022-05-17T19:14:28.947Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*5k_t4RwwCzD1q0KX7r4nqA.jpeg" /><figcaption>Image by Ferenc from <a href="https://unsplash.com/photos/An6M5zgFPj4">Unsplash</a></figcaption></figure><p>The recursive YAML abbreviation stands for “YAML Ain’t Markup Language,” indicating that it is flexible and data-driven. In fact, it may be utilized with almost any application that requires data storage or transmission. The fact that YAML is made up of bits and pieces of various languages contributes to its versatility. We will look at the YAML syntax and get a basic understanding of it in this article.</p><p><strong>What is YAML</strong></p><blockquote>YAML is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted.</blockquote><p>Before we proceed, certain terminologies must be defined. <strong>What exactly is Data Serialization?</strong></p><blockquote>The act of transforming data items from complicated data structures into a byte stream for storage, transport, and dissemination on physical devices is known as data serialization.</blockquote><p><strong>What is a configuration file after defining data serialization?</strong></p><blockquote>A configuration file is a file that is used to configure the parameters, preferences and initial settings for computer programs and operating systems.</blockquote><p>YAML can be used to write configurations for computer applications or infrastructure devices. The architecture of various operating systems, applications, and so on varies. So, in order for data to be saved or communicated to various systems or apps, a platform-neutral language is necessary for appropriate communication, which is where YAML comes in. Configurations for apps, infrastructure devices (cloud servers), and operating systems may be transferred over the internet via web services using YAML’s Data Serialization capability.</p><p>While it is sometimes disregarded by developers, it is a strong and easy tool that may significantly boost your career chances with just a few hours of training.</p><p>YAML is comparable to XML, CSV, and JSON files, however, it has a simpler syntax while retaining similar functionality. It is often used in infrastructure-as-code (IAC) systems to produce configuration files or to control containers in the DevOps development pipeline.</p><p><strong>Why is YAML superior to other Data Serialization Languages?</strong></p><ul><li>It is human readable and intuitive which makes it great for writing configuration files.</li><li>Because YAML is a superset of JSON, JSON files may still be rewritten into valid YAML files. JSON is also a superset of XML.</li><li>Minimalist syntax</li></ul><p><strong>YAML Fundamentals</strong></p><p>To minimize ambiguity issues with multiple languages and editing tools, YAML has specified constraints in place. These rules enable a single YAML file to be parsed consistently independent of the application or library used.</p><ul><li>YAML files should end with.yml or .yaml</li><li>YAML case is sensitive</li><li>YAML does not allow the use of tabs</li></ul><h4>YAML Syntax</h4><p>The first thing you should know about YAML is that it places a strong emphasis on indentation. YAML often indents 2 or 4 spaces. Indentation is used in YAML to divide code chunks.</p><ul><li>Key-Value Pairs.</li></ul><p>Most elements in a YAML file are key-value pairs, with the key representing the pair’s name and the value being the data associated with that name. All other YAML structures are built on key-value pairs.</p><pre>App: &quot;user-authentication&quot;<br>port: 9000<br>version: 1.7</pre><p>Above is a basic key-value combination. This is how a YAML file is constructed, and we have several data types, such as strings and floating integers.</p><ul><li>Comments</li></ul><pre># this is comment</pre><p>Anything that begins with a #sign is a YAML comment.</p><ul><li>Object</li></ul><p>This can also be used to define the key-value pairs. Therefore the key-value pairs are attributes of the Microservice object. Let’s take a look:</p><pre>microservice: Workflow</pre><pre>   App: &quot;user-authentication&quot;<br>   port: 9000<br>   version: 1.7</pre><ul><li>Sequences</li></ul><p>Sequences are data structures that, like a list or an array, store many values under the same key. They are defined using either a block or inline flow style.</p><p>The document is structured using spaces in block format. It is simpler to read yet less compact than the flow style.</p><pre>microservice:<br>  - App: &quot;user-authentication&quot;<br>    port: 9000<br>    version: 1.7<br>  - App: &quot;user-page&quot;<br>    port: 80<br>    version: 2.1</pre><ul><li>Boolean</li></ul><p>You can also utilize boolean values in Yaml, which can be TRUE/FALSE, YES/NO and ON/OFF.</p><pre>microservice:<br>  - App: &quot;user-authentication&quot;<br>    port: 9000<br>    version: 1.7<br>    deployed: true</pre><p>Consider the following real-world example. A sample Kubernetes pod configuration for Nginx with simple key-value pairs and lists is shown below:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: nginx-pod<br>  labels:<br>  app: nginx<br>spec:<br>  containers:<br>  - name: nginx-container <br>    Image: nginx<br>    ports:<br>    - containerPort: 80<br>    volumeMounts:<br>    -name: ngnix-vol<br>     mountPath:/user/nginx/html</pre><p>metadata is an object containing name and labels attributes with the key-value pair app: nginx. a spec is an object with object attributes specified, these objects include: containers, ports and volumeMounts. apiVersion specifies which version of Kubernetes API you’re using to create the Kubernetes object which is a pod in this case. kind specifies the kind of object you wish to create. metadata simply helps to uniquely identify the object by specifying a name, labels and optional namespaces. spec specifies the state for the object.</p><p><strong>Conclusion</strong></p><p>Because YAML is so delicate, it is usually a good idea to utilize a YAML validator; one such online tool is<a href="https://onlineyamltools.com/"> onlineyamltools</a>.</p><p>The content in this guide should be all you need to comfortably write a config file. YAML does support additional features, which you can read about on the <a href="https://yaml.org/spec/1.2.2/">official site</a> or the less intimidating (but less exhaustive) <a href="https://learnxinyminutes.com/docs/yaml/">Learn X in Y minutes</a>.</p><p>Thanks for reading 💜</p><h4><strong>Thanks for taking the time to read my blog ❤️. You can reach out to me on </strong><a href="https://twitter.com/kaytheog"><strong>Twitter</strong></a><strong> and </strong><a href="https://www.linkedin.com/in/segun-saka-aiyedun-3807981b9/"><strong>LinkedIn</strong></a></h4><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7622129e5444" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/what-exactly-is-yaml-7622129e5444">What Exactly is YAML?</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A High-Level Overview of DevOps]]></title>
            <link>https://faun.pub/a-high-level-overview-of-devops-ce0971477756?source=rss-9f413947a814------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce0971477756</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Saka-Aiyedun Segun]]></dc:creator>
            <pubDate>Sat, 07 May 2022 19:42:03 GMT</pubDate>
            <atom:updated>2022-05-10T22:51:36.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gWbhDBsyl72gU5wq" /><figcaption>Photo by <a href="https://unsplash.com/@jacksloop?utm_source=medium&amp;utm_medium=referral">Jack Sloop</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Despite the fact that the phrase “DevOps” is growing increasingly common in both major corporations and web-native startups, there is still some misconception about what it genuinely implies. Is DevOps a culture, a movement, a practice, a philosophy, or a combination of all of the above?, Or does DevOps imply various things to different people? What existed before DevOps? What was the software development process like prior to the use of DevOps?. All of these will be covered in this article.</p><p><strong>What is DevOps</strong></p><p>DevOps is a set of practices, tools, and cultural philosophies that integrates software development and IT operations into a single role, with the purpose of improving a company’s ability to deliver software at a high velocity.</p><p>DevOps eliminates the old barriers that existed between IT operations and software development in order to accomplish Continuous Integration and Continuous Delivery (CI/CD) of high-quality software features and apps to end-users.</p><p><strong>What was the Software Development Model before DevOps?</strong></p><p>The waterfall model was used prior to DevOps. The Waterfall approach to system analysis and design was the first well-established contemporary system development approach. So, what exactly is the <strong>Waterfall Approach?.</strong></p><blockquote>The waterfall Approach is a sequential model that divides software development into pre-defined phases. Each phase must be completed before the next phase can begin with no overlap between the phases. Each phase is designed for performing specific activities during the SDLC phase.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Gu9vxyMpjjeivP8yUgsuhg.jpeg" /><figcaption><a href="https://www.tutorialspoint.com/">https://www.tutorialspoint.com</a></figcaption></figure><p>The Waterfall approach phases include:</p><ul><li><strong>Requirement Analysis:</strong> During this phase, all potential system needs are identified and recorded in a requirement specification document.</li><li><strong>System Design: </strong>This phase studies the requirements specifications from the previous phase and prepares the system design. This system design aids in the specification of hardware and system requirements, as well as the definition of the overall system architecture.</li><li><strong>Implementation: </strong>The system is first built in discrete programs called units, with input from the system design, and then combined in the following step. Unit Testing is the process through which each unit is designed and tested for functioning.</li><li><strong>Integration and Testing</strong>: After each unit has been tested, all of the units built during the implementation phase are merged into a system. Following integration, the complete system is tested for flaws and failures.</li><li><strong>Deployment of System:</strong> Following the completion of functional and non-functional testing, the product is deployed in the client environment or launched to the market.</li><li><strong>Maintenance: </strong>There are a few difficulties that arise in the client environment. Patches are published to address these vulnerabilities. In order to improve the product, newer versions are published. Maintenance is performed in order to implement these modifications in the client environment.</li></ul><p>All of these stages are connected in such a way that progress is considered to flow smoothly downhill (like a waterfall) through the phases. The next phase begins only once the preceding phase’s established set of goals has been met and signed off, thus the term “Waterfall Model.” Phases do not overlap in this model.</p><p>The waterfall development process is simple to comprehend and manage due to its linear character. The waterfall technique is best suited for projects with defined objectives and predictable needs.</p><p>All of these phases add up to a lengthy Software Development Life Cycle. When the cycle is in action, no new features or implementations can be suggested; there is no resilience in this paradigm, limiting mutability or flexibility for change throughout any of the stages. Although this approach provides advantages such as simplicity, manageability, ease of application on smaller projects, clearly defined successes or milestones, and avoidance of overlapping stages. However, this model plainly had severe flaws that outweighed the benefits, necessitating the introduction of a new Software Development Life Cycle (SDLC) model.</p><p><strong>Some of the Difficulties Generated by The Waterfall Model when Utilized as a Technique and a Culture are as follows:</strong></p><ul><li>An error can be fixed only during the phase</li><li>Panics are caused by severe system disruptions because systems are not “bullet-proof,” and this can be a big pain.</li><li>It is not desirable for a complex project where requirement changes frequently</li><li>Not suitable for the projects where requirements are at a moderate to high risk of changing. So, risk and uncertainty are high with this process model.</li><li>Integration is done as a “big bang” at the very end, which doesn’t allow identifying any technological or business bottleneck or challenges early.</li></ul><p>As a result of all of these issues, the Agile model emerged as a natural successor for the Waterfall Model. So, <strong>what is The Agile Model?.</strong></p><blockquote>The Agile Model or Methodology is simply a practice that encourages continuous repetition of development and testing throughout the Software Development Life Cycle of a given project. With this model, development and testing occur side-by-side.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*U2-yQnnyWLFzZacJFOqERQ.jpeg" /></figure><p>The Agile Methodology continually evaluates requirements, plans, and outcomes across the SDLC, giving teams a competitive advantage in responding to change at a faster speed. Iterations are used to create and implement incremental components such as updates. Each iteration is quick, with the goal of delivering portions of the product to the end-user rather than a big-bang release, as with the Waterfall Model. If adjustments are required, an iteration is carried out, and a new version of the product (software) is made available to the end-user. Long-term planning is not developed using this paradigm. This methodology emphasizes tiny incremental releases, with each release expanding on prior features. Each release is thoroughly tested to ensure software quality is maintained.</p><p>When adding new functionality, teams employ the agile development technique to reduce risk (such as errors, cost overruns, and changing needs). Teams build software in iterations that include mini-increments of new functionality in all agile approaches. The agile development technique comes in various flavours, including scrum, crystal, extreme programming (XP), and feature-driven development (FDD).</p><p><strong>What are The Benefits of The Agile Model?.</strong></p><ul><li>The fundamental advantage of agile software development is the ability to release software in iterations. Iterative releases increase productivity by allowing teams to identify and correct faults while also aligning expectations early on. They also enable consumers to reap the advantages of software sooner, thanks to regular incremental changes.</li><li>Properly operational software is usually supplied in a couple of weeks rather than months or years.</li></ul><p><strong>Similar to the waterfall model, agile, as well, has several problems that might lead it to fall short. Some of these dangers are as follows:</strong></p><ul><li>A lack of attention is placed on essential design and documentation.</li><li>Because agile development approaches focus on real-time communication, new users sometimes lack the documentation they require to get started. They necessitate a significant time commitment from users and are labour demanding since developers must fully complete each feature for user approval throughout each iteration.</li><li>Long-term planning is lacking and thus is best suited to small development teams.</li></ul><p>Despite the aforementioned disadvantages, the Agile Model is not completely dead. Small teams with short-term goals can continue to adopt this paradigm, while larger teams with long-term goals cannot. DevOps is the somewhat updated version of the Agile Model. DevOps extends the pre-existing Agile Model.</p><blockquote>“DevOps is basically a collection of cultural concepts, methods, and technologies that help in boosting a team’s capacity to provide software and services at a quick speed while maintaining customer satisfaction.”</blockquote><blockquote>“DevOps fundamentally pulls together two huge siloed teams to enable faster software releases.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*QTgcmdzxRxIt42Xc_SOFHA.png" /></figure><p><strong>How does DevOps work?</strong></p><p>Development and operations teams are no longer “silos” under a DevOps architecture. These two teams are sometimes combined into a single team in which the engineers work across the full application lifecycle, from development and testing to deployment and operations, and build a diverse set of skills that are not confined to a particular role.</p><p>Quality assurance and security teams may become more closely linked with development and operations in various DevOps models, as well as throughout the application lifecycle. When everyone in a DevOps team is focused on security, this is referred to as DevSecOps.</p><p>These teams employ strategies to automate activities that were previously manual and time-consuming. They employ a technological stack and tools that enable them to operate and grow apps in a timely and dependable manner. These technologies also assist engineers in autonomously completing activities (for example, deploying code or providing infrastructure) that would ordinarily require assistance from other teams, which enhances a team’s velocity even more.</p><p>When a problem emerges, developers in a DevOps culture do not respond with “It worked on my computer.” Changes implemented in production are minor and reversible. Furthermore, the entire team is aware of the changes, which considerably simplifies incident management.</p><p>Another question is, “What distinguishes DevOps from Agile?” In certain circumstances, DevOps is not superior to the Agile Model; in others, it may be superior; and in still others, both DevOps and Agile may be used.</p><p><strong>Here Are Some Differences Between DevOps and Agile:</strong></p><ul><li>DevOps’ primary purpose is automation. It focuses on the premise of optimizing efficiency during software deployment, whereas Agile does not primarily focus on automation, though it can be useful in specific situations.</li><li>The Agile methodology focuses on software development, whereas DevOps focuses on providing end-to-end business solutions that are supplied at a rapid pace.</li><li>Agile emphasizes cross-functional team collaboration and the use of iterative releases. DevOps is concerned with bringing together the Development and Operations teams in a continuous development process.</li><li>Agile focuses on embracing mid-project changes. DevOps is concerned with the entire software engineering process, which includes continuous development and testing.</li></ul><p><strong>What Exactly is the Goal of DevOps?</strong></p><p>Increase the value you provide to your clients and create a sense of mutual respect among teams and employees.</p><p><strong>What are the Advantages of Employing the DevOps Methodology?</strong></p><ul><li>It provides speedier deployments, a more frequent supply of updates, and customer-satisfying features.</li><li>Product quality will significantly improve as a consequence of effective coordination between formerly isolated departments (Development and Operations) and periodic analysis of customer input to discover potential areas for improvement.</li><li>By automating monotonous processes, more opportunity for creativity is created.</li><li>Problems are handled at a rapid pace, with quick and steady solutions to troublesome mistakes discovered during the SDLC solved using dependable procedures.</li><li>DevOps, when used properly, may assist in reducing the administration and production expenses of a company’s functional units or departments.</li></ul><p>There are various advantages to using the DevOps Model or methodology. Of course, this article cannot cover everything.</p><p><strong>What is the connection between DevOps and CI/CD?</strong></p><p>CI/CD is a critical component of DevOps and any contemporary software development methodology. Through built-in automation, testing, and collaboration, a purpose-built CI/CD platform may maximize development time by raising an organization’s productivity, increasing efficiency, and optimizing workflows.</p><p>As applications get more complicated, the advantages of CI/CD can assist in reducing development complexity. Adopting additional DevOps techniques, such as moving security to the left and building tighter feedback loops, aids in breaking down development silos, scaling safely, and getting the most out of CI/CD.</p><p>The objective of Lean is to provide value to the customer while continually improving the ability to provide value by eliminating waste.</p><p><strong>DevOps can be supplemented with Lean concepts such as:</strong></p><ul><li>Getting rid of garbage, such as Knowledge Physical barriers and too complicated reports are instances of waste generated by the flow of knowledge, which is caused by disturbing the absorption of knowledge. Over-processing waste entails doing more work than is required or desired. Over-engineering software or generating excessively extensive design specs are examples of how this might be avoided.</li><li>Focus on customer value.</li><li>Eliminate the number of persons who are overburdened. Continuous, collaborative learning.</li></ul><p><strong>Thank you so much for taking the time to read this!</strong></p><p><strong>Please leave a remark if you have any comments on the subject — I am always eager to learn and grow!</strong></p><p><strong>I can imagine how useful this post has been; please give a few claps below to show your support for the author!</strong></p><p><strong>The author may be reached via </strong><a href="https://twitter.com/kaytheog"><strong>Twitter</strong></a><strong> and </strong><a href="http://sege.timz12@gmail.com/"><strong>email.</strong></a></p><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce0971477756" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/a-high-level-overview-of-devops-ce0971477756">A High-Level Overview of DevOps</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Version Control Part 2: Introduction to Git and Hands-on Practice]]></title>
            <link>https://faun.pub/version-control-part-2-introduction-to-git-and-hands-on-practice-52acc1592e90?source=rss-9f413947a814------2</link>
            <guid isPermaLink="false">https://medium.com/p/52acc1592e90</guid>
            <dc:creator><![CDATA[Saka-Aiyedun Segun]]></dc:creator>
            <pubDate>Sat, 23 Apr 2022 21:52:27 GMT</pubDate>
            <atom:updated>2022-05-08T21:14:36.894Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a7NfJLMlc3K-57zZ" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>According to statistics, Git is the most extensively used version control system in the world today. Git is used for version management in a large number of software projects. Many developers call it a lifesaver.</p><p>We will be using Git, a Distributed Version Control System for this hands-on experiment. Other programs that are similar to <strong>Git</strong> and serve the same goal exist, but Git is the most popular and commonly used.</p><p><strong>what is Git?</strong></p><p>Wikipedia defined<strong> Git </strong>as a software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. <strong>Git</strong> is a free and open-source Distributed Version Control System software used in managing and keeping track of files. so if you don’t know what Version Control means here is a <a href="https://faun.pub/version-control-part-1-basics-b27668d261ba">link</a> to it.</p><p><strong>why is Git Needed?.</strong></p><p>In actual life, many developers are frequently working on a project at the same time. A version control system, such as <strong>Git</strong>, is essential to guarantee that there are no code conflicts among developers. Furthermore, the requirements for such efforts are always evolving. As a consequence, engineers can revert to a prior version of the code using a version control system. Several projects operating concurrently may use the same codebase at times. In this case, <strong>Git’s</strong> branching notion is crucial.</p><p><strong>let&#39;s get started with our hands-on practice</strong></p><ol><li><strong>Set-up Instructions</strong></li></ol><p>To install git on your local machines as they would differ, here’s a <a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">link</a> to the steps involved.</p><p>We will be utilizing a Linux system for this hands-on experiment. Don’t worry, Windows and Mac users: the commands we’ll use in this hands-on lab to interact with git are relatively ubiquitous. Git was initially intended to run in a command-line environment similar to that of a Unix system. Git Bash is the program that makes it function on Windows.</p><p>so, after installing your git, open the terminal and type this</p><pre>git --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H6GSgZdoxUZnHxsV1O6mWA.jpeg" /><figcaption>Git installation verified</figcaption></figure><p>1.1<strong> Git Configuration</strong></p><p>Run the following commands to set the user name and email address. You must do this because when you begin making changes in Git, Git will want to know who is making those changes so that it can keep track of them.</p><pre>git config --global user.name yourname <br>git comfig --global user.email your@email.com </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*UbWrGfEe6Iik4vzv2Ifu9w.png" /><figcaption>configuring git and verification of configuration</figcaption></figure><p><strong>2. Creating a Directory and a Txt File (Text File) in The Directory</strong></p><pre>mkdir &lt;name of directory &gt;<br>ls<br>cd &lt;name of directory&gt;<br>touch kaytheog.txt<br>ls</pre><p>As a result, if you run this command, you will create a directory using mkdir (make a directory). ls stands for list, and it is used to determine whether or not a directory has been created and also list the content inside a specific directory. The command cd &gt;name of directory &gt;changes the current directory to the newly created directory. Touch kaythe.txt will result in the creation of a new txt (text file) in the directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*x3yp52RjUoUZfbK4r3JDXA.png" /></figure><p><strong>3. Creating a Repository</strong></p><p>It’s critical to understand the concept of a repository when working with Git. A Git repository is a storage location for a Git-managed project. To begin monitoring your project with Git, open your terminal program, navigate to the project’s main folder, and then run the following command:</p><pre>git init</pre><p>This command generates a hidden.git directory for your Git-created project, where Git stores all internal tracking data for the current repository.</p><p><strong>3.1 Checking Status</strong></p><pre>git status</pre><p>This is how you’ll find out what’s going on with your repository right now. When working with Git, this is a common command. It tells us which files have been modified and which are being tracked. As you can see, the kaythe.txt file is red, which indicates that we have not staged it (or started tracking the file)</p><p><strong>4. Staging Area and Committing</strong></p><p><strong>Staging area:</strong></p><p>We need to add files to a staging area in order to keep track of them and manage them effectively in git.</p><p>This feature allows programmers or developers to choose which files are to be committed.</p><p><strong>Commit:</strong> This is how to add a file to the Git local repository. The files cannot be added to the local repository if they have not been staged. A commit is a snapshot of the file at a specific time that we save to our repository’s commit history.</p><p><strong>4.1 Staging Files</strong></p><p>With the following command, we can add a specific file to the staging area:</p><pre>git add &lt;name of file you want to stage&gt;</pre><p>if you have created multiple files, to stage these multiple files, you will do this</p><pre>git add kaythe.txt kaythe1.txt kaythe2.txt </pre><p>However, if you don’t want to deal with the stress of staging multiple files by typing their names, you will do this.</p><pre>git add .</pre><p>this command will stage all the files in the repository</p><p><strong>4.2 commit</strong></p><p>We use the following command to commit the files from the staging area:</p><pre>git commit -m &quot;commit message&quot;</pre><p><em>The commit message is a brief description of the changes you’re committing to the repository.</em></p><p>now you can run the status command again to verify that the files have been committed</p><p>After running all these commands you have successfully made a commit in your project!.</p><p><strong>4.3 Commit History</strong></p><p>In order to display the commits that have been made so far we perform this command:</p><pre>git log --oneline</pre><p>The log shows the author, date and time of each commit and also the commit message. As you can see in the image above the text “HEAD -&gt; master” simply means we have been committing to the master branch. By default, this is what occurs.</p><p><strong>5. Branches</strong></p><p><strong>what is a branch?</strong></p><p>A branch in Git is analogous to a tree branch. A tree branch is analogously linked to the core section of the tree known as the trunk. While branches grow and fall off, the trunk stays compact and is the only portion of the tree that can be said to be alive and standing. Similarly, with Git, a branch is a technique to continue creating and coding a new feature or update to the program while avoiding impacting the main body of the project.</p><p><strong>Why do we need it ?.</strong></p><p>Git branches come in handy in a variety of situations over the course of a project’s development. Branches generate a new path of development that is distinct from or separated from the primary stable master branch. There are several benefits to doing so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*bsW82ODUGV9gROm_.png" /><figcaption>Image from <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fwww.javatpoint.com%2Fgit-branch&amp;psig=AOvVaw3PSfntzUn4a0pFguZkQH-7&amp;ust=1631294913712000&amp;source=images&amp;cd=vfe&amp;ved=0CA0Q3YkBahcKEwjwkcyntfLyAhUAAAAAHQAAAAAQAw">javatpoint.com</a></figcaption></figure><p><strong>5.1 Creating a Branch</strong></p><pre>git branch &lt;name of branch&gt;</pre><p>The newly generated branch will be a reference to the present state of your repository.</p><p>It’s a good idea to set up a development branch where you may work on refining your code, introducing new experimental features, and other similar tasks. You can merge these new features to the master branch after developing and testing them to ensure they are bug-free and usable.</p><p>5.2 <strong>Changing Branches</strong></p><pre>git branch -a </pre><p>The above command will all the created branches in the repository</p><pre>git checkout &lt;name of branch created&gt;</pre><p>The above command will change take you into the newly created branch</p><p>5.3. <strong>Merging branches</strong></p><p>This is the final piece of our puzzle.</p><p>Assume you’ve generated a new branch apart from your project’s master branch that you’d want to work on. After you’ve thoroughly implemented and tested a new feature in your code, you’ll want to merge those changes into your project’s stable branch (which is usually the default master branch).</p><p>So, how do we go about doing that? It’s simple. You may use the following command to merge modifications from a separate branch into your current branch</p><pre>git merge &lt;name of created branch&gt;</pre><p>To confirm that the merge has been done successfully, we run the following command:</p><pre>git log --oneline</pre><p>5.4. Deleting branches</p><p>To delete a branch, you can run the git branch command with the -d flag.</p><pre>git branch &lt;branch name&gt;</pre><p>so below we are going to delete a create a branch and then delete it</p><pre>git branch &lt;name of branch to be deleted &gt;<br>git checkout &lt;name of branch to be deleted&gt;<br>git branch -a <br>git branch -d &lt;name of branch to be deleted&gt;<br>git branch -a</pre><p>6 . Conclusion</p><p>When working with complex code, you may run into a &quot;merge conflict&quot; problem. As you continue to use Git, resolving merge conflicts will become less of a chore.</p><p>Our hands-on lab has come to an end. You would now have a little understanding on how to stage files, commit files, create branches, merge branches, check the repository’s status, and view logs. The post that follows will walk you through the remote git repository. Keep an eye out for updates!<br>So that brings us to the end of this post; there’s a lot more to Git that we haven’t covered. Of course, this is only a high-level overview of Git and how it works. Visit the following websites to learn more about Git:</p><ul><li>Git official documentation: <a href="https://git-scm.com/doc">https://git-scm.com/doc</a></li><li>The free Pro Git book: <a href="https://git-scm.com/book/en/v2">https://git-scm.com/book/en/v2</a></li><li>Learn about GitHub: <a href="https://guides.github.com/">https://guides.github.com/</a></li></ul><h3>Thank you for taking the time to read this</h3><p>You can reach me on <a href="https://twitter.com/sakaaiyedun">Twitter</a> if you want to discuss</p><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52acc1592e90" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/version-control-part-2-introduction-to-git-and-hands-on-practice-52acc1592e90">Version Control Part 2: Introduction to Git and Hands-on Practice</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[High Availability and Scalability in AWS with Elastic Load Balancers and ASG]]></title>
            <link>https://faun.pub/high-availability-and-scalability-in-aws-with-elastic-load-balancers-and-asg-cd4be64415a4?source=rss-9f413947a814------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd4be64415a4</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws-certification]]></category>
            <dc:creator><![CDATA[Saka-Aiyedun Segun]]></dc:creator>
            <pubDate>Mon, 14 Mar 2022 23:06:41 GMT</pubDate>
            <atom:updated>2022-05-23T18:46:00.663Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kmxjxJBwV63Es9DB" /><figcaption>Photo by <a href="https://unsplash.com/@miracleday?utm_source=medium&amp;utm_medium=referral">Elena Mozhvilo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When building on AWS it is very important to build a very scalable and highly available infrastructure. A successful production environment requires systems that are always available, with minimal if any planned outages and that can be scaled quickly and easily as business requirements change. so in this article, we will discuss availability and scalability in AWS with <strong>” Load Balancers and Auto Scaling Groups”</strong></p><p><strong>what is Scalability</strong></p><blockquote>Scalability means that application or systems can handle greater loader by adapting</blockquote><p>There are two kinds of scalability:</p><ul><li>Vertical scaling.</li><li>Horizontal scaling.</li></ul><p><strong>Vertical Scaling</strong></p><p>This entails expanding the instance’s size. Consider a school bus. Assume you had a 30-seater school bus for 30 kids at the start of a school term, but 10 extra students were added to your bus route throughout the term, bringing the total number of students to 40. Vertical scaling in this context means obtaining a larger vehicle with 50 or 60 seats. In AWS terminology, this implies that while an application is operating on a t2.micro instance, that application scaling vertically means running now on a t2.large.</p><ul><li>Vertical scaling is very common for a non distributed system, such as a database.</li><li>There is usually a limit to Vertically scaling which is always the hardware limit</li></ul><p><strong>Horizontal Scaling</strong></p><p>Elasticity is another term for horizontal scaling. This entails multiplying the number of instances or systems for your application. So, let’s return to the school bus scenario. In that sense, horizontal scaling entails acquiring a second 30-seater bus to accommodate the kids. when you have horizontal scaling this implies you have a distributed system.</p><ul><li>The use of horizontal scaling is very common for web applications and modern applications. note that not every application can be a distributed system</li></ul><p>Now that we understand what scalability is we must note that high availability is different from Scalability but they are linked but different.</p><p><strong>High Availability</strong></p><p>This is sometimes associated with horizontal scaling, though not necessarily. This signifies that your application or systems are running in at least two data centres ( two available Zones). The purpose of high availability is to secure an application in the event of a data centre failure, which means that even if a data centre fails, the program continues to execute.</p><p><strong>Elastic Load Balancing (ELB)</strong></p><p>Elastic Load Balancing is critical for designing a cloud architecture, but before we get into that, we must first understand load balancing. What exactly is load balancing?</p><p><strong>Load Balancing</strong></p><p>This refers to the effective distribution of incoming network traffic among a set of backend computers, commonly referred to as a server farm or server pool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*BB4wHUV5XrS1GgYz8WKtqQ.jpeg" /></figure><p>why do we use load balancers in AWS?</p><ul><li>separate public traffic from private traffic.</li><li>Spread load across multiple downstream instances.</li><li>provide SSL termination (HTTPS) for your websites.</li><li>Enforce stickiness with cookies.</li><li>High availability across zones.</li><li>Expose a single point of access (DNS) to your application.</li><li>Seamlessly handle failure of downstream instances.</li></ul><p>now that we understand what load balancing is all about let&#39;s now discuss what is <strong>ELB</strong>?.</p><p><strong>ELASTIC LOAD BALANCING</strong></p><p>Elastic Load Balancing automatically distributes your incoming traffic over numerous targets in one or more Availability Zones, such as EC2 instances, containers, and IP addresses. It checks the health of its registered targets and sends traffic only to those that are in good condition. Elastic Load Balancing adjusts your load balancer in response to variations in incoming traffic over time. It can scale to the vast majority of workloads automatically.</p><p>So, you may be asking, why do we want to use an ELB from Amazon and EC2 Load Balancer?</p><ul><li>An ELB (EC2 Load Balancer) is managed load balancer: AWS guarantees that it will be working and AWS will take care of upgrades, maintenance, and high availability. So using a managed AWS load balancer is the way to go, but it cost less to set up your load balancer but it will be a lot more effort on your end.</li></ul><p><strong>Health Checks in Elastic Load Balancers</strong></p><p>health checks are crucial for load balancers. They enable the load balancer to know if instances it forwards the traffic to are available to reply to requests</p><ul><li>The health checks are done at the port and a route</li><li>if the response is not 200(OK ), then the instance is unhealthy</li></ul><p>AWS has 3 kinds of managed Load Balancers</p><ul><li>Classic Load Balancer(v1 -old generation)-2009: supports, HTTP,HTTPS, and TCP traffic</li><li>Application Load Balancer (v2 — newer generation)- 2016: supports, HTTP, HTTPS and WebSocket.</li><li>Network Load Balancers(v2 — newer generation ) -2017: supports TCP, TLS and UDP</li></ul><p>overall it is recommended to use the newer generations load balancers as they provide more features</p><p>Note: you can set up internal(private) ELB, which means they cannot be accessed over the public web and external (public) ELB, which means your users can access it over the internet. For example your website.</p><p><strong>ASG( Auto Scaling Groups)</strong></p><p>In real-life, the load on whatever application or website you are running on an EC2 instance can change and they will have different loads so the more popular you are going to be and the more loads you are going to have. In the cloud, you can create and get rid of severs very quickly, and so there is one thing the ASG does very well is scale-out, which means adding EC2 instances to match an increased load and also scale-in which means removing the EC2 instances</p><p>The goal of an Auto Scaling Group(ASG) is to :</p><ul><li>Scale-out (add EC2 instances) to match the increased load</li><li>scale-in (remove EC2 instances) to match the decreased load</li><li>Ensure we have a minimum and a maximum number of machines running</li><li>Ability to automatically register new instances</li></ul><p><strong>Auto Scaling Group in AWS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*mHzBaI0fCMrPYvmM3bFWbQ.jpeg" /></figure><p>In the image above, the minimum size for the image above is the number of instances you will have for sure running into this ASG. The actual size is the number of instances running at the previous moment in your ASG. The maximum size is how many instances can be added for a scale-Out.</p><p>Auto Scaling Group in AWS with Load Balancer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*nsIOIipvhBvyoUY5XnC_MA.jpeg" /></figure><p>Now, here is how our ASG and web Traffic go straight through it and we have our ASG at the bottom and basically, the load balancer will know directly how to connect to these ASG instances. so it will direct the traffic to these instances, but if ASG scales out, then the load balancers will also register its targets. so load balancers and ASG works hand in hand in AWS.</p><p>ASGs have the following attributes</p><ul><li>A lunch configuration</li><li>you can define the Min size, max size and initial capacity</li><li>scaling policies, this means what will trigger the scale-out or trigger to scale in</li></ul><p><strong>Auto Scaling Group — Scaling Policies</strong></p><p>scaling policies is the core of our ASG and are the most important thing to know so there are three types</p><ul><li><strong>Target Tracking Scaling</strong></li></ul><p>They are the most simple and easy to use and set up. For example, you can say you want the average ASG CPU to stay at around 40%, so if you are over that means it will provision more instances to serve your ASG and if you’re under it will start doing scaling in, so it will start terminating your instances so your average CPU usage will now be around 40%.</p><ul><li><strong>Simple and Step Scaling</strong></li></ul><p>It is called simple but it is not that simple. but you will set up something called a CloudWatch alarm and the CloudWatch alarm will be an alarm that will be triggered when for example when your average CPU of your entire provisioned instances goes over 70%, then add 3–4 instances. you will set up a second CloudWatch alarm to be triggered if the average CPU usage is below 40% then remove 1–2 instances, with this method, you have a bit more control of the instances being added and removed.</p><ul><li><strong>Scheduled Actions</strong></li></ul><p>This is for in case you know in advance some patterns of your application, you will anticipate a scaling based on known usage patterns. So for example, if you know that at every 18:00 on Mondays, you will need to increase the min capacity to 15 instances because you already that you will net absolutely at least 15 instances.</p><p>Scalability and High availability can be achieved in AWS with Load Balancers and ASGS when integrated correctly but this article is just a beginner guide to start it.</p><p>Thanks for taking the time to read my blog ❤️. Reach out to me on <a href="https://www.twitter.com/kaytheog">Twitter</a></p><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd4be64415a4" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/high-availability-and-scalability-in-aws-with-elastic-load-balancers-and-asg-cd4be64415a4">High Availability and Scalability in AWS with Elastic Load Balancers and ASG</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS IAM: User Guide and Its Best Practices]]></title>
            <link>https://faun.pub/aws-iam-user-guide-and-its-best-practices-46e2d0723d2f?source=rss-9f413947a814------2</link>
            <guid isPermaLink="false">https://medium.com/p/46e2d0723d2f</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-iam]]></category>
            <dc:creator><![CDATA[Saka-Aiyedun Segun]]></dc:creator>
            <pubDate>Mon, 28 Feb 2022 15:32:01 GMT</pubDate>
            <atom:updated>2022-03-04T05:31:25.196Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*axduMDMyJV4HA1Ku" /><figcaption>Photo by <a href="https://unsplash.com/@scottwebb?utm_source=medium&amp;utm_medium=referral">Scott Webb</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>AWS IAM</strong>(Identity Access Management ) is a web service that allows you to regulate access to AWS services in a secure manner. IAM is used to manage who is authenticated (signed in) and allowed (has permissions) to access resources. When you initially create an AWS account, you start with a single sign-in identity that has full access to all AWS services and resources in the account. This identity is known as the AWS account root user, and it may be accessed by logging in with the email address and password that you used to establish the account.</p><p>IAM gives you the flexibility to configure access based on whatever use purpose of creating or joining AWS wherever for operational or security needs</p><p><strong>AWS Account Root User</strong></p><p>when you first create an AWS account you begin with an identity known as the root user. This also means the owner of the account that was created. All AWS accounts have a root user (only one).</p><h4>When to use a Root user account</h4><ul><li>For longer resource IDs, change the Amazon EC2 option. Changing this setting as the account’s root user has an impact on all users and roles. Changing it as an IAM user or IAM role has no effect on anybody else.</li><li>Change your AWS support plan.</li><li>View your account billing information. View Billing tax invoices.</li><li>Close an AWS account.</li><li>Restoring IAM user permissions. If an IAM user accidentally revokes their own permissions, you can sign in as the root user to edit policies and restore those permissions.</li><li>In the terminal, look for your AWS account’s canonical user ID. Only while logged in as the AWS account root user can you access your canonical user ID in the AWS Management Console. As an IAM user, you may view your canonical user ID using the AWS API or AWS CLI.</li></ul><p><strong>Best Practices</strong></p><ul><li>Do not use the root user for the everyday tasks instead use the root user to create an IAM user and assign it permission to create other users</li><li>Don’t use the root user account except for AWS account setup</li><li>A physical user should have one AWS user account</li><li>Assign users to groups and assign permissions to the groups</li><li>Activate MFA on your root account.</li><li>Disable/delete your root access keys.</li><li>Rotate credentials.</li><li>Do not share root user credentials.</li></ul><p>you may be thinking about what could go wrong if these best practices are not followed. Your account can get compromised, the intruder may expose all your data, Intruder may even delete all your data and resources and this can easily lead to lawsuits and heavy financial loss.</p><p><strong>IAM Users</strong></p><p>They are created by the root user. IAM users are not separate accounts; they are users within your account. Each user can have its own password for access to the AWS Management Console. You can also create an individual access key for each user so that the user can make programmatic requests to work with resources in your account.</p><p><strong>Best Practices</strong></p><ul><li>Create individual IAM users for each person with the need to access AWS resources with your account</li></ul><p><strong>IAM Permission and Policies</strong></p><p>This is a document that allows or grant permission to AWS services or resources. IAM users are service identities. When you create an IAM user, they will have no access to your account unless you grant them authorization. Permissions are granted to a user by developing an identity-based policy, which is a policy that is associated with the user or a group to which the user belongs.</p><p><strong>Best Practice</strong></p><ul><li>Follow the security principles of “least privilege” when granting permissions. This means do not assign more permission than needed to a particular resource or user.</li></ul><p><strong>IAM Groups</strong></p><p>This is a collection of IAM users. when you assign an IAM policy to a group, all users in the group are granted permissions specified by the policy. In that case, individual users still have their own credentials, but all the users in a group have the permissions that are attached to the group.</p><p>It makes it easier to assign the policies to users of the same job instead of creating policy and adding it one by one to users, this is made easier with creating groups.</p><p><strong>IAM Roles</strong></p><p>This is an identity you can assume to gain temporary access to permission, before an IAM user can assume an IAM role they must be granted permission to switch to the role. when someone assumes an IAM role they abandon all previous permissions. Roles can also be given to AWS resources to access specific information.</p><p><strong>Best Practices</strong></p><ul><li>IAM roles are ideal for situations in which access to services or resources needs to be granted “TEMPERORLY” instead of long-term.</li><li>Use roles for applications that run on Amazon EC2 instances. Applications that run on an Amazon EC2 instance need credentials in order to access other AWS services.</li></ul><p><strong>Configure a strong password policy for your users</strong></p><p>To Generate a specific password policy that requires users to create strong passwords and rotate their passwords on a regular basis if you enable them to reset their own passwords. You may set a custom password policy for your account on the Account Settings page of the IAM console. You upgrade from the AWS default password policy to establish password restrictions such as minimum length, nonalphabetic character requirements, and how frequently the password must be changed.</p><p><strong>Multi- Factor Authentications(MFA)</strong></p><p>It is recommended to use multi-factor authentication (MFA) for all users in your account for further protection. MFA provides consumers with a device that responds to an authentication challenge. To complete the sign-in procedure, both the user’s credentials and the device-generated answer are necessary.</p><p><strong>AWS Organisation</strong></p><p>suppose that your company has multiple AWS accounts. you can use AWS organisation to consolidate and manage AWS accounts in a central location. in AWS organisation you centrally control permissions for the account in your organisation by using services controls policies (SCPS)</p><p>(SCPS) enables you to place restrictions on the AWS services, resources and individual API actions that users or roles in each account can access</p><p><strong>Accessing IAM</strong></p><p>You can work with AWS Identity and Access Management in any of the following ways.</p><ol><li><strong>AWS Management Console</strong></li></ol><p>This<strong> </strong>is a web-based interface for accessing and managing AWS services. you can quickly access recently used services and search for other services by keywords or acronyms.</p><p><strong>2. Command-line Interface (CLI)</strong></p><p>CLI enables you to control multiple AWS services directly from the command line with one tool. Using the command line can be faster and more convenient than the console. The command-line tools are also useful if you want to build scripts that perform AWS tasks.</p><p><strong>3. AWS SDKs (software development kits)</strong></p><p>AWS provides SDKs (software development kits), which include libraries and example code for a variety of programming languages and platforms (Java, Python, Ruby, .NET, iOS, Android, etc.). The SDKs make it easy to create programmatic access to IAM and AWS. For example, SDKs automatically handle responsibilities like cryptographically signing requests, resolving failures, and retrying requests.</p><p><strong>4. IAM HTTPS API</strong></p><p>You may programmatically access IAM and AWS by utilizing the IAM HTTPS API, which allows you to send HTTPS queries straight to the service. You must add code to digitally sign requests using your credentials when using the HTTPS API.</p><p>there are many resources that you can access through the IAM like the AWS budget, to create the minimum and maximum budget allowed to be spent within a specific period. AWS Artifact, to provide on-demand access to was security and compliance report and selected online agreement. Access keys are created and generated through the console.</p><p>there are more resources that can be accessed but this article is just for people looking to get a quick start in AWS IAM.</p><p>Thanks for taking the time to read my blog ❤️. Reach out to me on<a href="https://twitter.com/sakaaiyedun"> Twitter</a></p><h3>Please do leave a comment if you have any thoughts on the topic — I am open to learning and continuous improvement!</h3><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46e2d0723d2f" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/aws-iam-user-guide-and-its-best-practices-46e2d0723d2f">AWS IAM: User Guide and Its Best Practices</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Flask Restful “CRUD” mock Youtube API with Python]]></title>
            <link>https://faun.pub/creating-flask-restful-crud-mock-youtube-api-with-python-844e04ab5937?source=rss-9f413947a814------2</link>
            <guid isPermaLink="false">https://medium.com/p/844e04ab5937</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Saka-Aiyedun Segun]]></dc:creator>
            <pubDate>Mon, 31 Jan 2022 12:00:13 GMT</pubDate>
            <atom:updated>2022-04-30T20:47:38.944Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Tb1vUxh3Q_8zLx_J" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Before we get into the coding portion of these hands-on exercises, let’s define an API.</p><p><strong>Prerequisites For This Hands-on Lab</strong></p><ul><li>Foundational knowledge of python</li><li>Desire to learn</li></ul><p><strong>what is API</strong></p><blockquote>API, or Application Programming Interface, provides a means for various programs to communicate with one another. We can access, process, and transfer data — values from other apps — via APIs.</blockquote><h4>What is a REST API?</h4><blockquote>REST stands for <strong>R</strong>epresentational <strong>S</strong>tate <strong>T</strong>ransfer which means when a client machine places a request to obtain information about resources from a server, the server machine then transfers the current state of the resource back to the client machine.</blockquote><h4>CRUD operators and HTTP methods</h4><p>The Client can transmit request data to the server in a variety of ways while utilizing an API. These are known as CRUD Operations.</p><p>Each CRUD (Create Retrieve Update Delete) operator is coupled with an HTTP method.</p><p>Let’s have a look at them now:</p><p>GET HTTP Method– Retrieves particular information from the server (for viewing purposes).<br>POST — Sends or creates new data in the server database.<br>PUT — Edits/Updates information in the database or adds it if it is not already present.<br>DELETE — Removes data from the Server Database.</p><h4>API for Developers</h4><p>What are the benefits of APIs for developers? If you want to create an application that requires a specific service, such as account authentication, you can go ahead and use Facebook’s account authentication API, link it to the application you want to create, and configure it so that Facebook’s API communicates with services in your application, so that when users want to login or create an account in your application, they can do so using their Facebook account login details.</p><p><strong>Project setup</strong></p><ol><li><strong>Create a virtual environment on cmd</strong></li></ol><pre>python3 -m venv flask_venv</pre><p>2. C<strong>reate a requirement called requirement.txt</strong></p><pre>aniso8601==8.0.0<br>click==7.1.2<br>Flask==1.1.2<br>Flask-RESTful==0.3.8<br>Flask-SQLAlchemy==2.4.3<br>itsdangerous==1.1.0<br>Jinja2==2.11.2<br>MarkupSafe==1.1.1<br>pytz==2020.1<br>six==1.15.0<br>SQLAlchemy==1.3.18<br>Werkzeug==1.0.1</pre><p>3. <strong>Now install the requirement.txt</strong></p><pre>pip install -r requirements.txt</pre><p><strong>Code:</strong></p><ol><li>now open the installed python IDE and create a python file</li></ol><pre>from flask import Flask<br>from flask_restful import Resource, Api, abort, reqparse, fields, marshal_with<br>from flask_sqlalchemy import SQLAlchemy<br><br><br>app = Flask(__name__)<br>app.config[&#39;SQLALCHEMY_DATABASE_URI&#39;] = &#39;sqlite:///database.db&#39;<br>db = SQLAlchemy(app)<br>api = Api(app)</pre><p><strong>Code description</strong></p><ul><li>In the first line of code, we are importing the modules we have installed</li><li>In the fourth line of code, we set the __name__ variable to the module name, so the value of this variable will vary depending on the Python source file in which you use it.</li><li>In the fifth line of code, we are configuring the database location</li><li>In the sixth and seventh lines of code, we are putting the apps in the API and Database</li><li>SQLAlchemy is available in the flask_sqlalchemy package.</li></ul><p>For project purposes, the SQLite database is used. Configuration key SQLALCHEMY<em>DATABASE</em>URI needs to be set and SQLAlchemy object needs to be created.</p><h3>Database model</h3><pre>class VideoModel(db.Model):<br>    id = db.Column(db.Integer, primary_key=True)<br>    name = db.Column(db.String(100), nullable=False)<br>    views = db.Column(db.Integer, nullable=False)<br>    likes = db.Column(db.Integer, nullable=False)<br>    def __repr__(self):<br>        return print(f&quot;video(name = {name}, views = {views}, likes = {likes})&quot;)</pre><h3>Code description</h3><ol><li>A database model is a Python object which inherits from SQLAlchemy.Model class. Class fields are representing the database Columns.</li></ol><h3>Initialization of Database</h3><pre>db.create_all()</pre><p>the is used to create the database it can only be done at the first time the code is being executed,if not each time the code is being executed it will override the previous ones</p><p><strong>Parsing argument</strong></p><pre>video_put_args = reqparse.RequestParser() <br>video_put_args.add_argument(&quot;name&quot;, type=str, help=&quot;name of the video is required&quot;, required = True)<br>video_put_args.add_argument(&quot;views&quot;, type=int, help=&quot;view of the video is required&quot;, required = True)<br>video_put_args.add_argument(&quot;likes&quot;, type=int, help=&quot;likes on the video is required&quot;, required = True)<br><br>video_update_args = reqparse.RequestParser()<br>video_update_args.add_argument(&quot;name&quot;, type=str, help=&quot;name of the video is required&quot;, )<br>video_update_args.add_argument(&quot;views&quot;, type=int, help=&quot;view of the video is required&quot;, )<br>video_update_args.add_argument(&quot;likes&quot;, type=int, help=&quot;likes on the video is required&quot;, )</pre><p>what the code does is that it parses through requests when and makes sure all these(L<strong>ikes, Views and Name</strong>) are made available when trying to input data or update the data inside the database.</p><p><strong>Serialization</strong></p><pre>resource_fields = {<br>    &quot;id&quot;: fields.Integer,<br>    &quot;name&quot;: fields.String,<br>    &quot;views&quot;: fields.Integer,<br>    &quot;likes&quot;: fields.Integer,<br>}</pre><p>In-class VideoModel(DB.Model) method serialize is defined. The purpose of defining this method is to easily serialize data from an Object to return it as a json file.</p><pre>class video(Resource):<br>    @marshal_with(resource_fields)<br>    def get(self, video_id):<br>        result = VideoModel.query.filter_by(id=video_id).first()<br>        if not result:<br>            abort(404, message=&quot;id not avavaible......&quot;)<br>        return result<br><br>    @marshal_with(resource_fields)<br>    def put(self, video_id):<br>        args = video_put_args.parse_args()<br>        result = VideoModel.query.filter_by(id=video_id).first()<br>        if result:<br>            abort(409, message=&quot;video id taken...&quot;)<br>        video =VideoModel(id=video_id, name=args[&quot;name&quot;], views=args[&quot;views&quot;], likes=args[&quot;likes&quot;])<br>        db.session.add(video)<br>        db.session.commit()<br>        return video, 201<br>    @marshal_with(resource_fields)<br>    def patch(self, video_id):<br>        args = video_update_args.parse_args()<br>        result = VideoModel.query.filter_by(id=video_id).first()<br>        if not result:<br>            abort(409, message=&quot;video does not exist so can not update...&quot;)<br><br>        if args[&quot;name&quot;]:<br>            result.name = args[&quot;name&quot;]<br>        if args[&quot;views&quot;]:<br>            result.views = args[&quot;views&quot;]<br>        if args[&quot;likes&quot;]:<br>            result.likes = args[&quot;likes&quot;]<br>        db.session.commit()<br>        return result<br><br>    def delete(self,video_id):<br>        abort_if_video_id_doesnt_exist(video_id)<br>        return&quot; &quot; ,204</pre><p>the video class is inherited from the resources.</p><p>when the get function is triggered by a request, it will return the provided video_id and abort if the video_id is not in the database and shows the message “id not available”</p><p>when the put function is triggered by a request, the get request will be parsed by verifying If the requirements(Likes, Views and Name ) to stored in the database are made available.</p><p>When the patch(update) function is requested the function will get the information( data )provided to the update and then update the information of the video Id provided</p><p>When the delete function is triggered with a request, the function will delete the information of the video Id provided from the database.</p><pre>api.add_resource(video, &quot;/video/&lt;int:video_id&gt;&quot;)<br>if __name__ == &quot;__main__&quot;:<br>    app.run(debug=True)<br></pre><p>If the first line of code, the application is complex, with complex URLs, Parameters: resource ( Type[Resource] ) — the class name of your resource. URLs (str) — one or more url routes to match for the resource, standard flask routing rules apply.</p><p>In the second line of code, we initialize a server, run the application and set up the debugging so we will not have to stop the server from time to time just to make changes to our code.</p><p><strong>Full code</strong></p><pre>from flask import Flask<br>from flask_restful import Api, Resource, reqparse, abort, fields, marshal_with<br>from flask_sqlalchemy import SQLAlchemy<br><br>app = Flask(__name__)<br>api = Api(app)<br>app.config[&quot;SQLALCHEMY_DATABASE_URI&quot;] = &#39;sqlite:///database.db&#39;                                                                       #args means arguments that<br>db = SQLAlchemy(app)<br><br>class VideoModel(db.Model):<br>    id = db.Column(db.Integer, primary_key=True)<br>    name = db.Column(db.String(100), nullable=False)<br>    views = db.Column(db.Integer, nullable=False)<br>    likes = db.Column(db.Integer, nullable=False)<br>    def __repr__(self):<br>        return print(f&quot;video(name = {name}, views = {views}, likes = {likes})&quot;)<br><br>video_put_args = reqparse.RequestParser() # makes sure that all the fuction or wht is defined below are met when requests  is been sent into a libabry or created<br>video_put_args.add_argument(&quot;name&quot;, type=str, help=&quot;name of the video is required&quot;, required = True)<br>video_put_args.add_argument(&quot;views&quot;, type=int, help=&quot;view of the video is required&quot;, required = True)<br>video_put_args.add_argument(&quot;likes&quot;, type=int, help=&quot;likes on the video is required&quot;, required = True)<br><br>video_update_args = reqparse.RequestParser()<br>video_update_args.add_argument(&quot;name&quot;, type=str, help=&quot;name of the video is required&quot;, )<br>video_update_args.add_argument(&quot;views&quot;, type=int, help=&quot;view of the video is required&quot;, )<br>video_update_args.add_argument(&quot;likes&quot;, type=int, help=&quot;likes on the video is required&quot;, )<br><br><br><br>resource_fields = {<br>    &quot;id&quot;: fields.Integer,<br>    &quot;name&quot;: fields.String,<br>    &quot;views&quot;: fields.Integer,<br>    &quot;likes&quot;: fields.Integer,<br>}<br><br>class video(Resource):<br>    @marshal_with(resource_fields)<br>    def get(self, video_id):<br>        result = VideoModel.query.filter_by(id=video_id).first()<br>        if not result:<br>            abort(404, message=&quot;id not avavaible......&quot;)<br>        return result<br><br>    @marshal_with(resource_fields)<br>    def put(self, video_id):<br>        args = video_put_args.parse_args()<br>        result = VideoModel.query.filter_by(id=video_id).first()<br>        if result:<br>            abort(409, message=&quot;video id taken...&quot;)<br>        video =VideoModel(id=video_id, name=args[&quot;name&quot;], views=args[&quot;views&quot;], likes=args[&quot;likes&quot;])<br>        db.session.add(video)<br>        db.session.commit()<br>        return video, 201<br>    @marshal_with(resource_fields)<br>    def patch(self, video_id):<br>        args = video_update_args.parse_args()<br>        result = VideoModel.query.filter_by(id=video_id).first()<br>        if not result:<br>            abort(409, message=&quot;video does not exist so can not update...&quot;)<br><br>        if args[&quot;name&quot;]:<br>            if __name__ == &quot;__main__&quot;:<br>                app.run(debug=True)<br>            result.name = args[&quot;name&quot;]<br>        if args[&quot;views&quot;]:<br>            result.views = args[&quot;views&quot;]<br>        if args[&quot;likes&quot;]:<br>            result.likes = args[&quot;likes&quot;]<br>        db.session.commit()<br>        return result<br><br>    def delete(self,video_id):<br>        abort_if_video_id_doesnt_exist(video_id)<br>        return&quot; &quot; ,204<br><br>api.add_resource(video, &quot;/video/&lt;int:video_id&gt;&quot;)</pre><p>so after all these, create another python file inside the same folder you created this and name it requests.</p><ol><li>Now import the requests</li></ol><pre>import requests</pre><p>2. Now create a base URL</p><pre>BASE = &quot;http://127.0.0.1:5000/&quot;</pre><p>3. Create data of the information you want to add like this</p><pre>data =[{&quot;name&quot;: &quot;segun&quot;, &quot;likes&quot;: 340000, &quot;views&quot;: 1230000},<br>       {&quot;name&quot;: &quot;how to make REST Api&quot;, &quot;likes&quot;: 4000900, &quot;views&quot;: 330000},<br>       {&quot;name&quot;: &quot;aiyedun&quot;, &quot;likes&quot;: 900000, &quot;views&quot;: 450000}]</pre><p>4. Now add it to the created database</p><pre>for i in range(len(data)):<br>    reponse = requests.put(BASE + &quot;get_video/&quot; + str(i), data[i])<br>    print(reponse.json())<br>    repsonse = requests.put(BASE + &quot;/&quot;)</pre><p>4. Now if you want to patch(update ) you can do it this way</p><pre>input()<br>reponse = requests.patch(BASE + &quot;video/2&quot;, {&quot;views&quot;:99})<br>print(reponse.json())</pre><p>5. Now to get information from the database you do it this way</p><pre>response = requests.get(BASE + &quot;video/2&quot; )<br>print(response.json())</pre><p>6. To delete information it can be done this way</p><pre>response = requests.del BASE + &quot;video/2&quot; )<br>print(response)</pre><p>so you run any of these requests depending on what you want to do</p><p>Thanks for reading 💜</p><p>You can also reach out to me on <a href="https://twitter.com/kaytheog">Twitter</a>.</p><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=844e04ab5937" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/creating-flask-restful-crud-mock-youtube-api-with-python-844e04ab5937">Creating Flask Restful “CRUD” mock Youtube API with Python</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>