<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gursimar Singh</title>
    <description>The latest articles on DEV Community by Gursimar Singh (@gursimarsm).</description>
    <link>https://dev.to/gursimarsm</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F846404%2F6168d2eb-a258-4f5e-91e0-be8df93ae7db.jpeg</url>
      <title>DEV Community: Gursimar Singh</title>
      <link>https://dev.to/gursimarsm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gursimarsm"/>
    <language>en</language>
    <item>
      <title>The Blockchain Handbook</title>
      <dc:creator>Gursimar Singh</dc:creator>
      <pubDate>Sun, 26 Mar 2023 18:54:02 +0000</pubDate>
      <link>https://dev.to/gursimarsm/the-blockchain-handbook-3kpm</link>
      <guid>https://dev.to/gursimarsm/the-blockchain-handbook-3kpm</guid>
      <description>&lt;p&gt;Blockchain is a new and exciting technology that underpins Bitcoin and other cryptocurrencies.&lt;/p&gt;

&lt;p&gt;But there are many other applications for blockchain outside the world of cryptocurrency. And that’s what you’ll learn about here.&lt;/p&gt;

&lt;p&gt;This article is going to be a divided into three parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Introduction to Blockchain&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Embracing Blockchain&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How does Blockchain work?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Introduction to Blockchain&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;In the first part, I’ll introduce you to blockchain: what it is, what it is not, and why it is attracting business interest.&lt;/p&gt;

&lt;p&gt;At the end of this part, you should be able to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The Purpose of Blockchain, and Why It Is Attracting Interest&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On a Basic Level, How Blockchain Works&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Why Blockchain Technology is Useful&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Today, many transactions require a trusted third party as a ‘go-between’. For example, users often use banks or organizations, such as PayPal or Western Union, when transferring money to each other.&lt;/p&gt;

&lt;p&gt;Such a third party is often required for trust: both parties want to be confident that they will not be cheated, and everything is above board. Sometimes it is also required because of cultural, border, or compliance issues.&lt;/p&gt;

&lt;p&gt;However, these third parties usually require a payment for their services and using these third parties can slow down the transaction. Many people would be interested in a solution that does not require such a trusted third party.&lt;/p&gt;

&lt;p&gt;Today, many financial transactions pass through some sort of central control or oversight. For example, governments control their currency: how much is produced or circulated. Similarly, governments often control financial transactions such as the purchase of gold or securities.&lt;/p&gt;

&lt;p&gt;Many people would likely be interested in a currency or solution that was not controlled by a single authority or government.&lt;/p&gt;

&lt;p&gt;There are many applications that could benefit from a database where existing data could never be updated or deleted — only added to.&lt;/p&gt;

&lt;p&gt;For example, a solution that traced an aircraft part from manufacture, through testing, and finally onto an aircraft. If existing data could never be updated, anyone using this solution would be confident that they had the correct data, and it had not been changed, corrupted, or deleted.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tEVmNpWi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gio1zii2cpjqjq4p2ie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tEVmNpWi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gio1zii2cpjqjq4p2ie.png" alt="Image description" width="828" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Blockchain is a technology that has the potential to address these issues and opportunities. But before you can find out how, you need to learn a little about what blockchain is, and what it is not.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;What is the Blockchain?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;In essence, a blockchain is a way of storing data: it’s like a database. But databases are normally centralized: the data is managed by one process or computer.&lt;/p&gt;

&lt;p&gt;Blockchain is a distributed database that is stored on many different computers in a peer-to-peer network. There is no single controlling computer or ‘boss’. This may not seem logical. But one of the most exciting features of blockchain is how it allows this to work. You will see how shortly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--adxugS3u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ue0tt6u71ebdrz1rgw8s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--adxugS3u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ue0tt6u71ebdrz1rgw8s.png" alt="Image description" width="828" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With blockchain, all data–the entire blockchain–is usually stored on all computers. Every computer, or node, communicates with others, broadcasting database changes and other information.&lt;/p&gt;

&lt;p&gt;Such a structure provides resilience and reliability advantages: there is no outage if one, or even several, nodes fail.&lt;/p&gt;

&lt;p&gt;In a regular database, any data can be changed, updated, or deleted. Blockchain is different: only new information can be added. By its design, existing information can never be updated or deleted.&lt;/p&gt;

&lt;p&gt;This may seem strange, but you will see soon how this is actually one of the key security features of blockchain.&lt;/p&gt;

&lt;p&gt;So how can a database that cannot be changed or deleted work? Blockchain is often referred to as a ledger-based system. Some call it Distributed Ledger Technology. Changes are recorded as new information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Distributed Ledger Technology:&lt;/strong&gt; A technique of storing data on many synchronized, geographically separate computers with no central controlling process. Often used in relation to blockchain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s look at an example.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose you have an application that tracks the number of widgets in a warehouse.&lt;/p&gt;

&lt;p&gt;When the first order of widgets is received, a normal database would create a new record holding the number of widgets.&lt;/p&gt;

&lt;p&gt;In Blockchain, a new record is also created, recording that 5 widgets have been received. So, you know you have 5 widgets.&lt;/p&gt;

&lt;p&gt;Suppose 1 widget is removed. In a normal database, the record could be updated with the new number of widgets: 4.&lt;/p&gt;

&lt;p&gt;In blockchain, a new record would be added, recording that 1 widget had been removed. So, you can find out that 4 widgets remain.&lt;/p&gt;

&lt;p&gt;In a regular database, the record could be deleted if all widgets were removed.&lt;/p&gt;

&lt;p&gt;In blockchain, a new entry setting the number of widgets to 0 performs a similar function.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;What Does Trustless Mean?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;The blockchain features we’ve covered so far allow the blockchain to work as a data management system without trusting any of the computers storing the blockchain.&lt;/p&gt;

&lt;p&gt;These computers can even exist on public networks with no centralized security management. For example, anyone can create a Bitcoin node and participate in running Bitcoin.&lt;/p&gt;

&lt;p&gt;Malicious users cannot change or corrupt the contents of the blockchain unless they can control updates to the blockchain. We’ll discuss this in more depth later in this tutorial.&lt;/p&gt;

&lt;p&gt;Removing the need for trusted nodes allows us to implement exciting applications over the internet without a controlling organization. These are sometimes referred to as permissionless. Bitcoin is an example of a permissionless blockchain implementation.&lt;/p&gt;

&lt;p&gt;Although blockchain applications can work with a permissionless network, many applications will not want this. They will want to retain some control over their blockchain: who can join, what they can do, and being able to verify their identity.&lt;/p&gt;

&lt;p&gt;These solutions will operate in a trusted network, with a security management system maintained by some kind of centralized authority. These are sometimes referred to as “permissioned.” Many blockchain frameworks such as Ethereum and Hyperledger are permissioned.&lt;/p&gt;

&lt;p&gt;What does Permissioned / Trusted mean?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Access limited&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Centralized security&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generally used on an intranet&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cannot be anonymous&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What does Permissionless / Trustless mean?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Anyone can join&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No centralized security&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can use internet&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maybe anonymous&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Why has blockchain become such a hot topic?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;In the past, commercial transactions have been controlled by a central, trusted authority. For example, banks, exchanges, and governments.&lt;/p&gt;

&lt;p&gt;Blockchain offers an alternative where a trusted central authority is no longer required to manage or monitor transactions, even for commercial transactions or currency. Also, boundaries and borders are no longer an issue as blockchain applications can be used over the internet.&lt;/p&gt;

&lt;p&gt;The first blockchain was proposed by an unknown computer scientist using the name Satoshi Nakamoto in a paper proposing a cryptocurrency, which is now known as Bitcoin.&lt;/p&gt;

&lt;p&gt;Since then many different applications, including various cryptocurrencies, have been created based on this technology.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o4JMroRE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/09jdn60igw6nwwv4yk9x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o4JMroRE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/09jdn60igw6nwwv4yk9x.png" alt="Image description" width="828" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Blockchain is a decentralized, distributed data management system. Data can only be added to a blockchain. It cannot be changed or removed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blockchain offers excellent reliability and resilience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blockchain can operate over a public untrusted network, and maintain integrity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blockchain applications can perform functions such as commercial transactions without requiring a trusted third party or ‘boss.’ This is one of the major benefits of blockchain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blockchain was created in 2008, and first implemented for the cryptocurrency Bitcoin.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;How Does Blockchain Work?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Blockchain is a very new technology. As such, there are few rules, standards, or best practices to follow when using blockchain. This is exciting, as new applications are developed to use blockchain technology in different ways.&lt;/p&gt;

&lt;p&gt;So, the best way to see how blockchain works is to look at current examples. The best known implementation of blockchain is the cryptocurrency Bitcoin.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Clients and nodes:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Bitcoin users are connected over the internet, and are divided into two groups, clients and nodes. Clients are the users of Bitcoin. Nodes are the computers where the Bitcoin blockchain resides, and which participate in the execution of Bitcoin.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; A node can also be a client.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Wallet software:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Suppose a user, Jane, wants to transfer one Bitcoin to another user, Brian.&lt;/p&gt;

&lt;p&gt;Jane will have a Bitcoin client program executing on her computer. This is called a wallet, and there are several to choose from, including Bither, Electrum, and Mycelium.&lt;/p&gt;

&lt;p&gt;Jane will have previously used this wallet to open a Bitcoin account and obtain bitcoins. The wallet software records the bitcoins that Jane has in her possession.&lt;/p&gt;

&lt;p&gt;Note that the wallet is not used by the blockchain network to store data. Records in the blockchain are used to determine how many bitcoins can be spent by Jane.&lt;/p&gt;

&lt;p&gt;To transfer a Bitcoin, Jane will use the wallet software, specifying the amount — one Bitcoin, and the address of the recipient — Brian.&lt;/p&gt;

&lt;p&gt;Every Bitcoin user has a unique address that is created when they create their Bitcoin account. So, Brian will also have a wallet, and will have opened a Bitcoin account.&lt;/p&gt;

&lt;p&gt;Jane will send the transfer request. The wallet software will send this request to one or more Bitcoin nodes. The wallet will also sign this transaction with a private cryptographic key that only Jane’s wallet knows.&lt;/p&gt;

