<?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: Kathir</title>
    <description>The latest articles on DEV Community by Kathir (@kathir_2911).</description>
    <link>https://dev.to/kathir_2911</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3419960%2F65777535-391c-4346-8c5a-9b269c651d55.png</url>
      <title>DEV Community: Kathir</title>
      <link>https://dev.to/kathir_2911</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kathir_2911"/>
    <language>en</language>
    <item>
      <title>Terraform</title>
      <dc:creator>Kathir</dc:creator>
      <pubDate>Thu, 16 Jul 2026 16:13:54 +0000</pubDate>
      <link>https://dev.to/kathir_2911/terraform-5abo</link>
      <guid>https://dev.to/kathir_2911/terraform-5abo</guid>
      <description>&lt;p&gt;Terraform is an infrastructure as code tool that lets you build, change, and version cloud and on-prem resources safely and efficiently.&lt;/p&gt;




&lt;h2&gt;
  
  
  Infrastructure as Code
&lt;/h2&gt;

&lt;p&gt;Instead of describing infrastructure in a document like&lt;/p&gt;

&lt;p&gt;Server: 4CPUs, Memory: 8GB, Ubuntu, Firewall: Port 80,&lt;/p&gt;

&lt;p&gt;We write it as code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"google_compute_instance"&lt;/span&gt; &lt;span class="s2"&gt;"web"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;machine_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"e2-standard-2"&lt;/span&gt;

  &lt;span class="nx"&gt;boot_disk&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;initialize_params&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;image&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ubuntu-2204-lts"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Terraform versions the infrastructure as Code (Terraform configuration files) that define the cloud or on-premises resources. By storing these files in Git, we can track, review, compare and revert infrastructure changes just like application code.&lt;/p&gt;

&lt;p&gt;Terraform doesn't version the infrastructure like VM itself. It versions the code that defines the infrastructure. That lets you track, review and roll back infrastructure changes using a version control system like Git.&lt;/p&gt;




&lt;h2&gt;
  
  
  Terraform State File
&lt;/h2&gt;

&lt;p&gt;The Terraform state file (&lt;code&gt;terraform.tfstate&lt;/code&gt;) is a file that stores Terraform's knowledge of the infrastructure it has created and manages.&lt;/p&gt;

&lt;p&gt;Without state file, Terraform would forget everything it had created.&lt;/p&gt;

&lt;p&gt;It contains:&lt;/p&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;google_compute_instance.web&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Name
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;web-server&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ID
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;123456789&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Zone
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;asia-sout1-a&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Machine Type
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;e2-medium&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Status
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Running&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ID = Also knowns as Resource Id used for updation even if the machine type changes in the VM. Resource Id would be constant so we can change the correct resource by looking the Id.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where is state file stored?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local state:&lt;/strong&gt; It lives on computer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remote state (in companies):&lt;/strong&gt; Stored remotely such as Google Cloud Storage, AWS S3, Azure Storage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remote storage allows everyone on the team to work with the same infrastructure safely.&lt;/p&gt;

&lt;p&gt;Without state file: Duplicate resource may be created since it didn't know anything about current state.&lt;/p&gt;

&lt;p&gt;Even though state file extension is &lt;code&gt;.tfstate&lt;/code&gt;, its contents are in JSON.&lt;/p&gt;




&lt;h2&gt;
  
  
  Terraform Workflow
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Write Terraform code
&lt;/h3&gt;

&lt;p&gt;Create configuration files.&lt;/p&gt;

&lt;p&gt;In this phase, nothing has been created.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Format the code
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraform &lt;span class="nb"&gt;fmt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Terraform automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fixes indentation&lt;/li&gt;
&lt;li&gt;aligns equal signs&lt;/li&gt;
&lt;li&gt;improves readability&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Validate
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraform validate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Terraform checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Syntax&lt;/li&gt;
&lt;li&gt;missing arguments&lt;/li&gt;
&lt;li&gt;invalid references&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Initialize
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraform init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Terraform init helps to downloads everything needed or the project.&lt;/p&gt;

&lt;p&gt;It downloads provider plugin, initializes the backend and modules and create &lt;code&gt;.terraform&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;It is like installing dependencies from the internet.&lt;/p&gt;

&lt;p&gt;Eg:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"google"&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Terraform downloads the Google Cloud provider plugin.&lt;/p&gt;

&lt;p&gt;Without it, terraform doesn't know how to talk to Google Cloud APIs.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Plan
&lt;/h3&gt;

&lt;p&gt;It is the terraform's decision making step.&lt;/p&gt;

&lt;p&gt;It compares current and desired state.&lt;/p&gt;

&lt;p&gt;Internally, it performs&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Terraform code
      ↓
Read state file
      ↓
Ask Google cloud
      ↓
Compare
      ↓
Generate Execution plan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;HashiCorp calls this an execution plan, which previews the infrastructure changes before anything modified.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Review
&lt;/h3&gt;

&lt;p&gt;User's team reviews the plan.&lt;/p&gt;

&lt;p&gt;It is one of the terraform's biggest safety features.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Apply
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraform apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Terraform reads the plan, calls google cloud apis, Creates resource, waits until they are ready, writes the stae file.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Update State
&lt;/h3&gt;

&lt;p&gt;After a successful apply:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;terraform.tfstate&lt;/code&gt; is updated.&lt;/p&gt;

&lt;h3&gt;
  
  
  9. Destroy
&lt;/h3&gt;

&lt;p&gt;If the environment is no longer needed. Then use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraform destroy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  .terraform/ Directory
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.terraform/&lt;/code&gt; directory is like &lt;code&gt;node_modules&lt;/code&gt; where the downloaded dependencies and all plugin, modules, metadata will be stored.&lt;/p&gt;




&lt;h2&gt;
  
  
  .terraform.lock.hcl
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.terraform.lock.hcl&lt;/code&gt; is Terraform's dependency lock file. It stores the provider name, the exact provider version, and checksums (hashes) of the provider plugins.&lt;/p&gt;

&lt;p&gt;During future &lt;code&gt;terraform init&lt;/code&gt; runs, Terraform uses this file to download the same provider version and verifies the downloaded plugin against the stored checksums.&lt;/p&gt;

&lt;p&gt;This ensures everyone on the team and CI/CD pipelines use identical provider versions, preventing unexpected behavior, compatibility issues, and bugs caused by different provider versions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Terraform Configuration Files
&lt;/h2&gt;

&lt;h3&gt;
  
  
  main.tf
&lt;/h3&gt;

&lt;p&gt;This is the main configuration file.&lt;/p&gt;

&lt;p&gt;It contains the infrastructure wants terraform to create.&lt;/p&gt;




&lt;h3&gt;
  
  
  variables.tf
&lt;/h3&gt;

&lt;p&gt;Instead of hardcoding values, we declare variable.&lt;/p&gt;

&lt;p&gt;What values are changeable?&lt;/p&gt;




&lt;h3&gt;
  
  
  terraform.tfvars
&lt;/h3&gt;

&lt;p&gt;This file provides values for the variables.&lt;/p&gt;

&lt;p&gt;It provides answers for the &lt;code&gt;variables.tf&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  outputs.tf
&lt;/h3&gt;

&lt;p&gt;Used to display useful information after deployment.&lt;/p&gt;




&lt;h3&gt;
  
  
  providers.tf
&lt;/h3&gt;

&lt;p&gt;Specifies which cloud provider terraform should use.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>devops</category>
      <category>infrastructure</category>
      <category>terraform</category>
    </item>
    <item>
      <title>Microsoft SQL Server and its Components</title>
      <dc:creator>Kathir</dc:creator>
      <pubDate>Tue, 14 Jul 2026 15:17:16 +0000</pubDate>
      <link>https://dev.to/kathir_2911/microsoft-sql-server-and-its-components-45dj</link>
      <guid>https://dev.to/kathir_2911/microsoft-sql-server-and-its-components-45dj</guid>
      <description>&lt;h2&gt;
  
  
  SQL Server Instance
&lt;/h2&gt;

&lt;p&gt;An SQL Server instance is an independent SQL Server environment running on a machine. Multiple instances can coexist on the same server, each with its own databases, users, configuration, and services, allowing different applications or environments to be isolated while sharing the same hardware.&lt;/p&gt;




&lt;h2&gt;
  
  
  Microsoft SQL Server
&lt;/h2&gt;

&lt;p&gt;Microsoft SQL Server is a Relational Database Management System (RDBMS).&lt;/p&gt;

&lt;p&gt;Applications and Tools → Connect to a SQL Server Instance → Connect to a Database → Communicate using Transact-SQL (T-SQL)&lt;/p&gt;

&lt;p&gt;The application connects to a SQL Server instance. It selects a database within that instance. It sends T-SQL commands (queries and updates). SQL Server executes those commands and returns the results to the application.&lt;/p&gt;

&lt;p&gt;SQL Server is a complete database product. It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database Engine&lt;/li&gt;
&lt;li&gt;SQL Server Agent&lt;/li&gt;
&lt;li&gt;Integration Services (SSIS)&lt;/li&gt;
&lt;li&gt;Analysis Services (SSAS)&lt;/li&gt;
&lt;li&gt;Reporting Services (SSRS)&lt;/li&gt;
&lt;li&gt;Full-Text Search&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Database Engine is a component of SQL Server. It runs as a SQL Server service on the operating system.&lt;/p&gt;

&lt;p&gt;Microsoft uses the same Database Engine technology in several products and platforms, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL Server (installed on your own machine or server)&lt;/li&gt;
&lt;li&gt;Azure SQL Database (managed cloud database)&lt;/li&gt;
&lt;li&gt;Azure SQL Managed Instance (cloud service with high SQL Server compatibility)&lt;/li&gt;
&lt;li&gt;Microsoft Fabric SQL Database (SQL capabilities within Microsoft Fabric)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  SQL Server Components
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Database Engine
&lt;/h3&gt;

&lt;p&gt;The Database Engine is the core service of Microsoft SQL Server. It is the component that actually stores, retrieves, updates, and secures the data.&lt;/p&gt;

&lt;p&gt;A Database Engine is the software that manages data stored on disk.&lt;/p&gt;

&lt;h3&gt;
  
  
  What does the Database Engine do?
&lt;/h3&gt;

&lt;p&gt;When an application sends a T-SQL query, the Database Engine:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Receives the query.&lt;/li&gt;
&lt;li&gt;Checks whether the user has permission.&lt;/li&gt;
&lt;li&gt;Finds the best way to execute the query.&lt;/li&gt;
&lt;li&gt;Reads or modifies the data.&lt;/li&gt;
&lt;li&gt;Returns the results.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Stores data&lt;/li&gt;
&lt;li&gt;Executes T-SQL queries&lt;/li&gt;
&lt;li&gt;Manages transactions&lt;/li&gt;
&lt;li&gt;Provides security&lt;/li&gt;
&lt;li&gt;Performs performance optimization (efficient way to execute a query)&lt;/li&gt;
&lt;li&gt;Backup and recovery&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Main Internal Components of the Database Engine
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Query Processor
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Parses and executes T-SQL queries.&lt;/li&gt;
&lt;li&gt;Creates execution plans.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. Storage Engine
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Reads and writes data to disk.&lt;/li&gt;
&lt;li&gt;Manages pages, indexes, and files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Transaction Manager
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Ensures data consistency using ACID properties.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  4. Security Manager
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Handles authentication and authorization.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Machine Learning Services
&lt;/h2&gt;

&lt;p&gt;Machine Learning Services is a feature in SQL Server that gives the ability to run Python and R scripts with relational data.&lt;/p&gt;

&lt;p&gt;It can be used with open-source packages and frameworks, as well as Microsoft Python and R packages, for predictive analytics and machine learning.&lt;/p&gt;

&lt;p&gt;The scripts are executed on data without moving the data outside SQL Server or over the network.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Java Language Extension is a feature of SQL Server used for executing external Java code.&lt;/p&gt;

&lt;p&gt;The default runtime used in it is &lt;strong&gt;Zulu OpenJRE&lt;/strong&gt;, and it can also be changed.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  3. SQL Server Integration Services (SSIS)
&lt;/h2&gt;

&lt;p&gt;SQL Server Integration Services (SSIS) is one of the major components of Microsoft SQL Server.&lt;/p&gt;

&lt;p&gt;Its purpose is moving, transforming, and integrating data between sources.&lt;/p&gt;

&lt;p&gt;If you have data in different places like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Excel files&lt;/li&gt;
&lt;li&gt;CSV files&lt;/li&gt;
&lt;li&gt;MySQL databases&lt;/li&gt;
&lt;li&gt;Oracle databases&lt;/li&gt;
&lt;li&gt;SQL Server databases&lt;/li&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SSIS moves the data from these different sources into SQL Server.&lt;/p&gt;

&lt;h3&gt;
  
  
  SSIS follows the ETL Process
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Extract
&lt;/h4&gt;

&lt;p&gt;Extract data from different sources.&lt;/p&gt;

&lt;h4&gt;
  
  
  Transform
&lt;/h4&gt;

&lt;p&gt;Modify the data.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove duplicate rows&lt;/li&gt;
&lt;li&gt;Convert text to uppercase&lt;/li&gt;
&lt;li&gt;Change date formats&lt;/li&gt;
&lt;li&gt;Calculate totals&lt;/li&gt;
&lt;li&gt;Replace NULL values&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Load
&lt;/h4&gt;

&lt;p&gt;Store the processed data into the SQL Server database.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;SSIS does &lt;strong&gt;not&lt;/strong&gt; store data. Its job is to move and transform data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  SSIS can do
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Import Excel and CSV files&lt;/li&gt;
&lt;li&gt;Copy data between databases&lt;/li&gt;
&lt;li&gt;Merge multiple data sources&lt;/li&gt;
&lt;li&gt;Clean and validate data&lt;/li&gt;
&lt;li&gt;Schedule data imports&lt;/li&gt;
&lt;li&gt;Automate repetitive data movements (moving data from one location to another)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. SQL Server Analysis Services (SSAS)
&lt;/h2&gt;

&lt;p&gt;SQL Server Analysis Services (SSAS) is a component of Microsoft SQL Server used for analyzing large amounts of data and helping users make business decisions.&lt;/p&gt;

&lt;p&gt;It is designed for analytics.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of Analysis in SSAS
&lt;/h3&gt;

&lt;p&gt;SSAS supports two main models.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Multidimensional Model (Cube)
&lt;/h3&gt;

&lt;p&gt;It is called a &lt;strong&gt;Cube&lt;/strong&gt;, which simply means data is organized along multiple dimensions.&lt;/p&gt;

&lt;h4&gt;
  
  
  Dimensions
&lt;/h4&gt;

&lt;p&gt;Something you want to analyze.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product&lt;/li&gt;
&lt;li&gt;Customer&lt;/li&gt;
&lt;li&gt;Year&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Measures
&lt;/h4&gt;

&lt;p&gt;Measures are numbers that you calculate.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sales&lt;/li&gt;
&lt;li&gt;Profit&lt;/li&gt;
&lt;li&gt;Quantity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Based on dimensions and measures, SSAS precomputes all the values so that results can be returned without waiting time.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Tabular Model
&lt;/h3&gt;

&lt;p&gt;Instead of keeping many pre-made summaries, the model organizes all records into highly optimized columns and performs calculations very quickly whenever they are requested.&lt;/p&gt;

&lt;p&gt;It is currently the most commonly used model since it uses &lt;strong&gt;DAX&lt;/strong&gt;, which is also used by Power BI.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;SSAS is an analytic engine. It creates analytical models.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  5. SQL Server Reporting Services (SSRS)
&lt;/h2&gt;

&lt;p&gt;SQL Server Reporting Services (SSRS) is a component of Microsoft SQL Server used to create, manage, and deliver reports.&lt;/p&gt;

&lt;p&gt;SSRS can export reports as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PDF&lt;/li&gt;
&lt;li&gt;Excel&lt;/li&gt;
&lt;li&gt;Word&lt;/li&gt;
&lt;li&gt;CSV&lt;/li&gt;
&lt;li&gt;XML&lt;/li&gt;
&lt;li&gt;HTML (Web Page)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It can create:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bar charts&lt;/li&gt;
&lt;li&gt;Pie charts&lt;/li&gt;
&lt;li&gt;Line charts&lt;/li&gt;
&lt;li&gt;Gauge charts&lt;/li&gt;
&lt;li&gt;Maps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also allows interactive reports such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search&lt;/li&gt;
&lt;li&gt;Filter&lt;/li&gt;
&lt;li&gt;Sort&lt;/li&gt;
&lt;li&gt;Drill down into details&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SSRS runs queries, retrieves data, formats it, and displays or exports it.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. SQL Server Replication Service
&lt;/h2&gt;

&lt;p&gt;Replication means copying and synchronizing data between databases.&lt;/p&gt;

&lt;p&gt;It is the process of copying data from one database to another and keeping the copies updated.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of Replication in SQL Server
&lt;/h3&gt;

&lt;h3&gt;
  
  
  1. Snapshot Replication
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Copies all the data at once at fixed intervals.&lt;/li&gt;
&lt;li&gt;Example: Once a week or once a month.&lt;/li&gt;
&lt;li&gt;Every snapshot copies the entire database again.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Best used when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The database is small.&lt;/li&gt;
&lt;li&gt;Data does not change frequently.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not recommended for large databases.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Transactional Replication
&lt;/h3&gt;

&lt;p&gt;Transactional Replication sends only the changes made to the database instead of copying the entire database.&lt;/p&gt;

&lt;p&gt;Whenever data is inserted, updated, or deleted, those changes are quickly sent to the subscribers.&lt;/p&gt;

&lt;p&gt;Best for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Large databases&lt;/li&gt;
&lt;li&gt;Frequently changing data&lt;/li&gt;
&lt;li&gt;Real-time reporting&lt;/li&gt;
&lt;li&gt;High-speed synchronization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantage&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One-way updates only (Publisher → Subscriber).&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. Merge Replication
&lt;/h3&gt;

&lt;p&gt;In Merge Replication, both databases can make changes.&lt;/p&gt;

&lt;p&gt;SQL Server combines (merges) the changes.&lt;/p&gt;

&lt;p&gt;If both databases update the same record differently, a conflict occurs, and SQL Server resolves it using conflict resolution rules.&lt;/p&gt;

&lt;p&gt;Best for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mobile applications&lt;/li&gt;
&lt;li&gt;Salespeople working offline&lt;/li&gt;
&lt;li&gt;Branch offices&lt;/li&gt;
&lt;li&gt;Point-of-Sale (POS) systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  SQL Server Replication Components
&lt;/h2&gt;

&lt;p&gt;Replication involves three main roles.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Publisher
&lt;/h3&gt;

&lt;p&gt;The main database that owns the original data.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Distributor
&lt;/h3&gt;

&lt;p&gt;Stores replication information and delivers changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Subscriber
&lt;/h3&gt;

&lt;p&gt;Receives the copied data.&lt;/p&gt;




&lt;h2&gt;
  
  
  Terminated Services in SQL Server 2025 (Available in SQL Server 2022)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  7. Data Quality Services (DQS)
&lt;/h3&gt;

&lt;p&gt;Used for cleaning and standardizing data.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Master Data Services (MDS)
&lt;/h3&gt;

&lt;p&gt;Used for managing master data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Master Data&lt;/strong&gt; is data that is used by multiple databases.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Company list&lt;/li&gt;
&lt;li&gt;Product list&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Reason for Termination
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Low adoption compared to other SQL Server services like the Database Engine.&lt;/li&gt;
&lt;li&gt;Shift toward Microsoft Fabric and Azure.&lt;/li&gt;
&lt;li&gt;Better cloud solutions are available.&lt;/li&gt;
&lt;li&gt;AI has changed data quality processes.&lt;/li&gt;
&lt;li&gt;High maintenance cost.&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;Microsoft SQL Server is much more than just a database. Along with the Database Engine, it provides powerful services for data integration (SSIS), analytics (SSAS), reporting (SSRS), machine learning, and replication. Understanding these components helps you build, manage, analyze, and maintain enterprise-level database solutions more effectively.&lt;/p&gt;