&lt;p&gt;The transaction will be transmitted to all other nodes. Each node will validate the transaction. This validation will include checking the signature of the transaction with a public key that Jane’s wallet transmits to everyone. Anyone can validate a signature, but only Jane can sign a transaction.&lt;/p&gt;

&lt;p&gt;Every node will combine this transaction with others into a block. Periodically, around every 10 minutes or so, every node will try to add this block of transactions to the blockchain.&lt;/p&gt;

&lt;p&gt;Blockchain processing will select one node to add newly blocked transactions to the blockchain. How this node is selected can vary between different blockchain technologies. However, this is usually a different node every time.&lt;/p&gt;

&lt;p&gt;This winning node will notify all other nodes in the blockchain that it is adding a block of new transactions to the blockchain.&lt;/p&gt;

&lt;p&gt;Every node will add this new block to its local copy of the blockchain.&lt;/p&gt;

&lt;p&gt;When Jane’s transaction has been added to the blockchain, it is confirmed. Brian’s wallet is notified that he has received one Bitcoin, and Jane’s wallet is notified that she has sent one Bitcoin.&lt;/p&gt;

&lt;p&gt;Now we will look at the security of blockchain. All transactions are signed using a private key that only Jane knows. So, like car keys, providing Jane keeps this private key a secret, others cannot perform transactions in her name. No one can transfer bitcoins from her account.&lt;/p&gt;

&lt;p&gt;Many nodes validate every transaction. A single node cannot fake transactions, or pass a transaction that is not valid.&lt;/p&gt;

&lt;p&gt;Existing blocks of transactions cannot be altered. A node cannot change or corrupt existing transaction data.&lt;/p&gt;

&lt;p&gt;Jane’s transaction has been completed securely, without trusting all of the nodes that perform Bitcoin processing. There is no central computer or controlling process — all processing is distributed among the nodes that perform Bitcoin processing.&lt;/p&gt;

&lt;p&gt;Anyone in Bitcoin can create a node and start Bitcoin processing over the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A transfer request is sent to the blockchain nodes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The transaction is validated by the nodes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once validated, the transaction will be combined with others to form a block&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After a period of time, each node attempts to add the block to the blockchain&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once successful, every node adds the new block to its copy of the blockchain&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The receiver is notified of the successful transfer&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We have seen one example which is bitcoin. There are many more such examples to explore.&lt;/p&gt;

&lt;p&gt;In the next part, we’ll explore blockchain’s effect on the world and how blockchain can be implemented.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Embracing Blockchain&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;As we’ve been learning so far, blockchain is a new and exciting technology that underpins the Bitcoin digital currency ecosystem and other cryptocurrencies.&lt;/p&gt;

&lt;p&gt;Many organizations are only now just beginning to recognize blockchain’s potential and are starting to identify how they can benefit from this technology.&lt;/p&gt;

&lt;p&gt;In the previous part, we learnt the basics of blockchain with the example of bitcoin. Now, we’ll explore blockchain’s effect on the world and how blockchain can be implemented.&lt;/p&gt;

&lt;p&gt;We’ve just discussed how blockchain offers an alternative to the past where commercial transactions were performed using a trusted third party: a bank, a government, or a broker.&lt;/p&gt;

&lt;p&gt;You also saw that blockchain technology can work over the internet, bypassing boundary and border issues. It also can be used for applications that benefit from data that cannot be removed or updated.&lt;/p&gt;

&lt;p&gt;Many of the early blockchain applications were cryptocurrencies: online currencies that are not controlled by any country, bank, or similar entity. Bitcoin was the first cryptocurrency, but others include Ripple (XRP), Peercoin, Litecoin, and Ether, which is used by Ethereum.&lt;/p&gt;

&lt;p&gt;Cryptocurrencies provide an alternative way for people and organizations to pay for goods and services: one that is not controlled by any central government, bank, or organization.&lt;/p&gt;

&lt;p&gt;Cryptocurrencies have also demonstrated that a blockchain application using trustless computers over the internet can provide a secure commercial framework in the real world.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;What is a Smart Contract?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Another area of interest in blockchain applications are smart contracts. Not a contract in the normal sense, smart contracts are a set of business rules that are stored and implemented on a computer system. They allow transactions to be automatically enacted without needing a third party, such as a lawyer or bank.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Smart Contract:&lt;/strong&gt; A set of business rules stored in a computer system that is executed automatically by that computer system based on a set of logic or clauses. Can allow contracts to be agreed and enacted without a middleman such as a lawyer.&lt;/p&gt;

&lt;p&gt;Let’s explore with an example:&lt;/p&gt;

&lt;p&gt;Suppose a person, Charlotte, is about to rent an apartment for two weeks from a second person: Jackson. Suppose they use a blockchain application that has been created to manage apartment rentals as a smart contract.&lt;/p&gt;

&lt;p&gt;The terms of the rental agreement are coded in the smart contract: rent, start date and other details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--axKX_nUD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0gtuzrsw34kfarxc50u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--axKX_nUD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0gtuzrsw34kfarxc50u.png" alt="Image description" width="216" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Charlotte pays the rent in a cryptocurrency such as Bitcoin. Jackson provides the code to access the apartment in the smart contract.&lt;/p&gt;

&lt;p&gt;At a defined date and time, the smart contract automatically verifies that all terms of the contract have been met: rent has been received, and apartment entry code provided.&lt;/p&gt;

&lt;p&gt;Once all terms are met, the smart contract automatically forwards the rent payment to Jackson, and the entry code to Charlotte.&lt;/p&gt;

&lt;p&gt;If any terms of the contract are not met — for example, the rent has not been received — the contract is not enacted. No entry code is forwarded to Charlotte, no rent is forwarded to Jackson.&lt;/p&gt;

&lt;p&gt;The contract is stored on many computers, and cannot be deleted or changed. Only new information can be added. Jackson and Charlotte are confident of the integrity of the information in the contract, and that it can be trusted as a valid document.&lt;/p&gt;

&lt;p&gt;This is all done without a trusted central authority, such as a rental agency, managing the contract.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Applications of the Blockchain&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Blockchain is still a relatively new technology, but there are some interesting applications that have already been implemented across many industries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bitspark:&lt;/strong&gt; Bitspark is a remittance platform. It allows people to transfer money to each other. There are several similar applications including Abra and Veem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IBM Food Trust:&lt;/strong&gt; IBM Food Trust is a blockchain-based solution to track and manage food products as they pass from source to customer. This allows retailers, wholesalers, and suppliers to improve efficiency, trace origins of products that may not match requirements, and reduce food loss and waste.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Boeing:&lt;/strong&gt; Boeing has used blockchain technologies with the Internet of Things (IoT) for tracking and maintenance of aircraft parts. This allows them to predict maintenance events, optimize production operations, and extend the lifecycle of components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Arcade City:&lt;/strong&gt; Arcade City is a peer-to-peer ridesharing application that uses blockchain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Storj:&lt;/strong&gt; Storj is a cloud storage solution. Users can rent out unused space on their local disks, or rent cloud based storage using these local disks.&lt;/p&gt;

&lt;p&gt;The two major features of blockchain — that it is distributed, and that data cannot be updated — provides many interesting opportunities for businesses. In many ways, blockchain technology can be used to decentralize and record almost any transaction or movement.&lt;/p&gt;

&lt;p&gt;A couple more interesting examples include,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publishing music:&lt;/strong&gt; In 2015, the startup uj0 Music released the song Tiny Human by singer-songwriter Imogen Heap using a Proof of Concept blockchain-based distribution system. Using this system, users immediately downloaded and paid for the song. Royalties were sent using blockchain immediately to the songwriter and collaborators. This showed how music could be released without the current music industry labels and publishers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Human trafficking:&lt;/strong&gt; One-fifth of the world’s population does not have an official document to prove their identity. Without legal identification, these people are at risk of human trafficking.&lt;/p&gt;

&lt;p&gt;The United Nations is exploring ways that blockchain solutions can resolve this. Blockchain solutions are also being developed for online identity management and verification.&lt;/p&gt;

&lt;p&gt;There is no doubt that blockchain technology has generated more than just interest. Most large IT organizations, including IBM, have positioned blockchain as a strategic technology. Many large organizations are actively pursuing blockchain solutions and there are many startups working with blockchain.&lt;/p&gt;

&lt;p&gt;Blockchain has captured the interest of many organizations, from small startups to large financial institutions.&lt;/p&gt;

&lt;p&gt;Many claim that blockchain technology is about to revolutionize the way business is done, while others are more skeptical. But most technology commentators agree that blockchain is a valid and valuable technology that is here to stay.&lt;/p&gt;

&lt;p&gt;Here are some comments from a couple big players:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Like any emerging technology, the potential implications of blockchain seem both vast and at the same time not fully comprehensible. Many in the popular press have speculated about blockchain-driven notions as diverse as the development of borderless global currencies to the creation of fraud-proof voting tools to help eliminate electoral corruption and fraud. We may not yet even fully comprehend blockchain’s “killer app.” For corporate finance professionals, however, the potential implications of blockchain are more tangible. — J P Morgan Chase&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Even though the initial hype surrounding blockchain, and the prolonged blockchain “winter” that followed, are beginning to settle, this is no time to rest on our laurels. IT leaders must prepare for the inevitable blockchain “spring” on the horizon, bringing with it core-enabling technologies and significant opportunities for digital business. — Gartner&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Large organization projects:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Forbes has recently created the Forbes Blockchain 50: a list of 50 companies in the US with minimum revenues or valuations of one billion USD actively exploring blockchain.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Samsung:&lt;/strong&gt; Samsung is using a blockchain-based solution to overhaul how its battery manufacturing subsidiary manages contracts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Nestle:&lt;/strong&gt; Swiss based Nestle have commenced working with IBM Food Trust to manage and trace the lifecycle of food products.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;In summary so far,&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Many of the early blockchain applications have been cryptocurrencies such as Bitcoin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Smart contracts are another interesting feature of blockchain that is being investigated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Although there is disagreement as to how blockchain will be implemented, and its long-term effect on the computing industry, most agree that blockchain is an important and valuable technology that is here to stay.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Existing blockchain applications include shared storage, cryptocurrencies, and payment processing systems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some examples of potential future blockchain applications include land registration, identity management, and tracking of physical items such as diamonds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Large organizations are actively investigating and investing in blockchain.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;How to Get Started with Blockchain&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;There are many blockchain frameworks and tools designed to allow organizations to create their own blockchain solutions without starting from scratch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ethereum:&lt;/strong&gt; One of the first blockchain frameworks created in 2014. It’s an open-source framework including the cryptocurrency Ether. It’s currently one of the most popular frameworks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hyperledger:&lt;/strong&gt; An umbrella project of open source blockchains. It was started in December 2015 by the Linux Foundation, with input from companies such as IBM and Intel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quorum:&lt;/strong&gt; An open source private blockchain framework released by JPMorgan Chase &amp;amp; Co.&lt;/p&gt;

&lt;p&gt;In this article, we will learn more in detail about Hyperledger.&lt;/p&gt;

&lt;p&gt;Hyperledger Fabric is a framework for private blockchains. It is not designed to operate as an open, permissionless blockchain like Bitcoin.&lt;/p&gt;

&lt;p&gt;To achieve this, all Hyperledger Fabric actors — including client applications, administrators, processes within the blockchain, and more — must have a valid digital identity: an X.509 digital certificate. One or more external Membership Service Providers (MSP) will create, manage, and authenticate these certificates. Hyperledger Fabric provides instructions on what is required from MSPs.&lt;/p&gt;

&lt;p&gt;Each actor has a set of permissions defined: what they can and cannot do. The digital identity and permissions together are called principals. Hyperledger Fabric includes functionality to use and manage principals.&lt;/p&gt;

&lt;p&gt;In addition to identity and permissions, Hyperledger Fabric provides rules on how to create a blockchain These rules are backed by code, APIs, and documentation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How to identify a user&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to setup permissions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to setup a network&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to create a smart contract&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to create and submit a transaction&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to respond to a transaction&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How a client connects to the blockchain&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to handle errors&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a key function of Hyperledger Fabric is the creation and operation of smart contracts. Hyperledger Fabric provides a set of rules for creating smart contracts.&lt;/p&gt;

&lt;p&gt;Smart contracts are programs written in a supported chaincode.&lt;/p&gt;

&lt;p&gt;Hyperledger Fabric provides libraries and APIs that can be called to define the smart contract.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.blog.chaincode.example&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.ArrayList&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.List&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.contract.Context&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.contract.ContractInterface&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.contract.annotation.Contact&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.contract.annotation.Contract&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.contract.annotation.Default&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.contract.annotation.Info&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.contract.annotation.License&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.contract.annotation.Transaction&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.shim.ChaincodeException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.shim.ChaincodeStub&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.shim.ledger.KeyValue&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hyperledger.fabric.shim.ledger.QueryResultsIterator&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;Example&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;ContractInterface&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="o"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hyperledger Fabric is designed for enterprise-level blockchains that handle a large number of transactions that must be processed quickly.&lt;/p&gt;

&lt;p&gt;Unlike other frameworks, such as Ethereum, Hyperledger Fabric does not provide its own cryptocurrency.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;What is Hyperledger Fabric comprised of?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Hyperledger Fabric provides libraries, APIs, and documentation that can be used to implement a blockchain solution. These resources provide services including commands, RESTful interfaces, and performance metrics.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Hyperledger Fabric provides libraries that are installed onto each computer: clients and nodes.These can be on UNIX, MacOS, or Windows machines.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hyperledger Fabric provides a suite of APIs to assist in creating and running a private blockchain.These APIs are included in software development kits (SDKs) for programming languages includingGO, Node.js, Java, and Python.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hyperledger Fabric provides samples to allow users to learn about Hyperledger Fabric, and to get started in implementing it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hyperledger Fabric provides documentation and tutorials for administrators, operators, and application developers.These explain the rules that Hyperledger Fabric has for implementing a blockchain solution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hyperledger Fabric provides line commands that can be used to manage blockchain nodes and Hyperledger Fabric resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hyperledger Fabric executables provide an HTTP RESTful operations API. This is designed to be used for operations: not administrators or users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hyperledger Fabric provides performance data that can be processed using Prometheus monitoring software.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Blockchain frameworks often include additional features not common in traditional blockchain solutions.&lt;/p&gt;

&lt;p&gt;Hyperledger Fabric provides services allowing private, confidential transactions processed by the blockchain, to be hidden from some nodes, using private channels.&lt;/p&gt;

&lt;p&gt;Hyperledger is an umbrella project of the Linux Foundation. It includes several blockchain-related projects, including five blockchain frameworks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NsnIcdur--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vuowa25zeuixdsyufyad.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NsnIcdur--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vuowa25zeuixdsyufyad.png" alt="Image description" width="828" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The features of each blockchain framework vary: some may have features that others do not.&lt;/p&gt;

&lt;p&gt;There are tools available, including some within Hyperledger, that can be used with these blockchain frameworks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benchmark:&lt;/strong&gt; Tools such as Hyperledger Caliper allow blockchains to be compared. These tools measure the performance of a blockchain implementation using pre-defined test cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Operation and management:&lt;/strong&gt; Tools such as Hyperledger Cello and Truffe provide features to manage the lifecycle of a blockchain: creation, start, stop, removal. These often include monitoring, logging, health, and analytics features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View and Query:&lt;/strong&gt; Sometimes administrators must view individual blocks in a blockchain, and their associated transactions, network information, and more. Tools such as Hyperledger Explorer provide graphic interfaces to do this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance:&lt;/strong&gt; As networks get larger, blockchain solutions slow down. Some tools provide features to improve the performance of blockchain frameworks or solutions. For example, the Raiden Network attempts to improve the performance Of Ethereum blockchain solutions by avoiding consensus. This is done by performing some transactions outside of the blockchain.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Blockchains in the Cloud&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;There are some cloud-based blockchain frameworks available. Some of these are part of large cloud offerings, while others are standalone blockchain frameworks.&lt;/p&gt;

&lt;p&gt;Some Blockchain as a service (BaaS) providers are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Microsoft Azure&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Oracle Blockchain Platform&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Alibaba Cloud&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;IBM Blockchain Platform&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Amazon Web Services&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Summary so far:&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;There are currently no official standards or best practices for blockchain. But some are being developed by standards organizations such as ISO and W3C.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Although it is possible to build a blockchain solution from scratch, many will choose to use an existing framework such as Hyperledger Fabric or Ethereum.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are other blockchain-related tools to do things such as manage blockchain solutions, improve their performance, view individual blocks and related resources, or benchmark their performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are cloud-based blockchain frameworks: Blockchain-as-a-Service (BaaS).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are many blockchain books and courses available. Open-source blockchain frameworks also provide documentation, and their source code can be viewed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the next and final part, we’ll be looking at what hashes and blocks are, and how they work in a blockchain. Also, we’ll discuss how multiple computers work together to store and manage a blockchain.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;How Does Blockchain Work?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;So far, I’ve introduced you to blockchain and described what it is, what it does, who uses it, and why it is fast becoming an important component in today’s business world.&lt;/p&gt;

&lt;p&gt;This is the third and final part of the handbook where we’ll dive more into the technical details of how blockchain works.&lt;/p&gt;

&lt;p&gt;Blockchain is an exciting technology that has the potential to revolutionize banking, electronic transactions, electronic contracts, and much more. It relies on technology to ensure that messages cannot be tampered with, are correct, and are sent by authorized people.&lt;/p&gt;

&lt;p&gt;In this part, you will explore the actual technology in more detail.&lt;/p&gt;

&lt;p&gt;By the end, you should be able to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What Hashes and Blocks Are, and How They Work in a Blockchain&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How Multiple Computers Work Together to Store and Manage a Blockchain&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;What are Hashes?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;An essential tool used by blockchain is the hash. A hash is a string of numbers and letters that can uniquely identify some text or data. So, in many ways, it is like a fingerprint.&lt;/p&gt;

&lt;p&gt;Hashes are sometimes called hash values, hash codes, digests, or simply hashes. There are several hashing algorithms, or ways of creating hashes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hash:&lt;/strong&gt; An algorithm used to map data of variable size to a set of data of fixed size. Often used in computer applications for lookup tables, and in cryptography. SHA-256 is one of the algorithms.&lt;/p&gt;

&lt;p&gt;Hashes used by blockchain are not simply data generated from other data. They have some distinctive properties that are very useful for blockchain.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Hash Properties:&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Same length:&lt;/strong&gt; A hash is the same length — regardless of the length of the original text. Even if hashing the entire Library of Congress, the hash will be the same length.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Different:&lt;/strong&gt; Any change in the original data, no matter how small, must produce a completely different hash.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unique:&lt;/strong&gt; Like a fingerprint, a hash should be unique. This is not possible in practice, but hashing algorithms make it almost impossible for a collision — a case where a program will encounter the same hash for different data. The probability of a SHA-256 collision is 4.3 * 10–60: almost impossible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cannot get original data:&lt;/strong&gt; It should not be possible for the original data to be reproduced from a hash value.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;What are Blocks?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;In blockchain, information is stored in blocks. Each block includes a hash of the block’s data or contents.&lt;/p&gt;

&lt;p&gt;So, a receiver can confirm that the contents of the block are valid by recreating the hash from the block contents, and comparing it with the hash included in the block.&lt;/p&gt;

&lt;p&gt;This is the first step in blockchain security.&lt;/p&gt;

&lt;p&gt;A blockchain is exactly that: a chain of blocks, each with a hash of the block’s contents included.&lt;/p&gt;