&lt;p&gt;As Microsoft continues shifting its focus toward Azure and Microsoft Fabric, some legacy services such as Data Quality Services (DQS) and Master Data Services (MDS) are being retired, while the core Database Engine remains the foundation across Microsoft's SQL platforms.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>database</category>
      <category>microsoft</category>
      <category>sql</category>
    </item>
    <item>
      <title>Project Object Model</title>
      <dc:creator>Kathir</dc:creator>
      <pubDate>Fri, 10 Jul 2026 17:29:18 +0000</pubDate>
      <link>https://dev.to/kathir_2911/project-object-model-5a6f</link>
      <guid>https://dev.to/kathir_2911/project-object-model-5a6f</guid>
      <description>&lt;p&gt;Yesterday, we went through Maven. Now, we are going to learn about the Project Object Model (POM).&lt;/p&gt;

&lt;h2&gt;
  
  
  POM
&lt;/h2&gt;

&lt;p&gt;Project object model is the fundamental unit of work in Maven.  It is an XML file that contains information about the project and configuration details used by Maven to build the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Super POM
&lt;/h2&gt;

&lt;p&gt;Super POM is the default POM that maven provides internally.  Every maven project inherits from the Super pom even if there is no mentioning.&lt;/p&gt;

&lt;p&gt;pom.xml doesn't start from scratch. Maven first loads the Super POM and then merges the pom.xml with it.&lt;/p&gt;

&lt;p&gt;Super POM contains some defaults:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Central Repository= Even if the pom.xml doesn't mention a specific repository, maven downloads dependencies from maven central because super POM includes it.&lt;/li&gt;
&lt;li&gt;Default Build directory=&amp;gt; Super POM tells that the target is where build should be present.&lt;/li&gt;
&lt;li&gt;Plugin Reposity=&amp;gt; The super pom tells Maven where to download plugins such as surefire plugin, compiler plugin, JAR plugin.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Effective POM
&lt;/h2&gt;

&lt;p&gt;Super POM +pom.xml is what Maven actually uses during the build.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minimal POM
&lt;/h2&gt;

&lt;p&gt;The minimum requirement for a POM:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;project (root)&lt;/li&gt;
&lt;li&gt;modelVersion= should be set to 4.0.0 which is the version of POM XML model&lt;/li&gt;
&lt;li&gt;groupId&lt;/li&gt;
&lt;li&gt;artifactId&lt;/li&gt;
&lt;li&gt;version = which is the project version&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Object Model
&lt;/h2&gt;

&lt;p&gt;When Maven reads pom.xml, it converts pom.xml into a Java Object internally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;project&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"http://maven.apache.org/POM/4.0.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;modelVersion&amp;gt;&lt;/span&gt;4.0.0&lt;span class="nt"&gt;&amp;lt;/modelVersion&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;com.mycompany.app&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;my-app&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Internally maven creates something like this&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="nc"&gt;Project&lt;/span&gt; &lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Project&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setModelVersion&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"4.0.0"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setGroupId&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"com.mycompany.app"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setArtifactId&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"my-app"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setVersion&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"1.0"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The structure of the Java object of maven conversion is called the POM model.&lt;/p&gt;

&lt;p&gt;A POM requires groupId, artifactId, and version and these helps to form the project's fully qualified artifact name. It is in the form of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;groupId&amp;gt;:&amp;lt;artifactId&amp;gt;:&amp;lt;version&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Artifact name example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;com.mycompany.app:my-app:1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;POM helps to configure details by using defaults if they are not specified.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Every maven project has packaging type. If it is not specified in the POM then the default value be "jar".&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Inheritance
&lt;/h2&gt;

&lt;p&gt;It means that one project (child) can inherit configuration from another project (parent). This helps avoid repeating the same configurationa cross multiple projects.&lt;/p&gt;

&lt;p&gt;Project inheritance can be done using super pom and parent pom.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parent POM
&lt;/h2&gt;

&lt;p&gt;It is created with the help xml tag &lt;code&gt;&amp;lt;parent&amp;gt;&amp;lt;/parent&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;project&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"http://maven.apache.org/POM/4.0.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;modelVersion&amp;gt;&lt;/span&gt;4.0.0&lt;span class="nt"&gt;&amp;lt;/modelVersion&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;parent&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;com.mycompany.app&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;my-app&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;1&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;relativePath&amp;gt;&lt;/span&gt;../parent/pom.xl&amp;gt;/relativePath&amp;gt;
    &lt;span class="nt"&gt;&amp;lt;/parent&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;my-module&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Elements in the POM that are merged are the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;dependencies&lt;/li&gt;
&lt;li&gt;developers adn contributors&lt;/li&gt;
&lt;li&gt;plugin lists&lt;/li&gt;
&lt;li&gt;plugin execustion with matching ids&lt;/li&gt;
&lt;li&gt;plugin configuration&lt;/li&gt;
&lt;li&gt;resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Super POM cannot be edited but can be override in pom.xml file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Aggregation
&lt;/h2&gt;

&lt;p&gt;Project Aggregation is similar to Project Inheritance. But instead of specifying the parent POM from the module, it specifies modules from parent POM. By, doing it the parent project knows its modules. If a mavent command is invoked against parent project, that Maven command will then be executed to the paren'ts modules as well.&lt;/p&gt;

&lt;p&gt;It is mainly used in microservices. Since, it contains many services like web,common,api,services as projects. It is hard to run each one separately like mvn install. That is hard to maintain so we create a common parent and invoke all of it.&lt;/p&gt;

&lt;p&gt;Parent pom.xml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;modules&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;module&amp;gt;&lt;/span&gt;library-common&lt;span class="nt"&gt;&amp;lt;/module&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;module&amp;gt;&lt;/span&gt;library-api&lt;span class="nt"&gt;&amp;lt;/module&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;module&amp;gt;&lt;/span&gt;library-service&lt;span class="nt"&gt;&amp;lt;/module&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;module&amp;gt;&lt;/span&gt;library-web&lt;span class="nt"&gt;&amp;lt;/module&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;modules&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells maven that these are the project that belong together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Model Variables
&lt;/h2&gt;

&lt;p&gt;Maven allows you to reference any single-value filed from the project's POM using variables.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;${project.properyName}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;${project.groupId}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Special Maven Variables
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. project.basedir
&lt;/h3&gt;

&lt;p&gt;Represents the directory where the project is located.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. project.baseUri
&lt;/h3&gt;