&lt;p&gt;This chain provides a second layer of security.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A block is the basic entity in a blockchain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The number of blocks in a blockchain can be very large.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Every block in a chain includes the hash of the previous block.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The previous block’s hash is included in the data used when creating the hash for a block.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the data in a block is modified by an unauthorized person, the block’s hash will no longer match it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The unauthorized person could recreate the hash in the original block, however, this would not match the hash in the next block.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The unauthorized person could try to update the hash in the next block, but then the next block’s hash would not match.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Even if the unauthorized person updated the second block’s hash, it would not match the hash in the third.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Therefore, if an unauthorized person updated a block, they would also have to update every later block in the blockchain.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because no block is ever updated or deleted from a blockchain, blockchains are often referred to as ledgers. This ledger system can be used as a database system.&lt;/p&gt;

&lt;p&gt;For example, a banking solution could use a blockchain to record deposits and withdrawals from a bank account.&lt;/p&gt;

&lt;p&gt;When referring to a block, blockchain solutions usually use the hash of the block. An alternative is to use the block height, sometimes called the block number.&lt;/p&gt;

&lt;p&gt;Blocks in a blockchain can store anything required by the blockchain solution. For example, the cryptocurrency Bitcoin stores multiple transactions in a block.&lt;/p&gt;

&lt;p&gt;For an unauthorized person to change data in a block, they would need to recreate the block holding the data, and every later block in the blockchain.&lt;/p&gt;

&lt;p&gt;Blockchain solutions prevent this from happening by storing the blockchain on many different computers at the same time. So now an unauthorized person must change blocks on every computer storing the blockchain. Blockchain is a distributed solution, not a centralized one.&lt;/p&gt;

&lt;p&gt;Many blockchain solutions use hundreds, or even thousands of different computers (referred to as nodes) to store the full blockchain. Each computer stores the entire blockchain. Because each node stores the entire blockchain, each must update its own copy of the blockchain every time a new block is added.&lt;/p&gt;

&lt;p&gt;The nodes must work together, following the same rules. For example, when a block is added to the blockchain, all nodes must add the same block at the same height in the blockchain.&lt;/p&gt;

&lt;p&gt;Blockchain implementations will all have a system or method that determines which node will add the next block to the blockchain. This prevents more than one node from adding a block at the same time.&lt;/p&gt;

&lt;p&gt;One way of doing this is to slow down the rate at which blocks are added to a blockchain. For example, currently a new block is added to Bitcoin every 10 minutes, and Ethereum every 15 seconds.&lt;/p&gt;

&lt;p&gt;To see how many computers work together in a blockchain, let’s look at an example: Bitcoin.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;When a Bitcoin node wants to submit a transaction, it transmits that transaction to all nodes in the network.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Full Bitcoin nodes are nodes that hold a copy of the blockchain and are prepared to update it as necessary.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Every full node validates the transaction. If the transaction is valid, every full node adds the transaction to a transaction pool, or memory pool. This is a group of ready transactions that have not been added to the blockchain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Every full node then adds transactions from the transaction pool into a candidate block, and attempts to add this block to the blockchain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All full nodes are trying to add the next block to the blockchain, but only one can be successful. So, all full nodes compete to add the next block — it is a race to create the next block.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The node that wins the race adds the block to the end of its local copy of the blockchain. Transactions in this new block are removed from the transaction pool.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All other full nodes are notified that there is a winner. Each adds this new block to their local copy of the blockchain. All transactions in this new block are removed from all local transaction pools.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This race between Bitcoin nodes prevents two nodes adding a block at the same time to the end of the blockchain. How blockchain determines who will add the next block is called consensus. Consensus also prevents the same transaction from being in two different blocks in the blockchain.&lt;/p&gt;

&lt;p&gt;Bitcoin nodes compete using a system of consensus called proof of work.&lt;/p&gt;

&lt;p&gt;With proof of work, every block includes a value that is not used for anything other than the proof of work validation. This is called a nonce, and is set to zero when a block is created.&lt;/p&gt;

&lt;p&gt;Before a block can be submitted, the hash of the block must meet restrictions set by the network. Normally, this is a target value that the hash must be below.&lt;/p&gt;

&lt;p&gt;If the hash is not below the target, the computer must try again. It does this by increasing the nonce by 1, recalculating the hash, and trying again. This is repeated until a hash is found that is less than the target. This process is called &lt;strong&gt;mining.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The computer has provided proof that it has done some work. Now the block will be added to the blockchain in all computers in the network.&lt;/p&gt;

&lt;p&gt;Blockchain networks deliberately make it difficult for a computer to find a hash that meets the target. So, it can take a computer several minutes, or even hours or days, before a suitable hash is found.&lt;/p&gt;

&lt;p&gt;Because it takes so long, it is almost impossible that two computers will attempt to add a block to a blockchain at exactly the same time. Computers in the blockchain network simply accept the blocks in the order they are received.&lt;/p&gt;

&lt;p&gt;Using a nonce is not the only way proof of work can be used. The blockchain network can set any puzzle to be solved by a computer, with the aim of slowing down the rate at which a computer can add blocks.&lt;/p&gt;

&lt;p&gt;A major criticism of proof of work is that it wastes computer processing power — forcing computers to do millions of calculations for no reason except to slow the rate that blocks are added.&lt;/p&gt;

&lt;p&gt;There are alternative consensus algorithms. One is proof of stake. This method is used by the Peercoin cryptocurrency, and is being developed for Ethereum.&lt;/p&gt;

&lt;p&gt;Every node has a share or stake in the network. Some will have more, others less. For example, cryptocurrencies could base this on coins unspent for a period of time: the more unspent coins, the larger the stake.&lt;/p&gt;

&lt;p&gt;The computer submits a block to the network. In this block, the computer provides a key to identify itself, and its stake in the network. The network will have a mechanism whereby the next computer that can add a block is determined by all computers in the network.&lt;/p&gt;

&lt;p&gt;This mechanism will determine how often blocks can be added. This mechanism will also determine the next node that can add a block. The bigger the stake, the more likely a computer can add a block.&lt;/p&gt;

&lt;p&gt;A computer will try to add a block. If unsuccessful, it can try again. If it is this computer’s turn, the block is added.&lt;/p&gt;

&lt;p&gt;Proof of work and proof of stake are consensus solutions for trustless blockchain networks: networks where there is no central control, and anyone can join. Bitcoin and Ethereum are two examples of trustless networks.&lt;/p&gt;

&lt;p&gt;Achieving security using a network of trustless computers is one of the major strengths of blockchain.&lt;/p&gt;

&lt;p&gt;Resolving consensus for internal, or trusted, blockchain networks is much easier. For example, a simple solution could be to give each computer a turn, one after the other — like a round-robin.&lt;/p&gt;

&lt;p&gt;In practice, such a round-robin consensus is not practical. However, other examples such as Raft are possible in a permissioned blockchain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does Raft consensus work?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Each node begins as a candidate: eligible to become the leader.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each node votes for one node to become the leader.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One node wins and becomes the leader. All other nodes become followers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The leader adds all blocks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the leader shuts down or fails, a new vote is taken to select a new leader.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;We’ve finally come to the end of this handbook. I hope this has helped you understand and get started with blockchain.&lt;/p&gt;

&lt;p&gt;I’m always open to suggestions and discussions on &lt;a href="https://www.linkedin.com/in/gursimarsm"&gt;LinkedIn&lt;/a&gt;. Hit me up with direct messages.&lt;/p&gt;

&lt;p&gt;If you’ve enjoyed my writing and want to keep me motivated, consider leaving starts on &lt;a href="https://github.com/gursimarsm"&gt;GitHub&lt;/a&gt; and endorse me for relevant skills on &lt;a href="https://www.linkedin.com/in/gursimarsm"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Till the next one, stay safe and keep learning.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>crypto</category>
      <category>smartcontract</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Locked Out of Your RHEL 9 System? Here's How to Reset Your Root Password and Regain Access in Minutes</title>
      <dc:creator>Gursimar Singh</dc:creator>
      <pubDate>Sun, 19 Mar 2023 20:19:50 +0000</pubDate>
      <link>https://dev.to/gursimarsm/locked-out-of-your-rhel-9-system-heres-how-to-reset-your-root-password-and-regain-access-in-minutes-4e3n</link>
      <guid>https://dev.to/gursimarsm/locked-out-of-your-rhel-9-system-heres-how-to-reset-your-root-password-and-regain-access-in-minutes-4e3n</guid>
      <description>&lt;p&gt;The root password is an essential aspect of any Linux system. It provides administrative privileges to the user, allowing them to modify system files, install software, and perform other critical operations. As such, it is essential to keep the root password secure and to remember it at all times. However, in some cases, users may forget their root password, or the password may be changed without their knowledge, leading to a locked-out system.&lt;/p&gt;

&lt;p&gt;Fortunately, RHEL 9 provides a method for resetting the root password, even if you do not have the original password.&lt;/p&gt;

&lt;p&gt;In this, we will be looking at the procedure to reset the password for the root user in a hands-on manner, with all the illustrations and explanations for the same. We will also look at how it differs from RHEL 8.&lt;/p&gt;

&lt;h2&gt;
  
  
  We'll cover the following
&lt;/h2&gt;

&lt;p&gt;●  Preface&lt;/p&gt;

&lt;p&gt;●  How to reset it?&lt;/p&gt;

&lt;p&gt;●  The procedure&lt;/p&gt;

&lt;p&gt;●  Explanation&lt;/p&gt;

&lt;p&gt;●  Conclusion&lt;/p&gt;

&lt;h2&gt;
  
  
  Preface
&lt;/h2&gt;

&lt;p&gt;Let's take a look at an overview of the most important phases that are taking place in the Boot Procedure right now. That brings us to firmware, the first step in the process. The software that runs on your computer is called firmware. Additionally, the firmware will be the source from which the boot device is allotted. The hardware that allows your computer to start up is called the hard drive. And on the device that boots, you will find something called a boot sector, and then immediately after that, you will find the GRUB program, which is the most essential component. The bootloader that is being used is called GRUB. Additionally, the GRUB boot loader is responsible for loading the Linux kernel into memory. In addition, the Linux kernel is always accompanied by a companion program known as the initramfs or the initrd. Both of these terms may be found in the terminology; as they refer to the same thing, you can choose whichever one you like. It is at this point that everything will begin to take place, and here is where systemd will come into play. Everything is managed by Systemd. Nothing else matters. You will also discover an early stage in systemd; for the sake of simplicity, we will refer to this step as the early stage. After the early stage, you will arrive at your services. And after these services have been loaded, or even better, while they are being loaded, a shell will be dropped, and you will be able to log in to that shell once it has been dropped. Why is it necessary for you to be aware of this information in order to do problem-solving tasks?&lt;/p&gt;

&lt;h2&gt;
  
  
  How to reset it?
&lt;/h2&gt;

&lt;p&gt;This comes in handy in the event that you need to access a server for which you do not know the root password. I am going to walk you through the process now.&lt;/p&gt;

&lt;h3&gt;
  
  
  The procedure
&lt;/h3&gt;

&lt;p&gt;So how exactly does that function? So, let's go over the steps, shall we?&lt;/p&gt;

&lt;p&gt;1.         Enter the Grub menu while booting&lt;/p&gt;

&lt;p&gt;2.         Find the line that loads the Linux kernel and add init=/bin/bash to the end of the line&lt;/p&gt;

&lt;p&gt;3.         mount -o remount,rw /&lt;/p&gt;

&lt;p&gt;4.         passwd root&lt;/p&gt;

&lt;p&gt;5.         touch /.autorelabel&lt;/p&gt;

&lt;p&gt;6.         exec /usr/lib/systemd/systemd&lt;/p&gt;

&lt;h3&gt;
  
  
  Explanation
&lt;/h3&gt;

&lt;p&gt;You will need to visit the Grub boot menu while the operating system is booting up in order to troubleshoot the forgotten root password.&lt;/p&gt;

&lt;p&gt;Now that we've reached this point, let's have a look at the Grub boot menu. Simply pressing the letter “e” will bring about the desired modification.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Nl3eXAMk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecdgt7ahb8kybozczyvr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Nl3eXAMk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecdgt7ahb8kybozczyvr.png" alt="Image description" width="880" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, scroll down until you reach the end of the line, where it says Linux. This line is spread over three lines, and you need to be right here, just after the "lv=rhel/swap" part of the line. Next, you will enter "init=/bin/bash"  which will really ensure that you start with bash as the init process rather than systemd. This will be done by preventing systemd from running when the command is executed.&lt;/p&gt;

&lt;p&gt;Please take note that there has been a modification to the method. If you were using REHL 8, you would use rd.break at the end of the line, but doing so will prompt you for the root password. Therefore, there is no use in doing it. init=/bin/bash is the command that you should be using. That will provide access to the system, despite the fact that the root file system is read-only.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GIO3Pc-d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gp7luqyv91dulxr06gvn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GIO3Pc-d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gp7luqyv91dulxr06gvn.png" alt="Image description" width="880" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then press the Control key and the X key simultaneously, to begin with this particular choice; you will then be placed in an empty shell.&lt;/p&gt;

&lt;p&gt;The result of it, as you can see, is that you are dropped into a root shell. Let's see whether you're able to put pen to paper now. I can already tell you that you won't be able to do it. This is due to the fact that the root filesystem is only accessible in read-only mode during this very early stage of the booting process. That being the case, we need to ensure that it can be read and written.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9Xx1mqCz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d04u28bzsobjsdpn34fx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9Xx1mqCz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d04u28bzsobjsdpn34fx.png" alt="Image description" width="880" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can make that read-writeable by using the command,&lt;/p&gt;

&lt;p&gt;  # mount -o remount, rw /&lt;/p&gt;

&lt;p&gt;Now to reset the root password you can just use the command,&lt;/p&gt;

&lt;p&gt;  # passwd root&lt;/p&gt;

&lt;p&gt;Ignore any messages that say there was a problem with the fields or the dictionary check. What you do need to see is that all authentication tokens are updated successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RUS39UYg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cnz1kcaqsoeoror7dnki.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RUS39UYg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cnz1kcaqsoeoror7dnki.png" alt="Image description" width="880" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next thing that we have to do is make sure that SELinux is working properly. This is a very crucial step to perform since it will ensure that SELinux is aware of all that you have accomplished up to this point. As a result of SELinux, the next thing that you do is execute the touch command in order to produce an empty file with the name autorelabel. This is going to ensure that all of the security labels in SELinux are going to be successfully restored.&lt;/p&gt;

&lt;p&gt;# touch /.autorelabel&lt;/p&gt;

&lt;p&gt;After that, you will need to make use of the exec command, "exec /usr/lib/systemd/systemd". It is clear that numerous processes associated with systemd are already running, and the file /usr/lib/systemd/systemd is the one you require. And in case you are wondering, can't I just exit? Well, the thing is no. This is the only method to get you into a running system because, if you leave from /bin/bash, your system will crash since it doesn't grasp that it doesn't have an interface anymore. Because of this, exiting from /bin/bash is the only way to get into a running system. The systemd process is going to take the place of the one that is now running as a result of this change.&lt;/p&gt;

&lt;p&gt;To proceed with the standard boot routine, you need to start the systemd service. Normally, whenever you write something into the shell, it will split off into its own process. This indicates that the new process will begin its life as a child process of the environment in which it is currently running. However, systemd has made it clear that it does not wish to be anyone's kid in any way. Systemd has to act as the parent process for all of the other processes. Because of this, systemd must be started in a rather unconventional manner by using the exec command: exec. " # exec/usr/lib/systemd/systemd". This will cause your currently running process to be discarded, and systemd will be installed in its stead in order to ensure that the boot sequence may proceed correctly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pU32zRVG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fg6ps2v2159tfercl6fm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pU32zRVG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fg6ps2v2159tfercl6fm.png" alt="Image description" width="880" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Right now, the program selinux-autorelabel should be visible in the exact centre of the screen. That constitutes a significant portion. Now, selinux-autolabel is going to require a little bit of time. It shouldn't take more than a couple of minutes to finish up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VLV7-bry--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6qxlg3k3l9m60jzd88d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VLV7-bry--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6qxlg3k3l9m60jzd88d.png" alt="Image description" width="880" height="195"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the process is taking too long, you may just restart your virtual machine. Let's give it some time. As you can see, nothing went wrong, and everything turned out nicely. Well, did it? The system is now starting up, and although it may take a minute or two before it is fully operational again, a login prompt will be on the screen in a very short amount of time.&lt;/p&gt;

&lt;p&gt;Just now, we have successfully changed the root password. It goes without saying that we still need to conduct tests. The non-root user is unaffected by the root password in any way. Additionally, the non-root user has sudo rights because they are a user with administrative access. Because "su -" prompts the user for the root password, we will not be using sudo this time in order to test; rather, we will be using su. This is due to the fact that sudo prompts for the password. In addition to that, I have access at the root level.&lt;/p&gt;

&lt;p&gt;So mission accomplished. This is how we can change the root password.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, forgetting or losing the root password in RHEL 9 can be a frustrating experience, but it doesn't have to be a catastrophic one. By following the steps outlined in this article, you can reset your forgotten root password and regain access to your system in just a few minutes. Remember to keep your root password secure and choose a strong and unique password to prevent any future access issues. With this comprehensive guide at your disposal, you can be certain that you'll be able to master RHEL 9 root password reset and maintain the security of your system.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>security</category>
      <category>devops</category>
    </item>
    <item>
      <title>Pervasive Encryption (Cryptography)</title>
      <dc:creator>Gursimar Singh</dc:creator>
      <pubDate>Mon, 23 Jan 2023 04:26:55 +0000</pubDate>
      <link>https://dev.to/gursimarsm/pervasive-encryption-cryptography-4pid</link>
      <guid>https://dev.to/gursimarsm/pervasive-encryption-cryptography-4pid</guid>
      <description>&lt;p&gt;In 2017, there were a number of documented data breaches, in which sensitive or confidential information was made available to the general public. According to the findings of the 2017 Cost of Data Breach Study conducted by the Ponemon Institute, there are approximately 58 data records that are stolen every second, with the average cost per record being $141 USD.&lt;/p&gt;

&lt;p&gt;Encryption of data is a critical component of any comprehensive defense strategy against data breaches. Encryption of data is becoming an essential need for several compliance requirements, such as the Payment Card Industry Data Security Standard (PCI DSS) and the General Data Protection Regulation of the European Union (GDPR).&lt;/p&gt;

&lt;p&gt;In the past, a popular strategy consisted of encrypting only the data that needed to be encrypted and only in the locations where it needed to be encrypted.&lt;/p&gt;

&lt;p&gt;Therefore, you are only permitted to encrypt client data when it is being sent from system to system. Alternatively, individual files or databases containing financial information.&lt;/p&gt;

&lt;p&gt;There is also an option known as ubiquitous encryption, which can be used instead of selective encryption. This implies that all of the data is encrypted both while it is stored and while it is being transferred. This includes data that is stored on physical media such as discs and tapes, as well as data that is stored in files and databases and data that is being sent across network connections.&lt;/p&gt;

&lt;p&gt;The use of pervasive encryption is one solution that has been suggested as a method to improve compliance and data security.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why use Pervasive Encryption?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;There are a lot of benefits that come along with using pervasive encryption. For example, given that every piece of data is encrypted, there is no possibility that any critical information may be overlooked inadvertently and then either saved or transferred without encryption.&lt;/p&gt;

&lt;p&gt;Another significant advantage of pervasive encryption is that compliance verification is simplified by the fact that the technology encrypts all of the data. Finally, malicious users cannot target encrypted data knowing that it contains sensitive data because the data is hidden from them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yWQoy48_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtbtfdf2vf54cqvkrszu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yWQoy48_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtbtfdf2vf54cqvkrszu.png" alt="Image description" width="875" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;If pervasive encryption is so good, why isn’t everyone using it?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In most cases, this is due to the fact that it is either difficult or prohibitively expensive. To encrypt different types of data, such as files, databases, physical discs and tapes, and network connections, for instance, different encryption algorithms are used by different types of systems. These things need to be configured independently, and frequently in a manner that is unique to each resource.&lt;/p&gt;

&lt;p&gt;The performance of encrypted data can suffer, and it can lead to an increase in the amount of CPU time that is needed. Modifications to the application’s source code can be necessary for certain circumstances.&lt;/p&gt;