&lt;p&gt;Same as project.basedir but returned as a URI (Uniform Resource Identifier= It is a string that identifes a resouce.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;schem://path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;file:/C:/projects/MyApp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. maven.build.timestamp
&lt;/h3&gt;

&lt;p&gt;Represents the UTC timestamp whent he maven build starts.&lt;/p&gt;

&lt;p&gt;Default output timestamp&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yyyy-mm-dd'T'HH:mm:ss'Z'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can customize the formal by using properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;properties&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;maven.build.timestamp.format&amp;gt;&lt;/span&gt;
        yyyy-MM-dd'T'HH:mm:ss'Z'
    &lt;span class="nt"&gt;&amp;lt;/maven.build.timestamp.format&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;properties&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Maven Properties
&lt;/h2&gt;

&lt;p&gt;Defining own reusable variable can done via &lt;code&gt;&amp;lt;properties&amp;gt;&lt;/code&gt; section.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;properties&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;propertyName&amp;gt;&lt;/span&gt;value&lt;span class="nt"&gt;&amp;lt;/properyName&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/properties&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can use it as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;${propertyName}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  UTC memory tip
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;M=Month&lt;/li&gt;
&lt;li&gt;m=Minute&lt;/li&gt;
&lt;li&gt;H=24-hours&lt;/li&gt;
&lt;li&gt;h=12-hours&lt;/li&gt;
&lt;li&gt;D=Day of year&lt;/li&gt;
&lt;li&gt;d=Day of month&lt;/li&gt;
&lt;li&gt;S=Smallest visible unit in UTC:Millisecond&lt;/li&gt;
&lt;li&gt;s=second&lt;/li&gt;
&lt;li&gt;Z=Numeric zone offset(+0530)&lt;/li&gt;
&lt;li&gt;z=Zone name (IST,UTC)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Patterns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MMM= Jul&lt;/li&gt;
&lt;li&gt;MMMM=July&lt;/li&gt;
&lt;li&gt;yyyy=2026&lt;/li&gt;
&lt;li&gt;yy=26&lt;/li&gt;
&lt;li&gt;hh:mm:ss a=02:35:20 PM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;T=&amp;gt; Separator between date and time (ISO 8601 format)&lt;/p&gt;

&lt;p&gt;Why use UTC (Coordinated Universal Time)?&lt;/p&gt;

&lt;p&gt;It provides a common time reference so sytems in different countries record the same moment consistenly.&lt;/p&gt;

&lt;h2&gt;
  
  
  POM non-default fields
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;code&gt;&amp;lt;name&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This is the human-readable name of the project.&lt;/p&gt;

&lt;p&gt;Used in Generated documentation, IDE's display, Reports.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;code&gt;&amp;lt;url&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Project homepage or repository link. Only used for documentation so it can be any link.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Properties
&lt;/h3&gt;

&lt;p&gt;This element contains value placeholder accessible anywhere within a POM.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. dependencies
&lt;/h3&gt;

&lt;p&gt;This element's childrent list dependencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. build
&lt;/h3&gt;

&lt;p&gt;This element hanles things like declaring your project's directory structure and managing plugins.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>beginners</category>
      <category>java</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Spring Boot, Spring Framework, Java, and Maven – Beginner Notes</title>
      <dc:creator>Kathir</dc:creator>
      <pubDate>Thu, 09 Jul 2026 16:48:32 +0000</pubDate>
      <link>https://dev.to/kathir_2911/spring-boot-spring-framework-java-and-maven-beginner-notes-4p47</link>
      <guid>https://dev.to/kathir_2911/spring-boot-spring-framework-java-and-maven-beginner-notes-4p47</guid>
      <description>&lt;h2&gt;
  
  
  Spring Boot Overview
&lt;/h2&gt;

&lt;p&gt;Spring Boot is maintained by VMware.&lt;/p&gt;

&lt;p&gt;Before understanding Spring Boot, it helps to know how Java evolved.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Java (Java SE)&lt;/strong&gt; = The programming language and the basic platform.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Java EE&lt;/strong&gt; = Java along with Enterprise APIs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jakarta EE&lt;/strong&gt; = The modern continuation of Java EE.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;strong&gt;Spring Framework&lt;/strong&gt; is the core framework, whereas &lt;strong&gt;Spring Boot&lt;/strong&gt; is an opinionated layer built on top of the Spring Framework. It automatically configures many components, manages dependencies, provides embedded servers, and makes it much easier to build and run Spring applications.&lt;/p&gt;

&lt;p&gt;Spring itself is built on top of Java and frequently relies on Jakarta EE specifications internally.&lt;/p&gt;

&lt;p&gt;Internally, Spring Boot uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;jakarta.servlet&lt;/code&gt; for handling HTTP requests.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;jakarta.persistence&lt;/code&gt; for JPA entities.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;jakarta.validation&lt;/code&gt; for Bean Validation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rather than requiring developers to work directly with Jakarta APIs, Spring provides its own programming model using annotations such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;@RestController&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;@Autowired&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also offers Spring Data JPA while internally using Jakarta technologies.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Maven?
&lt;/h2&gt;

&lt;p&gt;Maven is primarily a project management and build automation tool. It helps manage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Builds&lt;/li&gt;
&lt;li&gt;Dependencies&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;li&gt;Software Configuration Management (SCM)&lt;/li&gt;
&lt;li&gt;Releases&lt;/li&gt;
&lt;li&gt;Reporting&lt;/li&gt;
&lt;li&gt;Distribution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Maven improves the build process by following standard conventions and best practices, helping teams develop faster while increasing the chances of successful builds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Artifact and Resolution
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Artifact
&lt;/h3&gt;

&lt;p&gt;In Maven, an artifact is anything that Maven either produces or downloads.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resolution
&lt;/h3&gt;

&lt;p&gt;Resolution refers to the process of locating and downloading project dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maven Configuration Levels
&lt;/h2&gt;

&lt;p&gt;Maven configuration exists at three different levels.&lt;/p&gt;

&lt;h3&gt;
  
  
  Project Level
&lt;/h3&gt;

&lt;p&gt;Most of the static configuration is stored inside the &lt;code&gt;pom.xml&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Static configuration means the settings are common for everyone working on the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation Level
&lt;/h3&gt;

&lt;p&gt;Configuration that is applied once for a Maven installation.&lt;/p&gt;

&lt;h3&gt;
  
  
  User Level
&lt;/h3&gt;

&lt;p&gt;Configuration specific to an individual user.&lt;/p&gt;

&lt;p&gt;Configuration file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;${user.home}/.m2/settings.xml&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Maven Repositories
&lt;/h2&gt;

&lt;p&gt;Maven works with three types of repositories.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Local Repository (stored on your computer)&lt;/li&gt;
&lt;li&gt;Central Repository (available on the Internet)&lt;/li&gt;
&lt;li&gt;Remote Repository (maintained by a company or organization)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A repository is simply a folder where Maven stores downloaded dependencies and generated artifacts.&lt;/p&gt;

&lt;p&gt;The default Local Repository location is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;${user.home}/.m2/repository/&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Proxy Server
&lt;/h2&gt;

&lt;p&gt;Normally, when downloading a file, your computer sends the request directly to the website.&lt;/p&gt;

&lt;p&gt;However, many companies do not allow employees to access the Internet directly. Instead, every request must pass through a proxy server.&lt;/p&gt;

&lt;p&gt;A proxy server acts as a middleman between your computer and the Internet.&lt;/p&gt;

&lt;p&gt;Companies use proxy servers for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Monitoring&lt;/li&gt;
&lt;li&gt;Access Control&lt;/li&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Maven Proxy Configuration
&lt;/h2&gt;

&lt;p&gt;Sometimes Maven displays errors such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Could not transfer artifact"&lt;/li&gt;
&lt;li&gt;"Connection timed out"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These usually indicate that the company network uses a proxy server which blocks Maven from downloading dependencies.&lt;/p&gt;

&lt;p&gt;To solve this, configure the proxy in Maven.&lt;/p&gt;

&lt;p&gt;Edit:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;${user.home}/.m2/settings.xml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Inside this file, configure the proxy using fields like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id&lt;/li&gt;
&lt;li&gt;active&lt;/li&gt;
&lt;li&gt;protocol&lt;/li&gt;
&lt;li&gt;host (hostname)&lt;/li&gt;
&lt;li&gt;port&lt;/li&gt;
&lt;li&gt;username&lt;/li&gt;
&lt;li&gt;password&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Configure Parallel Artifact Resolution
&lt;/h2&gt;

&lt;p&gt;By default, Maven downloads up to five artifacts (from different groups) simultaneously.&lt;/p&gt;

&lt;p&gt;To change the thread pool size temporarily:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn &lt;span class="nt"&gt;-Dmaven&lt;/span&gt;.artifact.threads&lt;span class="o"&gt;=&lt;/span&gt;1 verify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a permanent configuration, use the &lt;code&gt;MAVEN_OPTS&lt;/code&gt; environment variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MAVEN_OPTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;-Dmaven&lt;/span&gt;.artifact.threads&lt;span class="o"&gt;=&lt;/span&gt;3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Maven Archetype
&lt;/h2&gt;

&lt;p&gt;An Archetype is Maven's project templating toolkit.&lt;/p&gt;

&lt;p&gt;A Maven Archetype is a predefined project template used to generate the initial structure of a Maven project.&lt;/p&gt;

&lt;p&gt;Start the interactive wizard using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn archetype:generate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The wizard asks for values such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Archetype&lt;/li&gt;
&lt;li&gt;GroupId&lt;/li&gt;
&lt;li&gt;ArtifactId&lt;/li&gt;
&lt;li&gt;Version&lt;/li&gt;
&lt;li&gt;Package Name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A non-interactive example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn archetype:generate &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-DgroupId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;com.example &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-DartifactId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;my-app &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-DarchetypeArtifactId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;maven-archetype-quickstart &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-DarchetypeGroupId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;org.apache.maven.archetypes &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-DarchetypeVersion&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.5 &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-DinteractiveMode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;-D&lt;/code&gt; means &lt;strong&gt;Define a system property&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, &lt;code&gt;-DgroupId=com.example&lt;/code&gt; creates the system property named &lt;code&gt;groupId&lt;/code&gt; with the value &lt;code&gt;com.example&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The generated project structure looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-app/
├── pom.xml
└── src
    ├── main
    │   └── java
    │       └── com/example/App.java
    └── test
        └── java
            └── com/example/AppTest.java
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Common Maven Archetypes
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Archetype&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;maven-archetype-quickstart&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Simple Java Application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;maven-archetype-webapp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Java Web Application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;maven-archetype-simple&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Basic Maven Project&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Create Your Own Maven Archetype
&lt;/h2&gt;

&lt;p&gt;Convert an existing project into an Archetype using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn archetype:create-from-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install the generated Archetype.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;target/generated-sources/archetype
mvn &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What is MVN?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;mvn&lt;/code&gt; is &lt;strong&gt;not&lt;/strong&gt; a Java class.&lt;/p&gt;

&lt;p&gt;It is a shell script on Linux/macOS and a batch file (&lt;code&gt;mvn.cmd&lt;/code&gt;) on Windows.&lt;/p&gt;

&lt;p&gt;Its responsibility is to start the Maven Java application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Launching Maven Archetype
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1 – Execute &lt;code&gt;mvn&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;mvn&lt;/code&gt; script (or &lt;code&gt;mvn.cmd&lt;/code&gt; on Windows):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finds the Java installation.&lt;/li&gt;
&lt;li&gt;Sets the required environment variables.&lt;/li&gt;
&lt;li&gt;Launches the Maven Java program.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At this point, one Java application starts: &lt;strong&gt;Maven itself.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 – Maven Starts
&lt;/h3&gt;

&lt;p&gt;The JVM loads the Maven CLI class &lt;code&gt;org.apache.maven.cli.MavenCli&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is the main Java application responsible for Maven execution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3 – Maven Parses the Command
&lt;/h3&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Plugin: &lt;code&gt;archetype&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Goal: &lt;code&gt;generate&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4 – Maven Loads the Archetype Plugin
&lt;/h3&gt;

&lt;p&gt;If the plugin is not already available in the local repository, Maven downloads it.&lt;/p&gt;

&lt;p&gt;After downloading, Maven loads the plugin classes into the same JVM where the Maven CLI is already running.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5 – Maven Calls the Plugin
&lt;/h3&gt;

&lt;p&gt;The plugin receives all the supplied values and generates the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flow of &lt;code&gt;mvn spring-boot:run&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mvn spring-boot:run
        │
        ▼
Shell Script (mvn)
        │
        ▼
Starts JVM #1
        │
        ▼
MavenCli
        │
        ▼
Reads pom.xml
        │
        ▼
Loads Spring Boot Maven Plugin
        │
        ▼
Compiles the Project
        │
        ▼
Starts JVM #2
        │
        ▼
DemoApplication.main()
        │
        ▼
SpringApplication.run()
        │
        ▼
Embedded Tomcat Starts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When running &lt;code&gt;mvn spring-boot:run&lt;/code&gt;, two JVMs are usually involved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Doesn't Maven Run the Application in the Same JVM?
&lt;/h2&gt;

&lt;p&gt;Maven is a build tool, whereas the application is the software being built.&lt;/p&gt;

&lt;p&gt;Keeping them separate provides several advantages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the application crashes, Maven continues running.&lt;/li&gt;
&lt;li&gt;The application's classpath remains isolated from Maven's classpath.&lt;/li&gt;
&lt;li&gt;The application can be stopped and restarted independently.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Commands and Number of JVMs
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;JVMs&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mvn compile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Usually 1 (Maven only)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mvn archetype:generate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1 (Maven + Archetype Plugin in the same JVM)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mvn spring-boot:run&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Usually 2 (Maven + Spring Boot Application)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mvn test&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Usually 2 (Maven + Test JVM)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;java -jar app.jar&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1 (Application only)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JVM #1&lt;/strong&gt; = Maven itself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JVM #2&lt;/strong&gt; = Spring Boot application.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  pom.xml
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;pom.xml&lt;/code&gt; file contains the &lt;strong&gt;Project Object Model (POM)&lt;/strong&gt; for a project.&lt;/p&gt;

&lt;p&gt;The POM is the fundamental unit of Maven.&lt;/p&gt;

&lt;p&gt;It is important to remember that Maven is project-centric, meaning everything revolves around the concept of a project.&lt;/p&gt;

&lt;p&gt;The POM contains every important piece of information related to the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;Tomorrow we will go through the complete details of &lt;code&gt;pom.xml&lt;/code&gt; in depth.&lt;/p&gt;

</description>
      <category>backend</category>
      <category>beginners</category>
      <category>java</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Spring Boot Notes — Day 1 | My Learning Notes from the Spring Boot Documentation</title>
      <dc:creator>Kathir</dc:creator>
      <pubDate>Wed, 08 Jul 2026 16:48:25 +0000</pubDate>
      <link>https://dev.to/kathir_2911/spring-boot-notes-day-1-my-learning-notes-from-the-spring-boot-documentation-e4</link>
      <guid>https://dev.to/kathir_2911/spring-boot-notes-day-1-my-learning-notes-from-the-spring-boot-documentation-e4</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I am currently going through the Spring Boot documentation and documenting my learning journey. These are my Day 1 notes. I have organized my notes into a blog format without changing the concepts or content.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What is Spring?
&lt;/h2&gt;

&lt;p&gt;Spring is a Java framework. Provides features like Dependency Injection (IoC), MVC, Security, Data Access, REST APIs, Transactions, AOP (Aspect Oriented Programming).&lt;/p&gt;

&lt;p&gt;Spring is very powerful but it requires lot of configurations like configure DispatcherServlet, Tomcat, XML, Beans, Database, Properties, Jackson, Logging, Context.&lt;/p&gt;

&lt;p&gt;Developers spent more time configuring the configurations than coding. So, the spring team developed Spring Boot.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Spring = Powerful Engine

Spring Boot = Spring + Automation + Defaults
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boot doesn't replace Spring. It sits on tops of Spring.&lt;/p&gt;

&lt;p&gt;Spring Boot doesn't create application for you. It is an assistant and you still write the code but removes repetitive works.&lt;/p&gt;




&lt;h2&gt;
  
  
  Stand-alone Application
&lt;/h2&gt;

&lt;p&gt;With Spring Boot you can build stand-alone application.&lt;/p&gt;

&lt;p&gt;Stand-alone application = Before Spring Boot, You had to install Tomcat, Jetty, WildFly, GlassFish and then deploy &lt;code&gt;.war&lt;/code&gt; into the server.&lt;/p&gt;

&lt;p&gt;You depended on external server but stand-along application do have everything it needs inside it.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myapp.jar

├── Application code
├── Spring
├── Tomcat
├── Libraries
├── Configurations
└── Dependencies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;myapp.jar contains Application code, Spring, Tomcat, Libraries, Configurations, Dependencies.&lt;/p&gt;




&lt;h2&gt;
  
  
  Production Grade Application
&lt;/h2&gt;

&lt;p&gt;It helps to build production grade application.&lt;/p&gt;

&lt;p&gt;(Application suitable for running at real-time environment).&lt;/p&gt;

&lt;p&gt;Production application need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Monitoring&lt;/li&gt;
&lt;li&gt;Logging&lt;/li&gt;
&lt;li&gt;Error Handling&lt;/li&gt;
&lt;li&gt;Health Checks&lt;/li&gt;
&lt;li&gt;Metrics&lt;/li&gt;
&lt;li&gt;External Configuration&lt;/li&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Logging
&lt;/h2&gt;

&lt;p&gt;Logging- It means recording what your application is doing from start to end.&lt;/p&gt;

&lt;p&gt;These recording messages is called logs.&lt;/p&gt;

&lt;p&gt;Without logging, You wouldn't know if something went wrong.&lt;/p&gt;

&lt;p&gt;Logback is the default logging implementation used by Spring Boot since it is fast, reliable, easy configuration and well integrated with SLF4J.&lt;/p&gt;

&lt;p&gt;Other logging framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log4j&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  SLF4J
&lt;/h2&gt;

&lt;p&gt;SLF4J = Simple Logging Facade For Java.&lt;/p&gt;

&lt;p&gt;It is not a logging implementation but a common interface.&lt;/p&gt;

&lt;p&gt;Code uses SLF4J and it forwards logging calls to the actual logging framework.&lt;/p&gt;




&lt;h2&gt;
  
  
  Database Connection Pool
&lt;/h2&gt;

&lt;p&gt;Database Connection Pool = It is a collection of pre-created database connections that remain available while the application is running, so they can be reused instead of creating a new connection for every database request.&lt;/p&gt;

&lt;p&gt;Some connection pool are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hikari&lt;/li&gt;
&lt;li&gt;C3P0&lt;/li&gt;
&lt;li&gt;DBCP&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  HikariCP
&lt;/h2&gt;

&lt;p&gt;HikariCP = It is a high performance connection pool.&lt;/p&gt;

&lt;p&gt;Spring Boot prefers it since it is very fast, low memory usage, excellent performance under heavy load and have simple configuration.&lt;/p&gt;




&lt;h2&gt;
  
  
  JSON
&lt;/h2&gt;

&lt;p&gt;JSON stands for JavaScript Object Notation.&lt;/p&gt;

&lt;p&gt;It is the standard format for exchanging data between systems.&lt;/p&gt;

&lt;p&gt;JSON libraries:&lt;/p&gt;

&lt;h3&gt;
  
  
  Jackson
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;It converts Objects to JSON.&lt;/li&gt;
&lt;li&gt;Json back to java objects automatically.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Gson
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Created by Google.&lt;/li&gt;
&lt;li&gt;Also converts objects to JSON.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  JSON-B
&lt;/h3&gt;

&lt;p&gt;JSON binding.&lt;/p&gt;

&lt;p&gt;It is a java standard unlike jackson which not java standard api but a third party library.&lt;/p&gt;




&lt;h2&gt;
  
  
  Embedded Server
&lt;/h2&gt;

&lt;p&gt;Embedded Server =&amp;gt; It is a web server that is packaged inside your application and starts automatically when your application starts.&lt;/p&gt;

&lt;p&gt;You don't have to manually install or configure a separate web server.&lt;/p&gt;

&lt;p&gt;Spring Boot default uses Tomcat as an embedded server becuase it is mature, stable and widely used but you can replace it with:&lt;/p&gt;

&lt;h3&gt;
  
  
  Jetty
&lt;/h3&gt;

&lt;p&gt;Known for beging light weight and embeddable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Undertow
&lt;/h3&gt;

&lt;p&gt;A high performance web server forcused on speed and low resource usage.&lt;/p&gt;




&lt;h2&gt;
  
  
  Metrics
&lt;/h2&gt;

&lt;p&gt;Metric = Micrometer is the mertics library use by spring boot.&lt;/p&gt;

&lt;p&gt;It collects information different parts of the application.&lt;/p&gt;




&lt;h2&gt;
  
  
  Spring Boot Defaults
&lt;/h2&gt;

&lt;p&gt;Spring Boot uses Defaults but you can also change them by your configurations.&lt;/p&gt;




&lt;h2&gt;
  
  
  Spring Platform
&lt;/h2&gt;

&lt;p&gt;It is a Spring Ecosystem.&lt;/p&gt;

&lt;p&gt;The Spring platform is the broader colllection of Spring projects built around the Spring framework.&lt;/p&gt;

&lt;p&gt;It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spring Framework (core)&lt;/li&gt;
&lt;li&gt;Spring Boot&lt;/li&gt;
&lt;li&gt;Spring Data&lt;/li&gt;
&lt;li&gt;Spring Security&lt;/li&gt;
&lt;li&gt;Spring cloud-microservices&lt;/li&gt;
&lt;li&gt;Spring Batch- batch processing&lt;/li&gt;
&lt;li&gt;Spring Integration-enterprise integration&lt;/li&gt;
&lt;li&gt;Spring WebFlux-reactive web applications&lt;/li&gt;
&lt;li&gt;Spring AOP&lt;/li&gt;
&lt;li&gt;Spring JDBC&lt;/li&gt;
&lt;li&gt;Spring ORM&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Simple Analogy
&lt;/h2&gt;

&lt;p&gt;Think of a smartphone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Android OS = Spring Framework

Android ecosystem
(Playstore, Maps, Gmail, etc.)
        =
Spring Platform
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boot is built on spring framework and integrates the spring ecosystem.&lt;/p&gt;

&lt;p&gt;Inegrates means spring boot makes different spring projects work together easy with little or no configurations.&lt;/p&gt;




&lt;h2&gt;
  
  
  GraalVM
&lt;/h2&gt;

&lt;p&gt;GraalVM is a high performance Java Virtual Machine and development platform that can run Java and several other languages.&lt;/p&gt;

&lt;p&gt;Its most popular feature is that it can compile java pplications into native executables (.exe/ Linux binary).&lt;/p&gt;




&lt;h2&gt;
  
  
  Problem with JVM
&lt;/h2&gt;

&lt;p&gt;The JVM provides many features but it takes hundreds of milli seconds or even a few seconds for large appliations and memory usage is relatively high and a jdk or jre must be installed on the machine.&lt;/p&gt;

&lt;p&gt;For long-running applications, JVM is best since startup time is not implicible.&lt;/p&gt;




&lt;h2&gt;
  
  
  GraalVM Native Image
&lt;/h2&gt;

&lt;p&gt;Spring Boot applications can be converted into a Native Image.&lt;/p&gt;

&lt;p&gt;native-image is a tool provided by Graal VM.&lt;/p&gt;

&lt;p&gt;Converts jar to .exe.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why GraalVM Native Image?
&lt;/h2&gt;

&lt;p&gt;For serverless like aws lambda the application only starts when someone sends a request so graal vm natie image is highly recommended.&lt;/p&gt;

&lt;p&gt;Suppose application takes 4 sec to start and the user waits for that 4 sec before the actual work even begins.&lt;/p&gt;

&lt;p&gt;This is called cold start.&lt;/p&gt;

&lt;p&gt;Memory also decrease for native image compared to spring boot application.&lt;/p&gt;

&lt;p&gt;Microservices are best for GraalVM native image.&lt;/p&gt;




&lt;h2&gt;
  
  
  Build Native Image
&lt;/h2&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn &lt;span class="nt"&gt;-Pnative&lt;/span&gt; native:compile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of producting &lt;code&gt;.jar&lt;/code&gt; file it produces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;target/
└── application.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;p&gt;Today I learned why Spring Boot was created, how it removes repetitive configurations, how stand-alone applications work, production-grade features, logging, connection pooling, JSON libraries, embedded servers, metrics, the Spring Platform, and how GraalVM Native Image helps reduce startup time and memory usage for serverless applications and microservices.&lt;/p&gt;

&lt;p&gt;These are my Day 1 learning notes while going through the official Spring Boot documentation. In the upcoming days, I'll continue exploring more Spring Boot concepts in depth.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>java</category>
      <category>learning</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Day 2: Understanding MySQL Client-Server Communication, Protocols, and Pages</title>
      <dc:creator>Kathir</dc:creator>
      <pubDate>Tue, 07 Jul 2026 15:55:20 +0000</pubDate>
      <link>https://dev.to/kathir_2911/day-2-understanding-mysql-client-server-communication-protocols-and-pages-379j</link>
      <guid>https://dev.to/kathir_2911/day-2-understanding-mysql-client-server-communication-protocols-and-pages-379j</guid>
      <description>&lt;h2&gt;
  
  
  📚 Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Why do we need Protocol?&lt;/li&gt;
&lt;li&gt;What Happens When Java Connects?&lt;/li&gt;
&lt;li&gt;Complete MySQL Request Flow&lt;/li&gt;
&lt;li&gt;
MySQL Server Components

&lt;ul&gt;
&lt;li&gt;Connection Manager&lt;/li&gt;
&lt;li&gt;Authentication &amp;amp; Authorization&lt;/li&gt;
&lt;li&gt;SQL Parser&lt;/li&gt;
&lt;li&gt;Preprocessor&lt;/li&gt;
&lt;li&gt;Optimizer&lt;/li&gt;
&lt;li&gt;Executor&lt;/li&gt;
&lt;li&gt;Storage Engine&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Pages in MySQL&lt;/li&gt;
&lt;li&gt;Inside a Page&lt;/li&gt;
&lt;li&gt;How Data is Organized&lt;/li&gt;
&lt;li&gt;Why Pages Instead of Rows?&lt;/li&gt;
&lt;li&gt;Pages Can Store More Than Rows&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 2&lt;/strong&gt; of my MySQL learning journey.&lt;/p&gt;

&lt;p&gt;In the previous blog, I learned about &lt;strong&gt;MySQL Storage Engines&lt;/strong&gt; and &lt;strong&gt;MVCC&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Today, I learned how a Java application communicates with a MySQL server, why protocols are necessary, what happens internally when a connection is established, and how InnoDB stores data using pages.&lt;/p&gt;

&lt;p&gt;In this blog, I'll be covering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why do we need Protocols?&lt;/li&gt;
&lt;li&gt;What happens when Java connects to MySQL?&lt;/li&gt;
&lt;li&gt;MySQL Request Flow&lt;/li&gt;
&lt;li&gt;MySQL Server Components&lt;/li&gt;
&lt;li&gt;What are Pages in MySQL?&lt;/li&gt;
&lt;li&gt;Why does InnoDB use Pages?&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why do we need Protocol?
&lt;/h2&gt;

&lt;p&gt;Protocols are simply a set of rules.&lt;/p&gt;

&lt;p&gt;Imagine two people who speak two different languages. In this way, they can't understand each other. To be able to understand each other, they need a common language.&lt;/p&gt;

&lt;p&gt;This problem takes place in computers also.&lt;/p&gt;

&lt;p&gt;Java applications don't understand how MySQL stores data, and MySQL doesn't understand Java objects.&lt;/p&gt;

&lt;p&gt;So both agree on one common language:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The MySQL Client/Server Protocol&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This protocol defines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to connect&lt;/li&gt;
&lt;li&gt;How to authenticate&lt;/li&gt;
&lt;li&gt;How to send SQL queries&lt;/li&gt;
&lt;li&gt;How to receive results&lt;/li&gt;
&lt;li&gt;How to report errors&lt;/li&gt;
&lt;li&gt;How to close the connection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without this protocol, Java and MySQL could never communicate.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Happens When Java Connects?
&lt;/h2&gt;

&lt;p&gt;Consider the following Java code:&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="nc"&gt;Connection&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DriverManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getConnection&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"jdbc:mysql://192.168.1.10:3306/company"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"password"&lt;/span&gt;
&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 1
&lt;/h3&gt;

&lt;p&gt;The JDBC Driver extracts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IP Address: &lt;code&gt;192.168.1.10&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Port: &lt;code&gt;3306&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Database: &lt;code&gt;company&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Username: &lt;code&gt;root&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Step 2
&lt;/h3&gt;

&lt;p&gt;The operating system creates a &lt;strong&gt;TCP Socket&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A socket is one endpoint of a network communication channel.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 3
&lt;/h3&gt;

&lt;p&gt;TCP performs the &lt;strong&gt;Three-Way Handshake&lt;/strong&gt; to establish a reliable connection.&lt;/p&gt;




&lt;h2&gt;
  
  
  Complete MySQL Request Flow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Java Application
        │
        ▼
JDBC Driver
        │
        ▼
MySQL Client/Server Protocol (Application Layer)
        │
        ▼
TCP (Reliable Transport)
        │
        ▼
IP (Routing)
        │
        ▼
Ethernet / Wi-Fi
        │
        ▼
Internet / LAN
        │
        ▼
MySQL Server Socket
        │
        ▼
Connection Manager
        │
        ▼
Authentication &amp;amp; Authorization
        │
        ▼
SQL Parser
        │
        ▼
Preprocessor
        │
        ▼
Optimizer
        │
        ▼
Executor
        │
        ▼
Storage Engine
        │
        ▼
Data Files on Disk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  MySQL Server Components
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Connection Manager
&lt;/h2&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Manages client sessions&lt;/li&gt;
&lt;li&gt;Manages client threads&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Authentication &amp;amp; Authorization
&lt;/h2&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Confirms user identity&lt;/li&gt;
&lt;li&gt;Checks user permissions&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  SQL Parser
&lt;/h2&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validates SQL syntax&lt;/li&gt;
&lt;li&gt;Creates a Parse Tree&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Preprocessor
&lt;/h2&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Resolves table names&lt;/li&gt;
&lt;li&gt;Resolves column names&lt;/li&gt;
&lt;li&gt;Checks object existence&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Optimizer
&lt;/h2&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chooses an efficient execution plan&lt;/li&gt;
&lt;li&gt;Decides whether to use indexes&lt;/li&gt;
&lt;li&gt;Determines join order&lt;/li&gt;
&lt;li&gt;Optimizes query execution&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Executor
&lt;/h2&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Executes the chosen execution plan&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Storage Engine
&lt;/h2&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reads the actual data&lt;/li&gt;
&lt;li&gt;Writes the actual data&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Pages in MySQL
&lt;/h2&gt;

&lt;p&gt;InnoDB does not store tables as one big continuous block.&lt;/p&gt;

&lt;p&gt;Instead, it divides the table into &lt;strong&gt;Pages&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The table is simply a collection of many pages.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Page&lt;/strong&gt; is a fixed-size block of storage (typically &lt;strong&gt;16 KB&lt;/strong&gt; in InnoDB) that contains parts of a table, parts of an index, or other internal data.&lt;/p&gt;




&lt;h2&gt;
  
  
  Inside a Page
&lt;/h2&gt;

&lt;p&gt;Suppose a row is about &lt;strong&gt;100 bytes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;16 KB Page&lt;/strong&gt; contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;16 * 1024 = 16384 bytes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Number of rows per page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;16384 / 100 = 163 rows
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, one page can contain approximately &lt;strong&gt;163 rows&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The next page contains the next set of rows.&lt;/p&gt;

&lt;p&gt;A row is smaller than a page, and a page contains many rows.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Data is Organized
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Database
    │
    ▼
Tables
    │
    ▼
Pages
    │
    ▼
Rows
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A database contains tables.&lt;/p&gt;

&lt;p&gt;A table is stored as many pages.&lt;/p&gt;

&lt;p&gt;Each page contains many rows.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Pages Instead of Rows?
&lt;/h2&gt;

&lt;p&gt;Suppose you want to find a particular row with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Employee&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Would the SSD read only &lt;strong&gt;Row 150&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SSDs and HDDs read data in &lt;strong&gt;blocks&lt;/strong&gt;, not individual rows.&lt;/p&gt;

&lt;p&gt;So, MySQL reads the &lt;strong&gt;entire page&lt;/strong&gt;, even if you only wanted one row.&lt;/p&gt;

&lt;p&gt;Then it finds &lt;strong&gt;Row 150&lt;/strong&gt; inside that page.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pages Can Store More Than Rows
&lt;/h2&gt;

&lt;p&gt;A page doesn't always store table rows.&lt;/p&gt;

&lt;p&gt;It can also store:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Indexes&lt;/li&gt;
&lt;li&gt;Internal metadata&lt;/li&gt;
&lt;li&gt;Other internal data structures&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;Today, I learned about pages in MySQL and how Java connectivity works with MySQL.&lt;/p&gt;




&lt;p&gt;Thank you for reading!&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;Day 2&lt;/strong&gt; of my MySQL learning journey.&lt;/p&gt;

&lt;p&gt;In the next blog, I'll continue exploring more internal concepts of MySQL as I progress through my learning journey.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>database</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Day 1: Understanding MySQL Storage Engines and MVCC</title>
      <dc:creator>Kathir</dc:creator>
      <pubDate>Mon, 06 Jul 2026 16:05:49 +0000</pubDate>
      <link>https://dev.to/kathir_2911/day-1-understanding-mysql-storage-engines-and-mvcc-29ea</link>
      <guid>https://dev.to/kathir_2911/day-1-understanding-mysql-storage-engines-and-mvcc-29ea</guid>
      <description>&lt;h2&gt;
  
  
  📚 Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;What is InnoDB?&lt;/li&gt;
&lt;li&gt;What is a Storage Engine?&lt;/li&gt;
&lt;li&gt;MySQL Server Architecture&lt;/li&gt;
&lt;li&gt;
MySQL Storage Engines

&lt;ul&gt;
&lt;li&gt;InnoDB&lt;/li&gt;
&lt;li&gt;MyISAM&lt;/li&gt;
&lt;li&gt;MEMORY Engine&lt;/li&gt;
&lt;li&gt;CSV Engine&lt;/li&gt;
&lt;li&gt;ARCHIVE Engine&lt;/li&gt;
&lt;li&gt;NDB Cluster&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;NDB Cluster Architecture&lt;/li&gt;
&lt;li&gt;Advantages of NDB Cluster&lt;/li&gt;
&lt;li&gt;Disadvantages of NDB Cluster&lt;/li&gt;
&lt;li&gt;Real World Use Cases&lt;/li&gt;
&lt;li&gt;RAM + Disk Checkpoints&lt;/li&gt;
&lt;li&gt;Example Hardware Requirement&lt;/li&gt;
&lt;li&gt;Can SQL Node and Management Node be on the Same Machine?&lt;/li&gt;
&lt;li&gt;MVCC (Multi-Version Concurrency Control)&lt;/li&gt;
&lt;li&gt;Why is MVCC Needed?&lt;/li&gt;
&lt;li&gt;Benefits of MVCC&lt;/li&gt;
&lt;li&gt;How MySQL Implements MVCC&lt;/li&gt;
&lt;li&gt;What Happens When a Row is Updated?&lt;/li&gt;
&lt;li&gt;Hidden Columns in Every InnoDB Row&lt;/li&gt;
&lt;li&gt;Read View&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When learning MySQL, one of the first concepts you should understand is the &lt;strong&gt;Storage Engine&lt;/strong&gt;. A storage engine determines how MySQL stores, retrieves, and manages data. Different storage engines are designed for different workloads, such as transaction processing, read-heavy applications, temporary data storage, historical data, and distributed databases.&lt;/p&gt;

&lt;p&gt;In this blog, I'll be covering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is a Storage Engine?&lt;/li&gt;
&lt;li&gt;Different MySQL Storage Engines&lt;/li&gt;
&lt;li&gt;InnoDB&lt;/li&gt;
&lt;li&gt;MyISAM&lt;/li&gt;
&lt;li&gt;MEMORY Engine&lt;/li&gt;
&lt;li&gt;CSV Engine&lt;/li&gt;
&lt;li&gt;ARCHIVE Engine&lt;/li&gt;
&lt;li&gt;NDB Cluster&lt;/li&gt;
&lt;li&gt;MVCC (Multi-Version Concurrency Control)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What is InnoDB?
&lt;/h2&gt;

&lt;p&gt;InnoDB is a default storage engine in MySQL. Think of it as the component that decides how your data is stored on disk and how it is managed.&lt;/p&gt;

&lt;p&gt;Without a storage engine, MySQL wouldn't know how to physically store or retrieve your data.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is a Storage Engine?
&lt;/h2&gt;

&lt;p&gt;A storage engine is the software component of a database management system responsible for how data is physically stored, retrieved, indexed and managed. It also controls features such as transactions, concurrency, crash recovery, and data access methods.&lt;/p&gt;

&lt;p&gt;A storage engine is software inside MySQL responsible for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Storing data on disk&lt;/li&gt;
&lt;li&gt;Retrieving data&lt;/li&gt;
&lt;li&gt;Managing indexes&lt;/li&gt;
&lt;li&gt;Handling transactions&lt;/li&gt;
&lt;li&gt;Recovering from crashes&lt;/li&gt;
&lt;li&gt;Controlling concurrent access&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Storage Engine =&lt;/strong&gt; The internal component that stores and manages data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database =&lt;/strong&gt; The complete software (MySQL, PostgreSQL, MongoDB, etc.)&lt;/p&gt;

&lt;p&gt;Not every database supports multiple storage engines like MySQL does. Many databases have one built-in storage engine.&lt;/p&gt;




&lt;h2&gt;
  
  
  MySQL Server Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MySQL Server
│
├── SQL Engine
│
└── Data Storage (Storage Engines)
     │
     ├── InnoDB
     ├── MyISAM
     ├── MEMORY
     ├── CSV
     ├── ARCHIVE
     └── NDB Cluster
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;MySQL Server = SQL Engine + Data Storage&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  MySQL Storage Engines
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. InnoDB
&lt;/h2&gt;

&lt;p&gt;InnoDB =&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Foreign keys&lt;/li&gt;
&lt;li&gt;Crash recovery&lt;/li&gt;
&lt;li&gt;Transactions&lt;/li&gt;
&lt;li&gt;ACID&lt;/li&gt;
&lt;li&gt;Row locking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Banking&lt;/li&gt;
&lt;li&gt;E-commerce&lt;/li&gt;
&lt;li&gt;ERP&lt;/li&gt;
&lt;li&gt;Inventory systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;InnoBase Development =&amp;gt; Full form&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. MyISAM
&lt;/h2&gt;

&lt;p&gt;MyISAM&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does not support Transactions&lt;/li&gt;
&lt;li&gt;Does not support Foreign Keys&lt;/li&gt;
&lt;li&gt;Supports only Table Locking (not Row Locking)&lt;/li&gt;
&lt;li&gt;Limited Crash Recovery&lt;/li&gt;
&lt;li&gt;Often faster for simple read-only workloads&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read-heavy applications&lt;/li&gt;
&lt;li&gt;Old web applications&lt;/li&gt;
&lt;li&gt;Static databases with frequent SELECT queries but very few updates or deletes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is lightweight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full form&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MySQL Indexed Sequential Access Method engine, created by adding indexing and improvements for MySQL.&lt;/p&gt;

&lt;p&gt;Unlike other engines, a MyISAM table is stored on your disk as three separate files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.frm&lt;/code&gt; : Stores the table definition&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.MYD&lt;/code&gt; : Stores the actual MY data&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.MYI&lt;/code&gt; : Stores the MY index&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It was the default storage engine for the MySQL relational database management system versions prior to 5.5 released in December 2009.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. MEMORY Engine
&lt;/h2&gt;

&lt;p&gt;Everything is stored in RAM.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Extremely fast&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Disadvantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data disappears when MySQL restarts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Formerly known as Heap.&lt;/p&gt;

&lt;p&gt;Creates special-purpose tables with contents that are stored in memory.&lt;/p&gt;

&lt;p&gt;Because the data is vulnerable to crashes, hardware issues, or power outages, only use these tables as temporary work areas or read-only caches for data pulled from other tables.&lt;/p&gt;

&lt;p&gt;Normally, MySQL stores tables on the hard disk, but for MEMORY the table is stored only in RAM.&lt;/p&gt;

&lt;p&gt;MEMORY is used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sessions&lt;/li&gt;
&lt;li&gt;Cache&lt;/li&gt;
&lt;li&gt;OTPs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if MySQL uses RAM it doesn't work like Redis.&lt;/p&gt;

&lt;p&gt;MySQL has to read the entire query and has to follow the pipeline even if it is present in memory, but Redis is like a hash table which gives the output.&lt;/p&gt;

&lt;p&gt;Even if session and cache may be worked with MEMORY, it is best to use Redis for it.&lt;/p&gt;

&lt;p&gt;MEMORY tables cannot be partitioned.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. CSV Engine
&lt;/h2&gt;

&lt;p&gt;Stores table as a CSV file.&lt;/p&gt;

&lt;p&gt;Useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exporting&lt;/li&gt;
&lt;li&gt;Data exchange&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you create a CSV table, the server creates a plain text data file having a name that begins with the table name and has a &lt;code&gt;.CSV&lt;/code&gt; extension.&lt;/p&gt;

&lt;p&gt;When you store data into the table, the storage engine saves it into the data file in comma-separated values format.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. ARCHIVE Engine
&lt;/h2&gt;

&lt;p&gt;Designed for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Historical records&lt;/li&gt;
&lt;li&gt;Log storage&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;High compression&lt;/li&gt;
&lt;li&gt;Saves disk space&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Limitations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Doesn't support UPDATE&lt;/li&gt;
&lt;li&gt;Doesn't support DELETE&lt;/li&gt;
&lt;li&gt;Doesn't support Transactions&lt;/li&gt;
&lt;li&gt;Doesn't support MVCC&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Designed for storing large amounts of historical data that is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rarely modified&lt;/li&gt;
&lt;li&gt;Mostly inserted&lt;/li&gt;
&lt;li&gt;Occasionally queried&lt;/li&gt;
&lt;li&gt;Highly compressible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Common use cases include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Audit logs&lt;/li&gt;
&lt;li&gt;Login history&lt;/li&gt;
&lt;li&gt;Sensor data&lt;/li&gt;
&lt;li&gt;Financial transaction history&lt;/li&gt;
&lt;li&gt;IoT event logs&lt;/li&gt;
&lt;li&gt;Web server logs&lt;/li&gt;
&lt;li&gt;Old application events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These records are usually never updated.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. NDB Cluster
&lt;/h2&gt;

&lt;p&gt;NDB Cluster (Network Database Cluster Engine)&lt;/p&gt;

&lt;p&gt;It is a MySQL storage engine designed for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High availability&lt;/li&gt;
&lt;li&gt;Fault tolerance&lt;/li&gt;
&lt;li&gt;Distributed databases&lt;/li&gt;
&lt;li&gt;In-memory processing&lt;/li&gt;
&lt;li&gt;Automated replication&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unlike InnoDB, which stores data on a single MySQL server, NDB stores data across multiple machines (nodes).&lt;/p&gt;

&lt;p&gt;Used for applications like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Banking&lt;/li&gt;
&lt;li&gt;Telecom&lt;/li&gt;
&lt;li&gt;Stock Exchanges&lt;/li&gt;
&lt;li&gt;Airline Reservations&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  NDB Cluster Architecture
&lt;/h2&gt;

&lt;p&gt;NDB Cluster consists of three node types.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Management Node (MGM)
&lt;/h2&gt;

&lt;p&gt;Think of it as the manager.&lt;/p&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Starts the cluster&lt;/li&gt;
&lt;li&gt;Stops the cluster&lt;/li&gt;
&lt;li&gt;Stores configuration&lt;/li&gt;
&lt;li&gt;Monitors health&lt;/li&gt;
&lt;li&gt;Coordinates nodes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It does not store application data.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Data Node
&lt;/h2&gt;

&lt;p&gt;They store:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rows&lt;/li&gt;
&lt;li&gt;Indexes&lt;/li&gt;
&lt;li&gt;Fragments&lt;/li&gt;
&lt;li&gt;Replicas&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Usually:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node A&lt;/li&gt;
&lt;li&gt;Node B&lt;/li&gt;
&lt;li&gt;Node C&lt;/li&gt;
&lt;li&gt;Node D&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Data is spread across them.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. SQL Nodes
&lt;/h2&gt;

&lt;p&gt;These are normal MySQL servers.&lt;/p&gt;

&lt;p&gt;Applications connect here.&lt;/p&gt;

&lt;p&gt;In NDB, the SQL server doesn't actually store the data.&lt;/p&gt;

&lt;p&gt;It acts like a gateway.&lt;/p&gt;




&lt;h2&gt;
  
  
  Advantages of NDB Cluster
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;High availability&lt;/li&gt;
&lt;li&gt;Automatic replication&lt;/li&gt;
&lt;li&gt;Distributed&lt;/li&gt;
&lt;li&gt;Very Fast Reads&lt;/li&gt;
&lt;li&gt;Fault Tolerance&lt;/li&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Disadvantages of NDB Cluster
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;More complex to configure&lt;/li&gt;
&lt;li&gt;Requires more RAM&lt;/li&gt;
&lt;li&gt;Higher hardware costs&lt;/li&gt;
&lt;li&gt;Not commonly used as InnoDB&lt;/li&gt;
&lt;li&gt;Some SQL features and performance characteristics differ from InnoDB, so application compatibility should be evaluated.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Real World Use Cases
&lt;/h2&gt;

&lt;p&gt;Commonly used in systems that require continuous availability and low latency, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Telecommunications subscriber databases&lt;/li&gt;
&lt;li&gt;Real-time billing systems&lt;/li&gt;
&lt;li&gt;Online gaming backends&lt;/li&gt;
&lt;li&gt;Financial trading platforms&lt;/li&gt;
&lt;li&gt;Airline reservation systems&lt;/li&gt;
&lt;li&gt;Large scale authentication services&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  RAM + Disk Checkpoints
&lt;/h2&gt;

&lt;p&gt;NDB uses RAM + Disk checkpoints.&lt;/p&gt;

&lt;p&gt;In NDB, data is primarily stored in RAM for very fast access.&lt;/p&gt;

&lt;p&gt;If data were stored only in RAM, then after a power failure data would be lost.&lt;/p&gt;

&lt;p&gt;That would be just like the MySQL MEMORY engine.&lt;/p&gt;

&lt;p&gt;To prevent this, NDB periodically creates checkpoints.&lt;/p&gt;

&lt;p&gt;A checkpoint is simply a snapshot of the current data written from RAM to disk.&lt;/p&gt;

&lt;p&gt;Think of it as pressing &lt;strong&gt;Save&lt;/strong&gt; in Microsoft Word and when saved it on disk.&lt;/p&gt;




&lt;h2&gt;
  
  
  Example Hardware Requirement
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Management Node
&lt;/h2&gt;

&lt;p&gt;Machine 1 = Management Server&lt;/p&gt;

&lt;p&gt;It does configuration only.&lt;/p&gt;

&lt;p&gt;Very little RAM required.&lt;/p&gt;

&lt;p&gt;Typically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 CPU&lt;/li&gt;
&lt;li&gt;1–2 GB RAM&lt;/li&gt;
&lt;li&gt;10 GB Disk&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  First Data Node
&lt;/h2&gt;

&lt;p&gt;Machine 2 = Stores Data&lt;/p&gt;

&lt;p&gt;Needs much more RAM.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;4 CPU Cores&lt;/li&gt;
&lt;li&gt;16 GB RAM&lt;/li&gt;
&lt;li&gt;SSD&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Second Data Node
&lt;/h2&gt;

&lt;p&gt;Machine 3 = Replica&lt;/p&gt;

&lt;p&gt;Same specifications as the first data node.&lt;/p&gt;




&lt;h2&gt;
  
  
  Can SQL Node and Management Node be on the Same Machine?
&lt;/h2&gt;

&lt;p&gt;Yes.&lt;/p&gt;

&lt;p&gt;For development or testing, you can run:&lt;/p&gt;

&lt;p&gt;Machine 1&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Management Node&lt;/li&gt;
&lt;li&gt;SQL Node&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Machine 2&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Node&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Machine 3&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Node&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  MVCC (Multi-Version Concurrency Control)
&lt;/h2&gt;

&lt;p&gt;MVCC (Multi-Version Concurrency Control) is a database concurrency mechanism that allows multiple transactions to access the same data simultaneously without blocking each other.&lt;/p&gt;

&lt;p&gt;Instead of overwriting data immediately, the database keeps multiple versions of a row.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why is MVCC Needed?
&lt;/h2&gt;

&lt;p&gt;Imagine two users.&lt;/p&gt;

&lt;p&gt;Transaction A is reading a customer's balance.&lt;/p&gt;

&lt;p&gt;Transaction B is updating that balance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Without MVCC
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A might have to wait until B finishes (locking), reducing concurrency.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  With MVCC
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A reads the old version of the row.&lt;/li&gt;
&lt;li&gt;B writes a new version of the row.&lt;/li&gt;
&lt;li&gt;Both proceed without blocking each other.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Benefits of MVCC
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Readers don't block writes.&lt;/li&gt;
&lt;li&gt;Writes don't block readers.&lt;/li&gt;
&lt;li&gt;High concurrency.&lt;/li&gt;
&lt;li&gt;Consistent snapshots for transactions.&lt;/li&gt;
&lt;li&gt;Fewer lock conflicts.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How MySQL Implements MVCC
&lt;/h2&gt;

&lt;p&gt;MySQL uses Undo Logs to reconstruct older versions of rows.&lt;/p&gt;

&lt;p&gt;Each transaction reads the appropriate version based on its snapshot.&lt;/p&gt;

&lt;p&gt;MVCC is implemented by the MySQL storage engine using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Undo Logs&lt;/li&gt;
&lt;li&gt;Transaction IDs&lt;/li&gt;
&lt;li&gt;Read Views (Snapshots)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Happens When a Row is Updated?
&lt;/h2&gt;

&lt;p&gt;When a row is updated:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The new value goes to the data page (in memory first).&lt;/li&gt;
&lt;li&gt;The old value is copied into the Undo Log.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MVCC uses the Undo Log to reconstruct old versions for transactions that started earlier.&lt;/p&gt;




&lt;h2&gt;
  
  
  Hidden Columns in Every InnoDB Row
&lt;/h2&gt;

&lt;p&gt;Every InnoDB row has hidden columns.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;DB_TRX_ID&lt;/strong&gt; = Transaction that last modified the row.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DB_ROLL_PTR&lt;/strong&gt; = Pointer to Undo Log.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DB_ROW_ID&lt;/strong&gt; = Internal row ID (if no Primary Key).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The user never sees them.&lt;/p&gt;




&lt;h2&gt;
  
  
  Read View
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Read View = Snapshot&lt;/strong&gt;&lt;/p&gt;




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

&lt;p&gt;Today, I learned about MySQL Storage Engines and MVCC. I explored the purpose of storage engines, the characteristics of different MySQL storage engines, the architecture of NDB Cluster, and how MVCC enables high concurrency by maintaining multiple versions of rows. These concepts form the foundation for understanding how MySQL manages data efficiently and reliably.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>database</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Polling and Events</title>
      <dc:creator>Kathir</dc:creator>
      <pubDate>Tue, 23 Jun 2026 03:09:09 +0000</pubDate>
      <link>https://dev.to/kathir_2911/polling-and-events-60n</link>
      <guid>https://dev.to/kathir_2911/polling-and-events-60n</guid>
      <description>&lt;h2&gt;
  
  
  Short Polling and Long Polling
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Short Polling&lt;/strong&gt; &lt;br&gt;
Short polling is a technique where the client repeatedly sends HTTP requests at fixed intervals, and the server responds immediately whether or not new data is available.  It doesn't wait for the results, and the result can be generated between any iteration of request response. The waiting time of request and response were assigned by the client or server.&lt;/p&gt;

&lt;p&gt;Request data:&lt;br&gt;
 Client---------&amp;gt;Server&lt;br&gt;
              Client&amp;lt;---------Server (No Data)&lt;br&gt;
              Client---------&amp;gt;Server&lt;br&gt;
              Client&amp;lt;---------Server (No Data)       &lt;/p&gt;

&lt;p&gt;Iteration continuous until data is available&lt;br&gt;
              Client---------&amp;gt;Server&lt;br&gt;
              Client&amp;lt;---------Server (Sent Data)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Long Polling&lt;/strong&gt;&lt;br&gt;
Long polling is a type of HTTP request where the request is sent by the client to the server, and the connection is open until the result is generated. Only when the proper result generates, the server sent the response to client.&lt;/p&gt;

&lt;p&gt;Request data: &lt;br&gt;
Client----------&amp;gt;Server&lt;br&gt;
                Wait until data is available....&lt;br&gt;
              Client&amp;lt;----------Server (Sent data)&lt;/p&gt;

&lt;h2&gt;
  
  
  Event Stream
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Event Stream&lt;/strong&gt;&lt;br&gt;
Also known as Server-Sent Events (SSE). Example of Event Stream is "ChatGPT".  The server sent the response to the client continuously as the result generation is in progress and during that the time the connection between client and server is active. This prevents the client to wait for a huge amount of time until it completes a large process and sent the result.  A limitation of Event Stream is that browsers may restrict the number of simultaneous connections per domain.&lt;br&gt;
Example: Opening many ChatGPT tabs may slow your browser or consume more network resources, but this is not a limitation of Event Streams themselves. &lt;/p&gt;

&lt;p&gt;Request data: &lt;br&gt;
Client----------&amp;gt;Server&lt;/p&gt;

&lt;p&gt;Client&amp;lt;--------Server (Data until completed-Ex:10% completed data)&lt;br&gt;
Client&amp;lt;--------Server (Data until completed-30%)&lt;br&gt;
Client&amp;lt;--------Server (Data until completed-80%)&lt;br&gt;
Client&amp;lt;--------Server (Data until completed-100%)&lt;br&gt;
Connection closes&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