&lt;p&gt;In conclusion, the majority of websites do not believe that it is necessary to encrypt everything.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fZDYm46_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c3xq67cdr893ez5qijx9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fZDYm46_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c3xq67cdr893ez5qijx9.png" alt="Image description" width="875" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In 2017, IBM announced the z14 IBM Z mainframe. As part of this announcement, IBM introduced its pervasive encryption solution. This solution proposed encrypting all data at-rest or in-flight using new and existing hardware and software features.&lt;/p&gt;

&lt;p&gt;This solution enabled the encryption of data at the physical media, file or database, coupling facility, and network levels.&lt;/p&gt;

&lt;p&gt;The IBM pervasive encryption solution uses existing network encryption&lt;br&gt;&lt;br&gt;
features such as SSL.&lt;/p&gt;

&lt;p&gt;The IBM pervasive encryption solution uses existing encryption features of&lt;br&gt;&lt;br&gt;
disk hardware such as the IBM DS8000. This encryption protects data if a&lt;br&gt;&lt;br&gt;
third party gets access to the physical disk media. However, it does not&lt;br&gt;&lt;br&gt;
protect against applications or users accessing files.&lt;/p&gt;

&lt;p&gt;Many database systems including Db2, IMS, and Oracle provide features&lt;br&gt;&lt;br&gt;
to encrypt individual databases, tables, and even columns. The IBM&lt;br&gt;&lt;br&gt;
pervasive encryption solution relies on these existing database encryption&lt;br&gt;&lt;br&gt;
features.&lt;/p&gt;

&lt;p&gt;The IBM pervasive encryption solution uses existing encryption features of&lt;br&gt;&lt;br&gt;
tape hardware devices such as the IBM TSI 155. This encryption protects&lt;br&gt;&lt;br&gt;
data if a third party gets access to the physical tape. However, it does not&lt;br&gt;&lt;br&gt;
protect against applications or users accessing files.&lt;/p&gt;

&lt;p&gt;IBM's pervasive encryption is not entirely a new offering, in that it utilizes several encryption features that have been available for some time. However, the IBM Z mainframe includes features that reduce the overhead of encryption. This together with other features makes pervasive encryption more viable.&lt;/p&gt;

&lt;p&gt;Pervasive encryption aims to encrypt all data at-rest. Traditionally you might think of files, databases, disks, and tapes as such at-rest data. It also aims to encrypt data in-flight. Or in other words, data in networks. It also supports support standard network encryption including SSL, TLS, and IPSec.&lt;/p&gt;

&lt;p&gt;IBM provides a free library to implement the IBM Common Cryptographic Architecture (CCA). This includes APIs for C and Java applications.&lt;/p&gt;

&lt;p&gt;The Linux libica library provides APIs for programs requiring cryptographic services. This library is supported by the icatools command that can show cryptographic information and statistics.&lt;/p&gt;

&lt;p&gt;The open source openCryptoki library can be used to implement the PKCS #11 cryptographic standard on Linux.&lt;/p&gt;

&lt;p&gt;A special Logical Partition (LPAR) type called a Secure Service Container (SSC) can be created in IBM Z mainframe systems. SSC partitions contain an operating system — usually Linux, middleware, and applications. One SSC cannot access any resources in another. SSCs are defined and then deployed as standalone appliances.&lt;/p&gt;

&lt;p&gt;SSC files are encrypted for at-rest security. No direct access to the SSC is possible. Access is via Remote APIs only. Diagnostic data, and dumps, are encrypted as well.&lt;/p&gt;

&lt;p&gt;So, there are different options for encrypting data for at-rest and in-flight. But, will we use all? No. For example, we probably won’t use both SSL/TLS and IPSec.&lt;/p&gt;

&lt;p&gt;So, what option should we choose?&lt;/p&gt;

&lt;p&gt;Well, it depends. To be blunt, there’s no simple solution. No easy answer as to which encryption solution is best.&lt;/p&gt;

&lt;p&gt;It’s difficult to recommend one or a combination. Here’s a toolbox,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;• Full Disk/Tape Encryption
• Dataset Encryption
• Coupling Facility Encryption
• SPOOL Encryption
• Database Encryption
• Other Encryption
• Channel Encryption
• SSL/TLS
• AT-TLS
• JSSE
• IPSec
• SSH
• VTAM Encryption&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s up to us which tools to utilize and when. So, here are some tactics when you’re starting to look at pervasive encryption, and need to figure out which of our tools to use.&lt;/p&gt;

&lt;p&gt;First, ask yourself why you’re encrypting. For example, if you’re encrypting to satisfy a compliance requirement, then you may not need coupling facility encryption to achieve this.&lt;/p&gt;

&lt;p&gt;Next, list the encryption options you have like dataset encryption. You may also have other products or features that can be used.&lt;/p&gt;

&lt;p&gt;Third, triage your data: most sensitive/important to least sensitive. Some will be very important to encrypt, others not so much.&lt;/p&gt;

&lt;p&gt;Now, you can choose your solutions to achieve the encryption you need. You’ll probably start with data that needs encrypting the most, and move out from there.&lt;/p&gt;

&lt;p&gt;In summary,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Encryption is becoming essential for data security and compliance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Most encryption is selective, encrypting only what is required and where.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pervasive encryption encrypts all data, at-rest and in-flight.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pervasive encryption provides added security, together with simplified compliance verification.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>encryption</category>
      <category>programming</category>
      <category>security</category>
      <category>linux</category>
    </item>
    <item>
      <title>Serverless Kubernetes on Google Cloud Platform</title>
      <dc:creator>Gursimar Singh</dc:creator>
      <pubDate>Sun, 22 Jan 2023 04:13:39 +0000</pubDate>
      <link>https://dev.to/gursimarsm/serverless-kubernetes-on-google-cloud-platform-3fef</link>
      <guid>https://dev.to/gursimarsm/serverless-kubernetes-on-google-cloud-platform-3fef</guid>
      <description>&lt;p&gt;Kubernetes is gaining a tremendous degree of popularity and is being adopted by all organizations, despite the fact that some are far larger than others. Now, deploying Kubernetes necessitates the recruitment of qualified software developers. It is possible that organizations, particularly bootstrapped start-ups and small-scale ones, would view this as an unnecessary overhead expense. Let’s look at the several ways that this problem may be solved.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Serverless computing: why bother?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The concept of serverless computing has been a topic of considerable interest for some time, and it is not likely to go out of favour any time in the near future. When developers are relieved of the task of managing infrastructure, they are better able to focus their attention on developing and refining the product, which speeds up the process of bringing it to market.&lt;/p&gt;

&lt;p&gt;Cloud Run is a serverless platform that is powered by Knative, a runtime environment that extends Kubernetes for serverless applications, and the Functions Framework. Cloud Run was developed by Google. Google is the company that was responsible for developing Cloud Run. Cloud Run enables us to package our already-existing code in a Docker container, in contrast to other serverless services, which require us to deliver code that was specifically created to operate as a function and be activated by events. This is because other serverless services require us to deliver code that was specifically created to operate as a function and be activated by events.&lt;br&gt;&lt;br&gt;
This container is able to work in the fully controlled serverless environment that Cloud Run provides, but because it utilises Knative, it can also run on Google Kubernetes Engine. This enables us to add pay-per-use, on-demand code to your current Kubernetes clusters and gives us the flexibility to do so. Cloud Run is a fully managed environment for serverless computing that you may access over the cloud. Even though it is not always a fully-fledged solution, it does make it possible to run serverless apps on Kubernetes.&lt;/p&gt;

&lt;p&gt;In addition to a runtime environment, the open application programming interface (API) that Knative offers is also available. This enables us to run your serverless applications anywhere we see fit, including completely managed on Google Cloud, on Anthos on Google Kubernetes Engine (GKE), or on our very own Kubernetes cluster. Knative makes it easy to get started with Cloud Run, then switch to Cloud Run for Anthos, or to get started with our own Kubernetes cluster and then move to Cloud Run. Both of these options are available. These two courses of action are both up to consideration on our end. Because we are utilising Knative as the basis upon which everything else is built, we are able to migrate workloads between platforms without having to pay large switching charges. This is made possible by the fact that we are using Knative.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Some of the major benefits of Cloud Run:&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Rapid autoscaling&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Split traffic&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automatic redundancy&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No vendor lock-in&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cloud Run requires the code to be a stateless HTTP container that creates an HTTP server within four minutes, or two hundred and forty seconds, of receiving a request, replies to the request within the request timeout, and is compiled for 64-bit Linux. It is necessary to set the listening port to 8080, however, the actual port number should not be hardcoded.&lt;br&gt;&lt;br&gt;
Take note that, by default, all Cloud Run services have a consistent HTTPS endpoint with TLS termination taken care of for us.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some of the use cases include&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;· Websites&lt;/p&gt;

&lt;p&gt;· REST API backend&lt;/p&gt;

&lt;p&gt;· Lightweight data transformation&lt;/p&gt;

&lt;p&gt;· Scheduled document generation, such as PDF generation&lt;/p&gt;

&lt;p&gt;· Workflow with webhooks&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;As we have covered the necessary ground to get started with Cloud Run, let’s move forward and see how to deploy a container to Cloud Run&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Before getting started, make sure the appropriate Google Cloud Project is activated and billing is enabled for the Google Cloud Project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mg_5lXSq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjfso4vo43y4lu81i0kd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mg_5lXSq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjfso4vo43y4lu81i0kd.png" alt="Image description" width="875" height="584"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are multiple ways to deploy to Cloud Run:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Deploying a pre-built container&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Building and deploying a container from source code&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can create both services and jobs using Cloud Run.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Deploying a pre-built container&lt;/strong&gt;
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Go to Cloud Run either from the navigation menu or from the search menu.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8coHWxl5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4su7uxl4z28b8rtb97m3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8coHWxl5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4su7uxl4z28b8rtb97m3.png" alt="Image description" width="875" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2. Click Create service&lt;/p&gt;

&lt;p&gt;o Select &lt;strong&gt;Deploy one revision from an existing container image&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;o We can either provide our container image URL or click Test with a sample container.&lt;/p&gt;

&lt;p&gt;o In the Region pulldown menu, we need to select the region where we want the service to be located.&lt;/p&gt;

&lt;p&gt;o Under Authentication, we will select Allow unauthenticated invocations. We can modify permissions as per our use case.&lt;/p&gt;

&lt;p&gt;o Finally, click Create to deploy the container image to Cloud Run and wait for the deployment to finish.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9bidiCHY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gavdyl4g00rzgbo2xvgp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9bidiCHY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gavdyl4g00rzgbo2xvgp.png" alt="Image description" width="875" height="982"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kifxOfCf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqqqcks6ahotz7epggon.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kifxOfCf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqqqcks6ahotz7epggon.png" alt="Image description" width="875" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; We can configure CPU allocation and autoscaling as per need. We can also specify the security settings along with referencing secrets.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Even though Kubernetes could appear to be complicated, serverless technologies like Cloud Run might be used to simplify and expedite the process of designing software applications.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>googlecloud</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Apache Kafka — The Big Data Messaging tool</title>
      <dc:creator>Gursimar Singh</dc:creator>
      <pubDate>Sun, 22 Jan 2023 03:50:22 +0000</pubDate>
      <link>https://dev.to/gursimarsm/apache-kafka-the-big-data-messaging-tool-4n2h</link>
      <guid>https://dev.to/gursimarsm/apache-kafka-the-big-data-messaging-tool-4n2h</guid>
      <description>&lt;p&gt;Apache Kafka was built for real-time. In programming we consider everything to be events. Now, events have states as well. But the primary idea is that the event is an indication in time that the thing took place.&lt;/p&gt;

&lt;p&gt;Now it’s a little bit cumbersome to store events in databases. Apache Kafka was built for real-time. In programming we consider everything to be events. Now, events have states as well. But the primary idea is that the event is an indication in time that the thing took place.&lt;/p&gt;

&lt;p&gt;Now it’s a little bit cumbersome to store events in databases. Instead, we use a structure called a log. And a log is just an ordered sequence of these events. An event happens, and we write it into a log, a little bit of state, a little bit of description of what happens.&lt;/p&gt;

&lt;p&gt;Logs are really easy to think about, and they’re also easy to build at scale. Historically, this has not quite been true of databases.&lt;/p&gt;

&lt;p&gt;Apache Kafka is the system that is responsible for maintaining logs. It refers to them as topics, which is a very traditional phrase. A theme is nothing more than an organized list of occurrences.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;What precisely is Kafka?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Apache Kafka is a distributed publish-subscribe messaging system and a robust queue that can manage a high amount of data and that enables you to transmit messages from one end-point to another. These features allow you to pass messages from one end-point to another. The reading of Kafka’s messages can be done so either offline or in an online setting. In order to avoid any data from being lost, Kafka messages are stored on the disc and duplicated across the cluster. The synchronization service ZooKeeper serves as the foundation upon which Kafka was constructed. For the purpose of performing real-time streaming data analysis, it interfaces very well with Apache Storm and Spark.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Okay. Now, what is a Messaging system?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;The sharing and transmission of data between applications is handled by a messaging system, which enables the programs to focus solely on the data itself rather than being sidetracked by the sharing and transmission of data. The core component of distributed messaging is message queuing that can be trusted. Client applications and the messaging system engage in asynchronous message queuing amongst one another. There are two distinct patterns for conveying information. The first type of messaging system is known as a point-to-point messaging system, while the second type of messaging system is known as a publish-subscribe, also knows as pub-sub, messaging system. The pub-sub architecture is utilised by the vast majority of messaging systems today.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the benefits?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15kbd0rjru4rpgedsbob.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15kbd0rjru4rpgedsbob.png" alt="Image description" width="345" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before delving further into Kafka, it is imperative that we have a solid understanding of the primary terms, such as topics, brokers, producers, and consumers. The important parts are broken down into their component parts and illustrated in the following picture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsswvpaoakmw9yhidzkn4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsswvpaoakmw9yhidzkn4.png" alt="Image description" width="800" height="831"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Definitions&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Topics:&lt;/strong&gt; Messages that fall into a certain category are referred to as a subject, and the stream of messages that make up a "topic" is termed a topic. Topics are used to organize and store the data. The various subjects have been separated into their own individual sections. Kafka maintains at the very least one partition dedicated specifically to each subject. Every one of these partitions carries messages that are organized in an unchangeable sequential order. A partition is realized as a collection of segment files of consistent sizes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Partition:&lt;/strong&gt; Because Topics may have any number of partitions, it can store and process any amount of data. Each message that has been partitioned has its own distinctive sequence id, which is referred to as the offset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Replicas:&lt;/strong&gt; It’s important to note that replicas are not the same thing as backups of a partition. There is never any data reading or writing done on replicas. They are utilised in operations to ensure that data is not lost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Brokers:&lt;/strong&gt; Brokers are straightforward systems that are tasked with the responsibility of preserving the published data. It’s possible for each broker to have zero, one, or several divisions for each subject. Assume that there are N partitions in a subject, and N number of brokers. Each broker will have one partition, if this is the case.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Producers:&lt;/strong&gt; Producers are individuals or organisations that publish messages to one or more Kafka subjects. Producers transmit data to Kafka brokers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consumers:&lt;/strong&gt; Consumers are those who read the data that is provided by brokers. A consumer can subscribe to one or more topics and will then consume published messages by fetching data from the brokers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kafka Clusters:&lt;/strong&gt; Clusters of Kafka are referred to as Kafka clusters, and they are characterised by the presence of more than one broker. A Kafka cluster may have more nodes added to it without experiencing any downtime. The management of the durability and replication of message data is handled by using these clusters.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;History of Apache Kafka&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Linkedin created Kafka as a result of the difficult architectural decisions the company was forced to make throughout the course of its existence in order to get to the point where it could create Kafka. In order to develop this project into something that is capable of supporting the greater than 1.4 trillion messages that go through the Kafka infrastructure at LinkedIn, they also needed to find solutions to several fundamental problems. The engineering team at LinkedIn needed to do a complete redesign of their infrastructure. They had previously made the transition from a monolithic application infrastructure to one that was built on microservices in order to support the growing number of users they had as well as the increasing complexity of their website. Because of this adjustment, the search, profile, and communication platforms, along with any other platforms, were able to grow more effectively. It also resulted in the introduction of a second set of mid-tier services to enable API access to data models and back-end services to provide consistent access to the databases. Both of these developments were brought about as a direct consequence of this event.&lt;/p&gt;

&lt;p&gt;In the beginning, they constructed a number of unique proprietary data pipelines to handle the numerous streams and queues of data that they had. Use cases for these systems ranged from simple things like tracking site events like page visits to more complex tasks like compiling aggregated logs from a variety of different services. The queuing capability for the InMail message system, as well as other systems, was provided by other pipelines. These needed to scale along with the site as it became bigger. They decided to invest in the construction of a single, distributed pub-sub platform as opposed to managing and growing each pipeline on an individual basis.&lt;/p&gt;

&lt;p&gt;Thus, Kafka was consequently brought into the world at this time.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Why Kafka?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Let’s look at an illustration to understand this in a simple manner.&lt;/p&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4200yi2y2qkq0atv984n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4200yi2y2qkq0atv984n.png" alt="Image description" width="800" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xs426eq8x9f6l7g233v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xs426eq8x9f6l7g233v.png" alt="Image description" width="800" height="282"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I believe the figures are self-explanatory and can be understood easily, so let’s not spend time reading an obvious explanation for the same.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Use cases&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Some of the popular use cases for Apache Kafka include,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Messaging&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Website Activity Tracking&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Metrics&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Log Aggregation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stream Processing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Event Sourcing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Commit Log&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let’s have a look at some of the companies that make use of Apache Kafka. The list contains some recognisable names, such as the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Uber&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LinkedIn&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Twitter&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Netflix&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pinterest&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Airbnb&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Features&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Quick&lt;/strong&gt;: A single Kafka broker can manage the reads and writes of clients at a rate of up to 100Mbps.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalable&lt;/strong&gt;: Data streams are partitioned and disseminated over a cluster of machines to allow for data streams that are bigger than the capacity of any one machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Durable&lt;/strong&gt;: Messages are stored permanently on a disc and duplicated throughout the cluster to ensure that data is never lost. Each broker has the capacity to process gigabytes of messages without a noticeable decrease in performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Distributed&lt;/strong&gt;: Kafka is designed to be distributed, and its architecture is contemporary and cluster-centric; this configuration provides high fault tolerance and excellent durability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Architectural Flow for Pub-Sub Messaging&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Kafka provides a solitary consumer/client abstraction that summarises both Queuing and Publish-Subscribe at the same time. The process of Pub-Sub Messaging may be broken down into the following steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Producers will deliver messages to a subject at predetermined intervals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Kafka broker saves all messages in the partitions that are specified specifically for the subject in question. It guarantees that the messages are exchanged in an equitable manner between the divisions. In the event that the producer delivers two separate messages and there are two partitions, Kafka will save the first message in the first partition and the second message in the second partition.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The consumer registers their interest in a certain subject.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After the consumer has subscribed to a topic, Kafka will give the consumer with the current offset of the subject while simultaneously saving the offset in the Zookeeper ensemble.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The consumer will send a request to Kafka at certain intervals (for example, every 100 milliseconds) in order to get newly published messages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As soon as Kafka is in possession of the messages that have been sent to it by producers, the company then transmits these messages to the users who are consumers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The message will be delivered to the consumer, who will then process it. When the messages have been completely digested, the consumer will then send an acknowledgement to the Kafka broker.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After Kafka has been given an acknowledgement, it will alter the offset such that it corresponds to the new value and will then update the information in the Zookeeper. The consumer is able to appropriately read the next message even in the event that the server has an outage. This is because the offsets are kept in the Zookeeper.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This cycle, which has been described above, will continue until the customer cancels the request.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The consumer can rewind or skip to the appropriate offset of a subject at any moment and view all of the subsequent messages. This functionality is available round-the-clock.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Installation&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjslczg93j94ozre3nsll.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjslczg93j94ozre3nsll.png" alt="Image description" width="800" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Install Java/Verify Java Installation&lt;/p&gt;

&lt;p&gt;With any luck, you already have Java installed on your computer at the moment; if so, all you need to do is run the following command to confirm that it is indeed installed.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ java --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Please visit the following URL and download the most recent version of JDK if you have not already downloaded Java. If you have already downloaded Java, you may skip this step.&lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" rel="noopener noreferrer"&gt;http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Install Zookeeper Framework&lt;/p&gt;

&lt;p&gt;The Kafka brokers and the consumers communicate with one another using ZooKeeper, which acts as the coordination interface.&lt;/p&gt;

&lt;p&gt;Visit the following link to obtain the most recent version of ZooKeeper, which you will need in order to install the ZooKeeper framework on your system.&lt;a href="http://zookeeper.apache.org/releases.html" rel="noopener noreferrer"&gt;http://zookeeper.apache.org/releases.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Extract tar file using the following command,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ cd opt/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ tar -zxf zookeeper-3.x.x.tar.gz&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ cd zookeeper-3.x.x&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ mkdir data&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Open Configuration File named conf/zoo.cfg using the command vi “conf/zoo.cfg” and all the following parameters to set as starting point.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ vi conf/zoo.cfg&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tickTime=3000  
dataDir=/path/to/zookeeper/data  
clientPort=2811  
initLimit=6  
syncLimit=3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the configuration file has been saved successfully and return to terminal again, you can start the zookeeper server.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ bin/zkServer.sh start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After executing the above command, you will get a response as,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$  JMX  enabled  by  default 
$  Using  config:  /Users/../zookeeper-3.x.x/bin/../conf/zoo.cfg 
$  Starting  zookeeper  ...  STARTED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let’s run the CLI&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ bin/zkCli.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After executing the command, you will be connected to the zookeeper server and will get the response as,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Connecting to localhost:2811 
................ 
................ 
................ 
Welcome to ZooKeeper! 
................ 
................ 
WATCHER:: 
WatchedEvent state:SyncConnected type: None path:null 
[zk: localhost:2811(CONNECTED) 0]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After connecting the server and performing all the operations, you can stop the zookeeper server using the command,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ bin/zkServer.sh stop&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, as you successfully installed Java and ZooKeeper on the machine, let us look at the steps to install Apache Kafka.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Install Kafka&lt;/p&gt;

&lt;p&gt;To install Apache Kafka on the machine, you can visit the official Apache website and download the tar file link,&lt;/p&gt;

&lt;p&gt;Extract the tar file,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ tar -zxf kafka_x.x.x.x.x.x tar.gz&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ cd kafka_x.x.x.x.x.x&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Run the server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that you have downloaded Apache Kafka on the machine, you can start the server,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ bin/kafka-server-start.sh config/server.properties&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After the server starts, you would see a response on the screen,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; $  bin/kafka-server-start.sh  config/server.properties 
  INFO KafkaConfig values: 
  request.timeout.ms = xxxxx 
  log.roll.hours = xxx 
  inter.broker.protocol.version = x.x.x.x 
  log.preallocate = false 
  security.inter.broker.protocol = PLAINTEXT 
  ……………………………………………. 
  …………………………………………….
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  &lt;strong&gt;Produce and consume few messages&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Kafka is a platform for distributed event streaming that enables users to read, write, store, and process events (sometimes referred to as records or messages in documentation) over a large number of machines.&lt;/p&gt;

&lt;p&gt;Payment transactions, geolocation updates from mobile phones, shipment orders, sensor measurements from internet-of-things (IoT) devices or medical equipment, and a great many more types of events are examples of events. These occurrences are categorised and saved under their respective topics. At its most basic level, a subject may be compared to a folder inside a file system, and the events that occur within that folder can be compared to the files that occur within that folder.&lt;/p&gt;

&lt;p&gt;Launch a new session of the terminal and type in:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ bin/kafka-topics.sh --create --topic demo-events --bootstrap-server&lt;/code&gt; &lt;a href="http://localhost:2990" rel="noopener noreferrer"&gt;&lt;code&gt;localhost:2990&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All of Kafka’s command line tools have additional options: run &lt;code&gt;$&lt;/code&gt; &lt;a href="http://kafka-topics.sh" rel="noopener noreferrer"&gt;&lt;code&gt;kafka-topics.sh&lt;/code&gt;&lt;/a&gt; command without any arguments to display usage information.&lt;/p&gt;

&lt;p&gt;Open two terminal windows,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Producer:&lt;/strong&gt; &lt;code&gt;$ bin/kafka-console-producer.sh --topic demo-events --bootstrap-server&lt;/code&gt; &lt;a href="http://localhost:2990" rel="noopener noreferrer"&gt;&lt;code&gt;localhost:2990&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consumer:&lt;/strong&gt; &lt;code&gt;$ bin/kafka-console-consumer.sh --topic demo-events --from-beginning --bootstrap-server&lt;/code&gt; &lt;a href="http://localhost:2990" rel="noopener noreferrer"&gt;&lt;code&gt;localhost:2990&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Position the windows for the production terminal and the consumer terminal such that they are side by side. To continue, type a few more messages into the producer terminal, and then observe how those messages are shown on the consumer terminal.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;How to stop and exit the Apache Kafka environment?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;When you are finished playing around with Kafka, you should follow these procedures to get out of the Apache Kafka environment:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Stop the consumer and producer clients using Ctrl+C&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stop the Kafka broker using Ctrl+C&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stop the ZooKeeper server using Ctrl+C&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the following command for cleaning up:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;rm -rf /tmp/kafka-logs /tmp/zookeeper&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;We have covered the basics including a hands-on demo for getting started with Kafka. There is a lot more that goes into Apache Kafka. I hope you’ve enjoyed it and have learned something new.&lt;/p&gt;

&lt;p&gt;I’m always open to suggestions and discussions on &lt;a href="https://www.linkedin.com/in/gursimarsm/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. Hit me up with direct messages.&lt;/p&gt;

&lt;p&gt;Till the next one, stay safe and keep learning.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>networking</category>
      <category>career</category>
    </item>
    <item>
      <title>Annotations in Kubernetes</title>
      <dc:creator>Gursimar Singh</dc:creator>
      <pubDate>Wed, 04 Jan 2023 17:00:08 +0000</pubDate>
      <link>https://dev.to/gursimarsm/annotations-in-kubernetes-2548</link>
      <guid>https://dev.to/gursimarsm/annotations-in-kubernetes-2548</guid>
      <description>&lt;p&gt;Just what are these "annotation things" anyway? Annotations are not fully explained in the Kubernetes documentation, which is otherwise quite useful.&lt;/p&gt;

&lt;p&gt;Similar to how labels are made up of key-value pairs, annotations are also made up of strings. Annotations, however, were initially meant to serve no actual use and are now useless because they cannot be utilised in any queries; the original goal was to offer extensive metadata in an object. Information regarding licencing, the project's maintainer, and other such details are examples of such trivia. Newly-introduced Kubernetes resources, however, may make use of annotations to describe their functionality in greater detail.&lt;/p&gt;

&lt;p&gt;To a lesser extent, annotations are unimportant. Labels, on the other hand, will require a lot of human attention.&lt;/p&gt;

&lt;p&gt;Annotations and labels share certain similarities. However, for objects, Kubernetes uses labels rather than annotations. Annotations are not used by Kubernetes to apply any changes to the clusters. Annotations work more like comments for human readability and extra details. Annotations help provide context. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: Annotations include non-identifying metadata in contrast to labels which hold identifying metadata&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Syntax
&lt;/h2&gt;

&lt;p&gt;Annotations can be described in two ways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Declarative i.e., using the CLI command&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Syntax: &lt;code&gt;kubectl annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Example: &lt;code&gt;kubectl annotate --overwrite pods example description=this is an example'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We can both add and remove annotations using the CLI as well.&lt;br&gt;
We have multiple options are available such as –-user, --cluster, --kubeconfig, --context and so on. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Imperative i.e., specifying in the manifest (yaml) file.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the manifest files, they are defined in the metadata section of the files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
metadata:
  annotations:
    for.example/url: "https://www.k8s-blog.com/annotation"
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Annotations are a way for other programs driving Kubernetes via an API to store some opaque data with an object. Annotations can be used for the tool itself or to pass configuration information between external systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Character constraints
&lt;/h2&gt;

&lt;p&gt;There is an overlap between annotations and labels. Annotations have some extra characters allowed which are not allowed by labels.&lt;/p&gt;

&lt;p&gt;Valid annotation keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/).&lt;br&gt;
If the prefix is omitted, the annotation Key is presumed to be private to the user. Automated system components (e.g. kube-scheduler, kube-controller-manager, kube-apiserver, kubectl, or other third-party automation) which add annotations to end-user objects must specify a prefix.&lt;br&gt;
The kubernetes.io/ and k8s.io/ prefixes are reserved for Kubernetes core components.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do we check annotations?
&lt;/h2&gt;

&lt;p&gt;We can either use the “kubectl describe pod” command which displays all the info including the annotations or we can simply output only annotations.&lt;br&gt;
However, this command’s output might not be very clear in terms of human readability. &lt;/p&gt;

&lt;h2&gt;
  
  
  Use cases
&lt;/h2&gt;

&lt;p&gt;They are primarily used while rolling deployments. However, there are various other use cases where annotations are used such as, &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alerting about a specialized policy for a scheduler&lt;/li&gt;
&lt;li&gt;Incorporating information about the resource's most recent updating tool and its update process&lt;/li&gt;
&lt;li&gt;Including data that isn't meant for labels, such as build and release info.&lt;/li&gt;
&lt;li&gt;Permit the Deployment object to maintain a record of the ReplicaSets it is responsible for maintaining throughout deployments.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: Some Kubernetes resources and third-party applications might use Annotations so it’s imperative to be careful while using annotations.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>development</category>
    </item>
  </channel>
</rss>
