<?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: Jane</title>
    <description>The latest articles on DEV Community by Jane (@janefrances).</description>
    <link>https://dev.to/janefrances</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3436018%2F131dcc46-101a-4406-b7b8-5a96adaf2612.jpg</url>
      <title>DEV Community: Jane</title>
      <link>https://dev.to/janefrances</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/janefrances"/>
    <language>en</language>
    <item>
      <title>Difference Between OpenAI API Key and Azure OpenAI API Key</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Mon, 20 Apr 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/masteringbackend/difference-between-openai-api-key-and-azure-openai-api-key-3j2b</link>
      <guid>https://dev.to/masteringbackend/difference-between-openai-api-key-and-azure-openai-api-key-3j2b</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5w0okmxbae99wgte7u4g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5w0okmxbae99wgte7u4g.png" alt="Difference Between OpenAI API Key and Azure OpenAI API Key" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Developers can access AI models using two main platforms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;OpenAI&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Azure OpenAI&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both provide access to similar AI models, but the way authentication and deployment work is different.&lt;/p&gt;

&lt;p&gt;In this article, we will understand the difference between OpenAI API keys and Azure OpenAI API keys.&lt;/p&gt;

&lt;h3&gt;
  
  
  OpenAI API Key
&lt;/h3&gt;

&lt;p&gt;OpenAI provides direct access to AI models through its own platform.&lt;/p&gt;

&lt;p&gt;Developers can sign up on the OpenAI website and generate an API key.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://platform.openai.com/" rel="noopener noreferrer"&gt;https://platform.openai.com&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Steps to Get OpenAI API Key
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Login to OpenAI platform.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to  &lt;strong&gt;API Keys&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click  &lt;strong&gt;Create New Secret Key&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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;sk-xxxxxxxxxxxxxxxxxxxxxxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This key can be used directly with OpenAI APIs.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api.openai.com/v1/chat/completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Azure OpenAI API Key
&lt;/h3&gt;

&lt;p&gt;Azure OpenAI provides OpenAI models through Microsoft Azure infrastructure.&lt;/p&gt;

&lt;p&gt;Instead of using OpenAI servers directly, the requests go through Azure services.&lt;/p&gt;

&lt;p&gt;Azure OpenAI requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Azure resource&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Model deployment&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Endpoint&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;API key&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

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

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://openai-demo.openai.azure.com/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Differences
&lt;/h3&gt;

&lt;p&gt;OpenAI API&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Hosted by OpenAI&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Direct API usage&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simple setup&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Single endpoint&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Azure OpenAI&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Hosted on Microsoft Azure&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Requires resource creation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Requires model deployment&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Uses Azure endpoint&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When to Use OpenAI
&lt;/h3&gt;

&lt;p&gt;Use OpenAI when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You want quick setup&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You are building prototypes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You want direct API access&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When to Use Azure OpenAI
&lt;/h3&gt;

&lt;p&gt;Use Azure OpenAI when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You need enterprise security&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You want Azure integration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your organization already uses Azure cloud&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You need regional deployment&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Both OpenAI and Azure OpenAI provide access to powerful AI models.&lt;/p&gt;

&lt;p&gt;OpenAI is easier for quick development, while Azure OpenAI is better suited for enterprise applications that require scalability, security, and integration with other Azure services.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/ayush" rel="noopener noreferrer"&gt;Ayush Shrivastava&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>openai</category>
      <category>api</category>
      <category>backenddevelopment</category>
      <category>azure</category>
    </item>
    <item>
      <title>How to Create an Azure OpenAI Resource and Deploy Your First Model.</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Fri, 17 Apr 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/masteringbackend/how-to-create-an-azure-openai-resource-and-deploy-your-first-model-5hij</link>
      <guid>https://dev.to/masteringbackend/how-to-create-an-azure-openai-resource-and-deploy-your-first-model-5hij</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm99yta2rwatuq28ga1t0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm99yta2rwatuq28ga1t0.png" alt="How to Create an Azure OpenAI Resource and Deploy Your First Model" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Azure OpenAI allows developers to use powerful AI models such as GPT-4, GPT-4o, and GPT-3.5 directly from the Azure cloud. These models can be used to build chatbots, AI assistants, content generators, and many intelligent applications.&lt;/p&gt;

&lt;p&gt;In this article, you will learn how to create an Azure OpenAI resource, deploy a model, and get the API key required to use the service in your application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before starting, make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An Azure account&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Access to the Azure Portal&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Azure OpenAI service is enabled for your subscription&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you do not have an Azure account, you can create one from the Azure website.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create Azure OpenAI Resource
&lt;/h3&gt;

&lt;p&gt;First, you need to create an Azure OpenAI resource.&lt;/p&gt;

&lt;p&gt;Open the Azure Portal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;https://portal.azure.com&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Steps
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Login to the Azure Portal.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the search bar, type  &lt;strong&gt;Azure OpenAI&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click  &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now fill the required fields.&lt;/p&gt;

&lt;h4&gt;
  
  
  Configuration
&lt;/h4&gt;

&lt;p&gt;Resource Group&lt;/p&gt;

&lt;p&gt;Create a new resource group or select an existing one.&lt;/p&gt;

&lt;p&gt;Region&lt;/p&gt;

&lt;p&gt;Choose a supported region such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;East US&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sweden Central&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Name&lt;/p&gt;

&lt;p&gt;Enter a unique resource name.&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;openai-demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pricing Tier&lt;/p&gt;

&lt;p&gt;Select  &lt;strong&gt;Standard&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;After filling the details:&lt;/p&gt;

&lt;p&gt;Click  &lt;strong&gt;Review + Create&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then click  &lt;strong&gt;Create&lt;/strong&gt;  to deploy the resource.&lt;/p&gt;

&lt;p&gt;Deployment usually takes around one to two minutes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Deploy a Model
&lt;/h3&gt;

&lt;p&gt;Once the resource is created, you need to deploy a model.&lt;/p&gt;

&lt;h4&gt;
  
  
  Steps
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open the Azure OpenAI resource you created.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the left menu, click  &lt;strong&gt;Model Deployments&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click  &lt;strong&gt;Deploy Model&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now select a model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Recommended Models
&lt;/h3&gt;

&lt;p&gt;For most applications, these models work well:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;gpt-4o-mini&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fast and cost efficient model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;gpt-35-turbo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Popular chat model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deployment Configuration
&lt;/h3&gt;

&lt;p&gt;Model&lt;/p&gt;

&lt;p&gt;Select the model you want.&lt;/p&gt;

&lt;p&gt;Deployment Name&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;gpt-4o-mini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click  &lt;strong&gt;Deploy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Azure will now create the model deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Get API Credentials
&lt;/h3&gt;

&lt;p&gt;To call the Azure OpenAI API from your application, you need an API key and endpoint.&lt;/p&gt;

&lt;h4&gt;
  
  
  Steps
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open the Azure OpenAI resource.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click  &lt;strong&gt;Keys and Endpoint&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You will see the following information.&lt;/p&gt;

&lt;p&gt;API Key 1&lt;/p&gt;

&lt;p&gt;API Key 2&lt;/p&gt;

&lt;p&gt;Endpoint&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;API KEY
xxxxxxxxxxxxxxxxxxxxxxxx

ENDPOINT
https://openai-demo.openai.azure.com/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can use either  &lt;strong&gt;Key 1 or Key 2&lt;/strong&gt;  in your application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example API Endpoint
&lt;/h3&gt;

&lt;p&gt;Your application will send requests to the endpoint.&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;https://openai-demo.openai.azure.com/openai/deployments/gpt-4o-mini/chat/completions?api-version=2024-02-15-preview
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your request must include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;API Key&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Endpoint&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deployment Name&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Azure OpenAI makes it easy to use powerful AI models in enterprise applications. The basic process involves three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create an Azure OpenAI resource&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploy a model such as gpt-4o-mini&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Get API credentials and endpoint&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once these steps are completed, you can start building AI-powered applications using Azure OpenAI.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/ayush" rel="noopener noreferrer"&gt;Ayush Shrivastava&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>openai</category>
      <category>restapi</category>
      <category>backenddevelopment</category>
      <category>azure</category>
    </item>
    <item>
      <title>Mastering @PathVariable in Spring Boot</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Thu, 16 Apr 2026 10:00:30 +0000</pubDate>
      <link>https://dev.to/masteringbackend/mastering-pathvariable-in-spring-boot-9f1</link>
      <guid>https://dev.to/masteringbackend/mastering-pathvariable-in-spring-boot-9f1</guid>
      <description>&lt;p&gt;&lt;a href="https://blog.masteringbackend.com/authors/ayush" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffk5ojfvcn7yi5kp4p36k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffk5ojfvcn7yi5kp4p36k.png" alt="Mastering @PathVariable in Spring Boot" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Learn how to use  &lt;code&gt;@PathVariable&lt;/code&gt; in Spring Boot to build clean and RESTful APIs with practical examples from real-world scenarios like users, products, and orders.&lt;/p&gt;
&lt;h4&gt;
  
  
  What is  &lt;code&gt;@PathVariable&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;@PathVariable&lt;/code&gt; in Spring Boot is an annotation used to bind values from the URL directly to method parameters in a controller. It is mainly used in REST APIs where resources are identified using hierarchical URLs. For example, in  &lt;code&gt;/users/101,&lt;/code&gt;  the value  &lt;code&gt;101&lt;/code&gt; represents a specific user and is captured using  &lt;code&gt;@PathVariable.&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;@PathVariable&lt;/code&gt; is used in Spring Boot to extract values from the URL path and bind them to method parameters to identify specific resources in REST APIs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It differs from query parameters because it is part of the URL path, making APIs more readable and meaningful. In real-world systems like e-commerce or CRM, it is commonly used to fetch specific records, such as a user, product, or order, by ID. It also supports multiple values and even dynamic mapping using a Map structure when needed.&lt;/p&gt;

&lt;p&gt;In Spring Boot,  &lt;code&gt;@PathVariable&lt;/code&gt; is used to extract dynamic values from the URL. It helps in designing RESTful APIs where resources are clearly identified using URL paths instead of query parameters.&lt;/p&gt;

&lt;p&gt;Let’s start with a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@GetMapping("/users/{userId}")
public String getUser(@PathVariable Long userId) {
    return "User ID: " + userId;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When a request like  &lt;code&gt;/users/101&lt;/code&gt; is made, Spring automatically maps  &lt;code&gt;101&lt;/code&gt; to the  &lt;code&gt;userId&lt;/code&gt; variable.&lt;/p&gt;

&lt;p&gt;Now consider a real-world scenario in an e-commerce system where a user wants to view a specific product:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@GetMapping("/users/{userId}/products/{productId}")
public String getUserProduct(@PathVariable Long userId,
                             @PathVariable Long productId) {
    return "User: " + userId + ", Product: " + productId;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This makes the API intuitive and readable.&lt;/p&gt;

&lt;p&gt;You can also customize variable names:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@GetMapping("/users/{userId}/orders/{orderId}")
public String getOrder(@PathVariable(name = "userId") Long id,
                       @PathVariable Long orderId) {
    return "User: " + id + ", Order: " + orderId;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For dynamic cases, you can use a Map:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@GetMapping("/users/{userId}/address/{addressId}")
public String getAddress(@PathVariable Map&amp;lt;String, String&amp;gt; pathVars) {
    return "User: " + pathVars.get("userId") +
           ", Address: " + pathVars.get("addressId");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is useful when handling flexible URLs.&lt;/p&gt;

&lt;p&gt;In real-world applications like CRM or booking systems,  &lt;code&gt;@PathVariable&lt;/code&gt; is used to fetch user details, order history, or product information based on unique identifiers.&lt;/p&gt;

&lt;p&gt;Best practices include using meaningful variable names, avoiding too many path variables in one endpoint, and validating inputs properly. Also, prefer strongly typed variables over Map when possible.&lt;/p&gt;

&lt;p&gt;Using  &lt;code&gt;@PathVariable&lt;/code&gt; correctly improves API clarity, maintainability, and aligns with REST standards followed in production-grade applications.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/ayush" rel="noopener noreferrer"&gt;Ayush Shrivastava&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>restapis</category>
      <category>backenddeveloper</category>
      <category>springboot</category>
      <category>pathvariable</category>
    </item>
    <item>
      <title>TOP 5 Books Every Backend Developer Should Read</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Fri, 10 Apr 2026 10:00:30 +0000</pubDate>
      <link>https://dev.to/masteringbackend/top-5-books-every-backend-developer-should-read-3i3g</link>
      <guid>https://dev.to/masteringbackend/top-5-books-every-backend-developer-should-read-3i3g</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fal3fbvi2vt6jwd0awm6d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fal3fbvi2vt6jwd0awm6d.png" alt="title" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The world of software development is fast-paced. If you glance away to pet your cat too long, you may miss the next big framework or tool. For instance, JavaScript, one of the most popular programming languages in the world, is notorious for pushing out new frameworks as often as a developer has a bad day , which happens more often than you may think. Because of this, many developers need to get information quickly, and the best mediums to get that information come in the form of short-form videos, quick articles, and snappy courses. While we can appreciate the roles these play in keeping us up to speed with development trends, it’s still crucial to settle in with a good book once in a while.&lt;/p&gt;

&lt;p&gt;Some development books may seem intimidating judging by volume alone, but the treasures they hold within are timeless. Usually, what separates good developers from average developers is how much time they are willing to read between the lines and understand the underlying concepts that run programs, so they can be more efficient at solving problems. If you’d like to be the best backend developer you could be, have a look at these top five books backend developers should read that’ll be sure to take you to the next level of your career.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. &lt;a href="https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable/dp/1449373321" rel="noopener noreferrer"&gt;Designing Data-Intensive Applications by Martin Kleppmann&lt;/a&gt;
&lt;/h4&gt;

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

&lt;p&gt;This book is a classic for those seeking to understand how data works and is handled by applications. It dives into ways to optimize data, so you produce programs that retrieve and use data quickly and efficiently.&lt;/p&gt;

&lt;p&gt;Here, you’ll be looking into database storage and trade-offs that exist between different data technologies. It introduces these core trade-offs in distributed systems like consistency, availability, and scalability, which shape how real-world backend systems are designed. As a backend developer, dealing with data constantly, this book is a must-have and will help you explore the fundamental principles of data systems.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. &lt;a href="https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr_1_1?crid=18P7O2XUMNHDT&amp;amp;dib=eyJ2IjoiMSJ9.G6SRByFrwqob6KQdRTDbl81VKTwojNrO2p3dvKOrV5HnjmLk2c5W8wrKiK5ot4A2_kKFGChl4MDAgKrAITsKGKzvb48MymC2fBPoPu8TbROhSOAWEcEpnNJj82Zz_z3QwgIRtCmp7kcsqw9EXKtNA-dx8cpIn03PBmFiiy25yHUuVQjcpOD9aOvO6sNDofGVS2vpgtb54RCXRMGK9jg6tnYcM3hKXR9ts-E3PkBS95E.sGiZdyjAsKdxOfqVdr5zVHra6sbqq_eXW4W4NupoVoU&amp;amp;dib_tag=se&amp;amp;keywords=clean+code+by+robert+c.+martin&amp;amp;qid=1774802512&amp;amp;s=books&amp;amp;sprefix=clean+code+%2Cstripbooks-intl-ship%2C355&amp;amp;sr=1-1" rel="noopener noreferrer"&gt;Clean Code by Robert C. Martin&lt;/a&gt;
&lt;/h4&gt;

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

&lt;p&gt;Clean code is a tricky subject. After a few years in development, you realize that there are certain standards that must be upheld in your code, but you also become aware that these same standards and best practices are not set in stone and may be broken on occasion. An example is the DRY principle. You may know that repeating code is bad practice, but would you stick to this rule so much, at the expense of readable code? That’s where Clean Code by Robert C. Martin saves the day. It dives into such questions and explains what it truly means for code to be clean.&lt;/p&gt;

&lt;p&gt;Robert’s book emphasizes that writing clean code isn’t about unbending rules, but about making thoughtful decisions in matters of readability, maintainability, and practicality.&lt;/p&gt;

&lt;p&gt;You’ll learn about writing code that is &lt;a href="https://www.docuwriter.ai/posts/ultimate-guide-self-documenting-code" rel="noopener noreferrer"&gt;self-documenting&lt;/a&gt;, keeping functions focused on one thing and other such rules for maintainable, readable and modular code. Rid yourself of code smells, and get a copy.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. &lt;a href="https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850/ref=sr_1_1?crid=2G5GEGENFI1FW&amp;amp;dib=eyJ2IjoiMSJ9.nj6XTCgbP7Ay4ig5zGU-o9OB8p-raRuETwl6G824MZwno93RxDTkpPMlKADkJwM_XWBpo9PWoT6eDDRBzPzJDV8VrJ_C7k4HDFz0cBvV0l3eMXG6q8dhBEhUDCiVAnx7293t3r7JngT1CFCtmu5fPuWJekgzMCwFNJQJU4NejqHFXpWeOOxteC3KorKgB7GX7waTgH_I9vdpxSRpAj2tAWZlmh_6p-JTp5nw78k-ZFc.ItkA6RSPjG5pM4lcfJEZ73W-velIx5yxE7UzfI2vGhE&amp;amp;dib_tag=se&amp;amp;keywords=cracking+the+coding+interview&amp;amp;qid=1774802584&amp;amp;s=books&amp;amp;sprefix=cracking+the+coding+inter%2Cstripbooks-intl-ship%2C360&amp;amp;sr=1-1" rel="noopener noreferrer"&gt;Cracking the Coding Interview by Gayle Laakmann McDowell&lt;/a&gt;
&lt;/h4&gt;

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

&lt;p&gt;Coding interviews are not a walk in the park. In some cases, the questions you may face in a technical interview may seem quite abstract and sometimes a bit different from what you deal with at work in your day-to-day. If you’re thinking of taking a bold step into job searching, this book is a classic and a must-have in your preparation attempts.&lt;/p&gt;

&lt;p&gt;Beyond just practicing interview questions, it’ll help you build a problem-solving mindset. Solve over 180 coding questions and find yourself walking confidently in and out of technical interviews.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. &lt;a href="https://www.amazon.com/Fundamentals-Software-Architecture-Engineering-Approach/dp/1098175514/ref=sr_1_1?crid=380NCLIK32RC9&amp;amp;dib=eyJ2IjoiMSJ9.aPA9gmJ_iYGRhv2bX2MYcxCGcgaFxdonRx9927J4MKuqj1aiXFXWxM-RvPctQ5rN-r4h_0shcPuBilCnfjqqad8RkKN6kX-Q8XxFyN_ny21a9eyiubebjXqvMPhgh-5D2_HQyImrq1dpZ_LF5ouEqCWkEtY3XCbTo2rP9qDp_AReADqD2wP3eoNL1OKQGqTC4ibWTsQ6PSkM0ja7hYHMv0Yw70GCyJ6FdaVdywxhcQw.MjkjR-jDh0dylF462_ViUwEqr3By-t9CSszYcx0fa0E&amp;amp;dib_tag=se&amp;amp;keywords=fundamentals+of+software+architecture&amp;amp;qid=1774802663&amp;amp;s=books&amp;amp;sprefix=fundamentals+of+software+architecture%2Cstripbooks-intl-ship%2C348&amp;amp;sr=1-1" rel="noopener noreferrer"&gt;Fundamentals of Software Architecture by Richard and Ford&lt;/a&gt;
&lt;/h4&gt;

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

&lt;p&gt;This book is a haven for those seeking a good introduction to Software Architecture fundamentals. It discusses eight architectural styles, each with detailed explanations. It explains how different architectural styles impact system performance, scalability, and maintainability, which are key concerns in backend development. It could serve as a great handbook and source material for all things architecture-related.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. &lt;a href="https://www.amazon.com/Grokking-Algorithms-Second-Aditya-Bhargava/dp/1633438538/ref=sr_1_1?crid=1BO6JSEA1BHQN&amp;amp;dib=eyJ2IjoiMSJ9.udKCRwfqvqqXcW7DFKotFoK3jLzxS09orNAGvMOeslxdic8UqaMG0HL2Hy-C2vNtl9v6Fm1-Jf10NAQ1w1gsqa5xeX0T_xVbgL_eIy7iB9ud6rMrCFOmNz1qz_1HV-rWlcn9mkvHCsQ-L6UnhbLTrJeRq3sqpYB0UC-9REhTLwuOpexpo6aFFwOSlueTAyP05Joj4QTIqfzPgdURRQ7Vj46kWhxLAN1kotW90zwBynw.mv7FuyR3UUpezSTpXwGIVBjeA7agZeG_Zhpdg__Oolo&amp;amp;dib_tag=se&amp;amp;keywords=grokking+algorithms&amp;amp;qid=1774802724&amp;amp;s=books&amp;amp;sprefix=grokking+alg%2Cstripbooks-intl-ship%2C690&amp;amp;sr=1-1" rel="noopener noreferrer"&gt;Grokking Algorithms by Aditya Bhargava&lt;/a&gt;
&lt;/h4&gt;

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

&lt;p&gt;This book is a delight. It makes algorithms easier to follow and visual learners would benefit greatly from the illustrations. In it, Aditya simplifies concepts like &lt;a href="https://dev.to/gr8soln/mastering-time-and-space-complexity-a-beginners-guide-to-big-o-notation-33ae"&gt;Big O Notation&lt;/a&gt;, recursion and dynamic programming.&lt;/p&gt;

&lt;p&gt;On reading this book, you’ll realize soon enough that it makes complex algorithmic concepts intuitive, helping developers understand not just how solutions work, but why they work. The author makes these rather abstract concepts easier to mentally navigate with his witty and brilliant writing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The above are just a few of many interesting and amazing books that will keep you deeply engaged. While some of the books on this list aren’t specifically targeted at backend developers, they are great to have in your library as they concern general coding best practices and critical thinking.&lt;/p&gt;

&lt;p&gt;Why not pick up a book today? Perhaps lose yourself in the whimsical world of Grokking Algorithms, be amazed by how Martin Kleppman explains the secret recipes needed in designing data-intensive applications, or carefully observe and craft your methods after reading Robert C. Martin’s Clean Code.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/lonercode" rel="noopener noreferrer"&gt;Amanda Ene Adoyi&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Originally published at&lt;/em&gt; &lt;a href="https://blog.masteringbackend.com/top-5-books-every-backend-developer-should-read" rel="noopener noreferrer"&gt;&lt;em&gt;https://blog.masteringbackend.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;




</description>
      <category>reading</category>
      <category>backenddeveloper</category>
      <category>backend</category>
      <category>booksrecommendation</category>
    </item>
    <item>
      <title>Persistent Chat History with Database Design (Practical Example)</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Thu, 09 Apr 2026 10:00:30 +0000</pubDate>
      <link>https://dev.to/masteringbackend/persistent-chat-history-with-database-design-practical-example-33da</link>
      <guid>https://dev.to/masteringbackend/persistent-chat-history-with-database-design-practical-example-33da</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8h76hv0xe9a0wudsa54d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8h76hv0xe9a0wudsa54d.png" alt="title" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Chat applications look simple on the surface when you look at them. But behind every smooth conversation, there is a system that stores, retrieves, and manages messages efficiently.&lt;/p&gt;

&lt;p&gt;What makes modern apps usable is the persistent chat history. A lot of users would expect conversations to load instantly, stay in order, and remain available across all their devices; that only works when the database design is done in the right way.&lt;/p&gt;

&lt;p&gt;This guide focuses on how persistent chat history works in a real system, and how conversations, users, and messages are structured step by step to keep your application responsive, organized, and ready for real-world use.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Schema for a Chat Application
&lt;/h3&gt;

&lt;p&gt;To ensure you have a strong chat schema, you must begin with three main entities: users, conversations, and messages. Keeping these entities separate makes the system easier to scale, query, and maintain.&lt;/p&gt;

&lt;p&gt;At the very least, you need a users table or collection that helps store identity and basic profile data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"user_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"u123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"username"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"john_doe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"created_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-01-01T10:00:00Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next is the conversations entity &lt;strong&gt;,&lt;/strong&gt; which represents the chat thread between two or more users. It acts as the container for messages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"conversation_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"c456"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"participants"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"u123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"u789"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"created_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-01-01T10:05:00Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This structure allows group chats and one-on-one chats without changing the schema.&lt;/p&gt;

&lt;p&gt;The most important part is the messages entity. Each message belongs to a conversation and a sender, which is where most queries will happen, and it’s meant to be designed carefully.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"m001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"conversation_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"c456"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sender_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"u123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hello, how are you?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-01-01T10:06:00Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always include a timestamp; the ordering of the message depends on it. Also, having a relational database can be translated into three tables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;users (user_id, username, created_at)&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;conversations (conversation_id, created_at)&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;messages (message_id, conversation_id, sender_id, content, timestamp)&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A joint table like &lt;strong&gt;&lt;em&gt;conversation_participants&lt;/em&gt;&lt;/strong&gt; is always needed to map users to conversations:&lt;/p&gt;

&lt;p&gt;This helps to avoid duplicating participant data and keeps relationships flexible.&lt;/p&gt;

&lt;p&gt;Create indexes on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;conversation_id i&lt;/em&gt;&lt;/strong&gt; n the messages table for fast retrieval&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;timestamp&lt;/em&gt;&lt;/strong&gt; for ordered queries&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;sender_id&lt;/em&gt;&lt;/strong&gt; for filtering user messages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not having a proper index can lead to the chat queries slowing down quickly as soon as data grows.&lt;/p&gt;

&lt;p&gt;And for NoSQL databases like MongoDB, you can use a similar structure with collections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;users&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;conversations&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;messages&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or you can embed messages inside conversations for smaller apps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"conversation_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"c456"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"participants"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"u123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"u789"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"sender_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"u123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hello"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-01-01T10:06:00Z"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Embedding works well for smaller volume chats. For high-scale systems, you’ll need to separate message collections to improve performance.&lt;/p&gt;

&lt;p&gt;Add optional fields to support real-world features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;status&lt;/em&gt;&lt;/strong&gt; (sent, delivered, read)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;edited_at&lt;/em&gt;&lt;/strong&gt; (for message edits)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;deleted_at&lt;/em&gt;&lt;/strong&gt; (for soft deletes)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;attachments&lt;/em&gt;&lt;/strong&gt; (for media support)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keeping the schema flexible is important, but try as much as possible to avoid overloading it early. Start simple and extend only when needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sample Data Model for Conversations and Messages
&lt;/h3&gt;

&lt;p&gt;Having a good data model defines how conversations and messages relate, how they are queried, and how they scale under load.&lt;/p&gt;

&lt;p&gt;Start with a conversation-centric model. Every message belongs to a conversation, and every conversation has participants.&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 json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"conversation_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"c001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"group"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"participants"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"u1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"u2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"u3"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"last_message_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"m045"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"created_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-01-01T10:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"updated_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-01-01T10:10:00Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;&lt;em&gt;last_message_id&lt;/em&gt;&lt;/strong&gt; is important because it allows quick previews without scanning all the messages, and that is how chat lists load fast in real apps.&lt;/p&gt;

&lt;p&gt;Let’s now define the message model. Each message is stored independently and linked to its conversation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"m045"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"conversation_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"c001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sender_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"u2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Let’s deploy today"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-01-01T10:09:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"delivered"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Avoid updating message content frequently; it keeps the system predictable.&lt;/p&gt;

&lt;p&gt;Add a sequence or ordering field when strict ordering is required.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Timestamps can collide in high-throughput systems, and a sequence number guarantees correct ordering, especially in distributed setups.&lt;/p&gt;

&lt;p&gt;For relational databases, the model translates into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;conversations&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;messages&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;participants&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each table has a clear role. Queries stay simple and efficient.&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 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;messages&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;conversation_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'c001'&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="k"&gt;ASC&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In NoSQL systems, the model is somewhat similar but optimized for access patterns. Messages stay in a separate collection for scalability, and conversations store lightweight metadata only.&lt;/p&gt;

&lt;p&gt;For high-performance systems, denormalization helps to store frequently accessed data, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;last message content&lt;/li&gt;
&lt;li&gt;unread message count&lt;/li&gt;
&lt;li&gt;last active timestamp&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;directly in the conversation object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"conversation_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"c001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"last_message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Let’s deploy today"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"unread_count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"u1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"u3"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This avoids expensive joins or aggregations during reads.&lt;/p&gt;

&lt;p&gt;Designing for pagination from the start is very important. Offset-based pagination tends to break at scale. Use cursor-based pagination instead, typically with &lt;strong&gt;&lt;em&gt;timestamp or&lt;/em&gt;&lt;/strong&gt;  &lt;strong&gt;&lt;em&gt;message_id.&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /messages?conversation_id=c001&amp;amp;before=m045&amp;amp;limit=20
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This keeps queries fast even with millions of messages.&lt;/p&gt;

&lt;p&gt;Also, support additional fields without breaking the model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;attachments&lt;/em&gt;&lt;/strong&gt; for media&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;reply_to&lt;/em&gt;&lt;/strong&gt; for threaded replies&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;metadata&lt;/em&gt;&lt;/strong&gt; for AI-generated context or tags&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Having a clean data model balances structure and flexibility. When conversations and messages are modeled correctly, the performance, scaling, and feature development become easier to manage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Writing and Reading Chat Messages Step by Step
&lt;/h3&gt;

&lt;p&gt;Writing and reading chat messages are meant to be simple, fast, and consistent. Every step taken must be predictable, especially when under high traffic.&lt;/p&gt;

&lt;p&gt;When a user sends a message, the system receives a request with key fields like &lt;strong&gt;&lt;em&gt;conversation_id,&lt;/em&gt;&lt;/strong&gt;  &lt;strong&gt;&lt;em&gt;sender_id, and&lt;/em&gt;&lt;/strong&gt;  &lt;strong&gt;&lt;em&gt;content.&lt;/em&gt;&lt;/strong&gt; It validates these inputs first, then rejects empty messages or invalid conversation IDs early.&lt;/p&gt;

&lt;p&gt;It also generates a unique &lt;strong&gt;&lt;em&gt;message_id&lt;/em&gt;&lt;/strong&gt;. which can be a UUID or a database-generated ID, and also attaches a &lt;strong&gt;&lt;em&gt;timestamp&lt;/em&gt;&lt;/strong&gt; and, if needed, a &lt;strong&gt;&lt;em&gt;sequence&lt;/em&gt;&lt;/strong&gt; value for strict ordering.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"m101"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"conversation_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"c001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sender_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"u1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Message received"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-01-01T10:15:00Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then insert the message into the database.&lt;/p&gt;

&lt;p&gt;In a relational database, wrap it in a transaction if multiple tables are updated, while in NoSQL systems, ensure the write is acknowledged before proceeding. Be sure to update the conversation metadata immediately after.&lt;/p&gt;

&lt;p&gt;This typically includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;last_message_id&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;last_message&lt;/em&gt;&lt;/strong&gt; optional preview&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;updated_at&lt;/em&gt;&lt;/strong&gt; timestamp&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This ensures that the chat lists reflect the latest activity without querying the messages table.&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 sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;conversations&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;last_message_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'m101'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;NOW&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;conversation_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'c001'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the system supports unread counts, then the increment counters for other participants. This helps to reduce the recalculating counts during reads.&lt;/p&gt;

&lt;p&gt;The most common operation is fetching messages for a conversation. Always send a query using &lt;strong&gt;&lt;em&gt;conversation_id&lt;/em&gt;&lt;/strong&gt; and sort by &lt;strong&gt;&lt;em&gt;timestamp&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;sequence.&lt;/em&gt;&lt;/strong&gt;&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;messages&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;conversation_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'c001'&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make use of pagination and never load all messages at once.&lt;/p&gt;

&lt;p&gt;Cursor-based pagination works best at scale. Instead of offsets, be sure to use a reference point like &lt;strong&gt;&lt;em&gt;message_id or&lt;/em&gt;&lt;/strong&gt;  &lt;strong&gt;&lt;em&gt;timestamp.&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /messages?conversation_id=c001&amp;amp;before=2026-01-01T10:15:00Z&amp;amp;limit=20
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This keeps performance stable even with a large dataset.&lt;/p&gt;

&lt;p&gt;Be sure to reverse the result set on the client if needed. Most databases tend to return recent messages first for efficiency.&lt;/p&gt;

&lt;p&gt;After writing a message, publish an event (via WebSocket or message queue). It helps to push new messages to connected clients without polling the database.&lt;/p&gt;

&lt;p&gt;Ensure that writes are visible to reads immediately or within an acceptable delay. Efficient write and read paths are the pillar of any chat system. If any of these steps are optimized, the whole messaging experience feels instant and reliable even as the data grows.&lt;/p&gt;

&lt;h3&gt;
  
  
  Optimizing Queries for Real-Time Chat Apps
&lt;/h3&gt;

&lt;p&gt;Real-time chat performance depends heavily on how the queries are written and how they are being executed. Slow queries lead to delayed messages, laggy interfaces, and poor user experience.&lt;/p&gt;

&lt;p&gt;The most important query in any chat app is fetching messages by &lt;strong&gt;&lt;em&gt;conversation_id.&lt;/em&gt;&lt;/strong&gt; Without an index, this becomes a full table or collection scan.&lt;/p&gt;

&lt;p&gt;Create indexes on:&lt;/p&gt;

&lt;p&gt;Example, in SQL:&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;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_conversation_timestamp&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;conversation_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows fast retrieval of recent messages without scanning the entire dataset.&lt;/p&gt;

&lt;p&gt;Only select the fields needed for rendering messages. Pulling large payloads (like attachments or metadata) when not required increases latency and memory usage.&lt;/p&gt;

&lt;p&gt;Smaller result sets mean faster queries.&lt;/p&gt;

&lt;p&gt;Offset queries tend to slow down as data grows because the database still scans skipped rows.&lt;/p&gt;

&lt;p&gt;Bad approach:&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;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="k"&gt;OFFSET&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better approach:&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;WHERE&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="s1"&gt;'2026-01-01T10:15:00Z'&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="nb"&gt;timestamp&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This keeps the performances consistent, even with millions of messages.&lt;/p&gt;

&lt;p&gt;Chat lists and recent messages are requested often. Use in-memory stores like Redis to cache:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Last messages per conversation&lt;/li&gt;
&lt;li&gt;unread counts&lt;/li&gt;
&lt;li&gt;active conversation lists&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This reduces the database load and improves the response time.&lt;/p&gt;

&lt;p&gt;Instead of joining multiple tables for every request, store frequently needed fields directly in the conversation record, and if multiple conversations need to be loaded, fetch them in a single query instead of multiple round-trip requests.&lt;/p&gt;

&lt;p&gt;Always filter by &lt;strong&gt;&lt;em&gt;conversation_id&lt;/em&gt;&lt;/strong&gt; or user context. Unbounded queries tend to increase load and expose unnecessary data.&lt;/p&gt;

&lt;p&gt;A query that works with 1,000 messages may fail at 1 million. So be sure to simulate large datasets early to identify bottlenecks before they reach production.&lt;/p&gt;

&lt;p&gt;When queries are optimized, messages load instantly, scrolling feels smooth, and the system scales without you constantly rewriting it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/Toluwanimi" rel="noopener noreferrer"&gt;Toluwanimi Fawole&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Originally published at&lt;/em&gt; &lt;a href="https://blog.masteringbackend.com/persistent-chat-history-with-database-design-practical-example" rel="noopener noreferrer"&gt;&lt;em&gt;https://blog.masteringbackend.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;




</description>
      <category>backenddevelopment</category>
      <category>database</category>
      <category>backend</category>
      <category>databasedesign</category>
    </item>
    <item>
      <title>Authentication &amp; Session Management for AI Apps</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Wed, 08 Apr 2026 10:00:30 +0000</pubDate>
      <link>https://dev.to/masteringbackend/authentication-session-management-for-ai-apps-1g68</link>
      <guid>https://dev.to/masteringbackend/authentication-session-management-for-ai-apps-1g68</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ncr8qtlz4vemy6dhsft.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ncr8qtlz4vemy6dhsft.png" alt="title" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AI applications don’t just help to process data; they interact with users, agents, and external services. This could either be a human user logging into a chatbot or an AI agent calling another service. Without having proper authentication, AI APIs become vulnerable to misuse or unauthorized access.&lt;/p&gt;

&lt;p&gt;When users log into an AI-powered product, the system needs to verify identity, manage access permissions, and maintain conversation or activity sessions, which is important for AI apps that handle chat interactions, autonomous agents, or high-volume API requests.&lt;/p&gt;

&lt;p&gt;This guide breaks down how authentication works in AI applications and how to manage sessions securely at scale.&lt;/p&gt;

&lt;h3&gt;
  
  
  API Key Authentication for AI Services
&lt;/h3&gt;

&lt;p&gt;API key authentication is one of the most common ways to secure AI services and machine learning APIs, and it works by assigning a unique key to each client, application, or developer account. Every request sent to the AI service must include the key so the server can verify access.&lt;/p&gt;

&lt;p&gt;The API key acts as a simple credential, and when a request reaches the server, the service checks the key against the stored records. If the key is valid, the request proceeds to the AI model or processing pipeline.&lt;/p&gt;

&lt;p&gt;A typical example looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST /v1/inference
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some APIs accept the key through a custom header:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;x-api-key: YOUR_API_KEY
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once it has been verified, the service processes the request and returns the model output.&lt;/p&gt;

&lt;p&gt;API keys are widely used in AI platforms because they are very easy to generate, distribute, and revoke. This makes them a practical option for developer-facing AI services, internal microservices, and early-stage AI products.&lt;/p&gt;

&lt;p&gt;They are mostly common in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Machine learning inference APIs&lt;/li&gt;
&lt;li&gt;AI-powered developer platforms&lt;/li&gt;
&lt;li&gt;internal AI microservices communicating with each other&lt;/li&gt;
&lt;li&gt;automation tools that interact with AI endpoints&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security practices matter a lot when using API keys. Keys should never be stored in client-side code or a public repository. Exposing a key in frontend JavaScript or committing it to version control makes it easy for attackers to copy and misuse.&lt;/p&gt;

&lt;p&gt;Instead of doing that, store the keys in environment variables or secure a configuration system whereby whenever a backend service needs the key, it retrieves it from the environment rather than hardcoding it.&lt;/p&gt;

&lt;p&gt;Key rotation is very important; generating new keys and deactivating old ones reduces long-term risk if a credential leaks. And if a compromised key suddenly generates thousands of requests per minute, the system should throttle or temporarily block the activity.&lt;/p&gt;

&lt;p&gt;Despite their simplicity, API keys have limitations, and they identify the calling application but do not inherently represent a user identity or permission scope, simply because a lot of production AI platforms combine API keys with additional security layers such as usage quotas, IP restrictions, or token-based authentication.&lt;/p&gt;

&lt;p&gt;But when implemented correctly, API key authentication helps to provide an effective way to secure AI services while also keeping integration simple for developers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Token-Based Authentication Using JWT
&lt;/h3&gt;

&lt;p&gt;Token-based authentication is mostly used in modern AI APIs and applications. Instead of you sending login credentials with every request, the system issues a token after the user successfully authenticates, and one of the most common formats is a JSON Web Token (JWT).&lt;/p&gt;

&lt;p&gt;A JWT is more like a compact URL-safe token that contains encoded information about the authenticated identity. It includes user details, permissions, and an expiration timestamp. The token is digitally signed just so the server can verify its authenticity without it needing to store session data.&lt;/p&gt;

&lt;p&gt;Some typical examples of JWT authentication workflow are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When a user or service sends login credentials to an authentication endpoint.&lt;/li&gt;
&lt;li&gt;When the server verifies the credentials.&lt;/li&gt;
&lt;li&gt;When the server generates a signed JWT.&lt;/li&gt;
&lt;li&gt;When the client includes the token in future requests to protected endpoints.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most APIs expect the token in the Authorization header:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;Authorization: Bearer YOUR_JWT_TOKEN
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When a request reaches the AI service, the backend verifies the token signature and checks its expiration time. If the token is valid, then the request proceeds to the AI model or application logic.&lt;/p&gt;

&lt;p&gt;JWT tokens are mostly used in AI platforms that support user accounts, dashboards, or role-based access control.&lt;/p&gt;

&lt;p&gt;JWTs consist of three parts separated by periods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HEADER.PAYLOAD.SIGNATURE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;header&lt;/strong&gt; describes the signing algorithm&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Payload&lt;/strong&gt; contains claims such as user ID, role, and expiration time&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Signature&lt;/strong&gt; verifies that the token was issued by a trusted authority&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simply because the token is signed, the server can verify it without storing session data in a database, which makes JWT authentication stateless, ideal for scalable AI systems and microservice architectures.&lt;/p&gt;

&lt;p&gt;Stateless authentication helps to simplify horizontal scaling when multiple AI API instances are running behind a load balancer; any instance can validate the token without needing shared session storage.&lt;/p&gt;

&lt;p&gt;JWTs typically include an exp claim that helps to define when the token becomes invalid. Short-lived tokens reduce security risk if a token is intercepted or leaked.&lt;/p&gt;

&lt;p&gt;A lot of systems also issue refresh tokens. When an access token expires, the refresh token can request a new one without forcing the user to log in again. When using JWT authentication, security best practices are important&lt;/p&gt;

&lt;p&gt;Always sign tokens using strong algorithms such as HS256 or RS256. Never trust an unsigned token or a token created on the client side.&lt;/p&gt;

&lt;p&gt;Sensitive information should not be stored inside the token payload. Even though JWTs are signed, they are not encrypted by default.&lt;/p&gt;

&lt;p&gt;For web applications, storing tokens in secure HTTP-only cookies helps reduce exposure to cross-site scripting attacks.&lt;/p&gt;

&lt;p&gt;In AI applications, JWT authentication works well for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI dashboards with authenticated users&lt;/li&gt;
&lt;li&gt;Multi-tenant AI platforms&lt;/li&gt;
&lt;li&gt;AI-powered APIs that enforce user roles&lt;/li&gt;
&lt;li&gt;Microservices communicating with each other&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When implemented correctly, JWT-based authentication provides a scalable and secure identity mechanism for modern AI applications while also keeping request handling fast and stateless.&lt;/p&gt;

&lt;h3&gt;
  
  
  OAuth and Social Login for AI Platforms
&lt;/h3&gt;

&lt;p&gt;In AI platforms, OAuth and social login simplify account management while improving security.&lt;/p&gt;

&lt;p&gt;Instead of storing passwords directly, the AI application helps by delegating authentication to an external provider. Common providers include Google and GitHub. The application receives a secure access token that verifies the user’s identity.&lt;/p&gt;

&lt;p&gt;A typical OAuth flow looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A user clicks a social login option (for example, “Sign in with Google”).&lt;/li&gt;
&lt;li&gt;The application redirects the user to the identity provider.&lt;/li&gt;
&lt;li&gt;The provider verifies the user’s identity.&lt;/li&gt;
&lt;li&gt;The provider returns an authorization token to the AI platform.&lt;/li&gt;
&lt;li&gt;The AI application creates a session or issues its own internal access token.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This approach helps to remove the need to manage passwords directly. Password storage introduces security responsibilities like hashing, credential rotation, and breach mitigation. OAuth helps to shift those responsibilities to specialized identity providers.&lt;/p&gt;

&lt;p&gt;OAuth is useful for AI platforms that target developers or teams. Take for example, an AI code assistant might allow developers to log in using GitHub accounts, and once authenticated, the platform can securely access repository metadata or integrate with development workflows.&lt;/p&gt;

&lt;p&gt;OAuth supports scopes that help define exactly what an application is allowed to access. Instead of granting full account control, a user might allow an AI app to read profile data or access specific resources.&lt;/p&gt;

&lt;p&gt;OAuth also helps to improve onboarding speed. Users can sign in with existing accounts in seconds instead of filling out registration forms, which helps to reduce friction, particularly important for consumer AI applications.&lt;/p&gt;

&lt;p&gt;When implementing OAuth, security practices still matter. Always validate authorization tokens on the backend server and never rely solely on client-side verification. It is important to store minimal identity information locally, and in most cases, the AI platform only needs a unique user ID and basic profile data from the identity provider.&lt;/p&gt;

&lt;p&gt;For AI systems that interact with external services, OAuth can also enable secure API integrations. The same goes for AI platforms with user accounts, dashboards, or collaborative tools. OAuth and social login provide a secure and scalable authentication method while also reducing the complexity of managing passwords internally.&lt;/p&gt;

&lt;h3&gt;
  
  
  Passwordless Authentication for AI Apps
&lt;/h3&gt;

&lt;p&gt;Passwordless authentication helps users to access an AI application without you creating or entering a traditional password. What it does is, the system verifies identity using alternatives such as magic links, one-time passcodes (OTP), biometric authentication, or hardware security keys.&lt;/p&gt;

&lt;p&gt;This approach is becoming very popular because passwords are now a major security weakness. Removing passwords reduces risks like credential reuse, phishing, and weak password selection.&lt;/p&gt;

&lt;p&gt;For example, a common workflow uses email magic links:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The user enters an email address.&lt;/li&gt;
&lt;li&gt;The AI application generates a temporary login link.&lt;/li&gt;
&lt;li&gt;The link is sent to the user’s email.&lt;/li&gt;
&lt;li&gt;Clicking the link verifies identity and creates a session.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Another common method used is a one-time passcode sent through email, SMS, or an authenticator app. The user enters the code within a short time window, and the system validates it before granting access.&lt;/p&gt;

&lt;p&gt;These methods work well for AI platforms that prioritize fast onboarding, removing the need to create and remember passwords, which reduces friction and can improve user adoption for consumer-facing AI tools.&lt;/p&gt;

&lt;p&gt;Passwordless authentication is useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI chat platforms&lt;/li&gt;
&lt;li&gt;AI productivity tools&lt;/li&gt;
&lt;li&gt;developer-facing AI dashboards&lt;/li&gt;
&lt;li&gt;internal AI tools used by teams&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Modern passwordless systems often rely on WebAuthn or FIDO2 standards. These technologies support biometric authentication through devices such as fingerprint scanners or facial recognition built into phones and laptops. Instead of transmitting a password, the device verifies the user locally and signs a cryptographic challenge.&lt;/p&gt;

&lt;p&gt;This provides strong protection against phishing attacks because authentication is tied to the user’s device and domain.&lt;/p&gt;

&lt;p&gt;Developers building AI applications should also consider session handling after authentication succeeds. Even without passwords, the system still needs a secure session token or an access token to maintain the user’s authenticated state during API requests.&lt;/p&gt;

&lt;p&gt;Passwordless authentication offers a secure and user-friendly approach for AI applications, as it tends to reduce credential risks while keeping login flows simple for users interacting with modern AI services.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/Toluwanimi" rel="noopener noreferrer"&gt;Toluwanimi Fawole&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Originally published at&lt;/em&gt; &lt;a href="https://blog.masteringbackend.com/authentication-and-session-management-for-ai-apps" rel="noopener noreferrer"&gt;&lt;em&gt;https://blog.masteringbackend.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;




</description>
      <category>sessionmanagement</category>
      <category>backenddevelopment</category>
      <category>api</category>
      <category>authentication</category>
    </item>
    <item>
      <title>Top 5 Java Backend Development Courses (2026)</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Fri, 20 Mar 2026 10:30:00 +0000</pubDate>
      <link>https://dev.to/masteringbackend/top-5-java-backend-development-courses-2026-1j9m</link>
      <guid>https://dev.to/masteringbackend/top-5-java-backend-development-courses-2026-1j9m</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsaxtynukghvux6xmg5v9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsaxtynukghvux6xmg5v9.png" alt="Top 5 Java Backend Development Courses (2025)" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The internet is filled with lots of Java Backend Development Courses. Therefore, choosing the best Java backend development course can be a nightmare for newbies looking to start or change careers.&lt;/p&gt;

&lt;p&gt;Java is a popular programming language with a ground-breaking of millions of developers worldwide, with over  &lt;a href="https://www.cisin.com/coffee-break/cost-of-outsourcing-your-software-project-to-a-company.html?ref=top-5-backend-development-courses&amp;amp;utm_source=masteringbackend&amp;amp;utm_campaign=top-5-backend-development-courses&amp;amp;utm_medium=blog" rel="noopener noreferrer"&gt;7.1 million professionals&lt;/a&gt;  using it to build robust applications. Also, Java runs on over a billion devices according to Oracle.&lt;/p&gt;

&lt;p&gt;This groundbreaking record shows the value and relevancy of learning Java today as a backend engineer. You must choose the Best Java Course this year to achieve this goal effectively. A course that is designed to teach you the basics and also prepare you for the real challenges in your tech journey.&lt;/p&gt;

&lt;p&gt;If you’re planning to start your Java backend development journey, investing in the right Java Backend Development course could be the key to your success.&lt;/p&gt;

&lt;p&gt;To help reduce the time spent researching and searching for the best backend development course, we have already prepared a list of the top five best Java backend development courses. These courses are thorough, beginner-friendly, and will prepare you for the job market.&lt;/p&gt;

&lt;p&gt;As part of our criteria, we have assembled the best course to learn Java for Backend Development. These courses combine the right essential theories, including practical projects, while making learning enjoyable and effective.&lt;/p&gt;

&lt;p&gt;Additionally, these top-rated courses boast a 90% satisfaction rate from participants because they prepare them for the job and cover almost everything needed to become a Java Backend Developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Top 5 Java Backend Development Courses 2025
&lt;/h2&gt;

&lt;p&gt;Here’s a comprehensive guide to the Top 5 Best Java Backend Development Courses for 2025. These courses are called Roadmap Java Backend Courses, designed to take you from a complete beginner to a different level of expertise.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Become a Java+Spring Backend Developer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mastering Java Backend with Oracle University.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Learn Java by Creating Applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Become a Java Backend Developer Bootcamp&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Building Scalable Java Microservices with Spring Boot and Spring Cloud&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Become a Java+Spring Backend Developer
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqlvo9inwzhweu7u25hnl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqlvo9inwzhweu7u25hnl.png" alt="java eng.png" width="800" height="450"&gt;&lt;/a&gt;The course takes you from ground zero and gradually moves you to become proficient in Java Backend Development.&lt;/p&gt;

&lt;p&gt;Below are the modules covered in this course:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java Essentials:&lt;/strong&gt;  The Java Essentials module is a complete, beginner-friendly course that explains the Core Java Basics, Object-Oriented Programming, Java syntax, and concepts such as variables, data types, arrays, strings, functions, control flow in Java, and error handling. This 49-video lesson course will expose you to core Java basics, Object-Oriented Programming, and Error Handling in Java.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Advanced Java:&lt;/strong&gt;  As the name suggests, this is a complete advanced Java course that aims to teach you advanced concepts in Java, such as Collections, Java I/O Streams and Build Tool, and Multithreading in Java. This course explores I/O streams, collections, build tools, and multithreading in great detail, giving you the required knowledge to excel in Java Backend Development.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Design Patterns in Java:&lt;/strong&gt; In this module, you will learn the significance of design patterns and how to apply key Creational, Structural, and Behavioral patterns to create robust, maintainable, and scalable Java software solutions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unit Testing in Java:&lt;/strong&gt; In this module, you will learn the importance of unit testing, the principles of Test-Driven Development (TDD), how to write test cases using JUnit, how to utilize advanced JUnit features like parameterized tests and test suites, and how to implement mocking with Mockito.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Spring Framework and Spring Boot:&lt;/strong&gt;  In this module, you’ll begin with the essentials of the Spring Framework, exploring how to configure beans using annotations and XML, manage bean lifecycles, and tap into Spring’s modular ecosystem, including AOP, Spring MVC, Spring Batch, Integration, and JMS. As you progress, you'll dive deep into security, messaging, and cloud support through Spring Security and Spring Cloud.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Microservices in Java:&lt;/strong&gt; You will learn about the benefits and challenges of Microservices Architecture, how to build and configure microservices with Spring Boot, enable communication between microservices using Feign Client, implement event-driven messaging brokers, configure service discovery and registration with Eureka, and utilize API Gateway and load balancing with Zuul, Spring Cloud Gateway, and Ribbon.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Containerization:&lt;/strong&gt;  In this module, you'll learn to use Docker and Kubernetes by containerizing a Java application, working with Docker images, containers, registries, Dockerfiles, and Docker Compose, then dive into Kubernetes architecture and components like Pods, Nodes, and Clusters, set up clusters with Minikube and AWS, manage resources such as Deployments, Services, Ingress, ConfigMaps, and Secrets, scale applications, and implement monitoring and logging.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Milestone Projects in Java:&lt;/strong&gt; Build over 10+ projects while learning Java. Build a SaaS product in Java.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is an all-in-one Java and Spring course for learning backend engineering with Java. This comprehensive course is designed for Java developers seeking proficiency in Java.&lt;/p&gt;

&lt;h3&gt;
  
  
  Course Highlights:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Lifetime access to course materials&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dedicated doubt resolution sessions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Industry-oriented curriculum following the  &lt;a href="http://roadmap.sh/?ref=top-5-backend-development-courses&amp;amp;utm_source=masteringbackend&amp;amp;utm_campaign=top-5-backend-development-courses&amp;amp;utm_medium=blog" rel="noopener noreferrer"&gt;Roadmap.sh&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Live sessions and webinars with industry experts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Certification upon completion&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Real-world projects and case studies&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Course Duration:&lt;/strong&gt;  2-4 months.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Course Price:&lt;/strong&gt; starting at $60 monthly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Course Link:&lt;/strong&gt; &lt;a href="https://masteringbackend.com/courses/become-a-java-spring-backend-engineer?ref=top-5-backend-development-courses&amp;amp;utm_source=masteringbackend&amp;amp;utm_campaign=top-5-backend-development-courses&amp;amp;utm_medium=blog" rel="noopener noreferrer"&gt;https://masteringbackend.com/courses/become-a-java-spring-backend-engineer&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Mastering Java Backend with Oracle University
&lt;/h2&gt;

&lt;p&gt;This is the official Java course from Oracle University. Java is currently owned by Oracle Corporation, which acquired Sun Microsystems, the original developers of Java.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fipt4g70vgxw2o55q5yx4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fipt4g70vgxw2o55q5yx4.png" alt="java backend.png" width="800" height="394"&gt;&lt;/a&gt;However, the Java core specification is managed through the Java Community Process (JCP), and Oracle owns the official Java Standard Edition (SE) implementation.&lt;/p&gt;

&lt;p&gt;The Oracle University has created a series of Java courses to help you develop in-demand programming skills with comprehensive training on the latest Java technology.&lt;/p&gt;

&lt;p&gt;Below are some of the Java Backend Development Courses from Oracle University:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java Explorer:&lt;/strong&gt;  Learn the basics of Java, such as variables, loops, objects, classes, arrays, and decision-making constructs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java SE 11: Programming Complete:&lt;/strong&gt;  This course is intended for students with some programming experience and is a comprehensive training for Java developers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Developing Applications for the Java EE 7 Platform:&lt;/strong&gt; This course teaches you how to build and deploy enterprise applications with Java EE.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Architect Enterprise Application with Java EE:&lt;/strong&gt;  This course teaches you how to develop robust architectures for enterprise Java applications.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Oracle University is a subscription-based platform; you can access most of the courses when you subscribe. Also, you can access certification courses from the university and earn a recognized certificate from Oracle.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Learn Java by Creating Applications
&lt;/h2&gt;

&lt;p&gt;This is an official course from JetBrains, the creators of JetBrains IDEs and the Kotlin programming language. It teaches Java development practically by building chatbots, games, algorithms, and even neural networks from scratch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6jy352vzfom5zeeqt00w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6jy352vzfom5zeeqt00w.png" alt="java.png" width="800" height="418"&gt;&lt;/a&gt;The course is subdivided into tracks to help you gradually expand your knowledge and improve in the areas that interest you.&lt;/p&gt;

&lt;p&gt;Below is a list of the tracks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java for Beginners:&lt;/strong&gt;  This course is for complete Java beginners and programming newbies. Its track will help you start and prepare for some computer science certifications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java Core:&lt;/strong&gt;  This track is a great choice for learners who want to gain a firm grasp of Java fundamentals and be introduced to algorithmic problems and mathematical models.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java Backend Developer:&lt;/strong&gt; This track was specifically designed to prepare you for your first Junior Developer interview. It contains tasks necessary to successfully pass your technical interview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java Desktop Application Developer:&lt;/strong&gt;  If you already know the basics of Java and would like to create desktop apps, this is the right track for you. You will also master the Swing framework.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Course Highlights:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;200+ interactive projects&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Personalized study plan&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Integration with JetBrains IDEs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Knowledge map&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Instant feedback&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Certificate of completion&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Become a Java Backend Developer Bootcamp
&lt;/h2&gt;

&lt;p&gt;All-in-one Java Bootcamp for learning backend engineering with Java. This bootcamp is designed for Java developers seeking proficiency in Java.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo6f75ta2ksgevz4k8vs4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo6f75ta2ksgevz4k8vs4.png" alt="java b.png" width="800" height="361"&gt;&lt;/a&gt;The Java Backend Developer Bootcamp is a comprehensive backend engineering bootcamp that will equip you with the skills to take your backend engineering career to the next level.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bootcamp Outline:
&lt;/h3&gt;

&lt;p&gt;Below is the content outline that we cover in this bootcamp to turn you into a great backend developer using the Java programming language.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Basics of Back-End Development&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Server-side Programming Language (Java)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build a Back-End with Spring&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;API and API Design&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Git and GitHub&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mastering Database&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deployment&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Software Testing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Software Design Principles&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Web Security&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Caching and CDNs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Message Brokers and Search Engines&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Containerization and CI/CD&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data Structures and Algorithms&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What to Expect in a Technical Interview (Landing Job)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Bootcamp Highlights:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;200+ recorded videos and lessons&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Personalized study plan&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;3-month access to the instructor&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lifetime Access and updates&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Practice Projects&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Career Services&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Instant feedback&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Certificate of completion&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Course Duration:&lt;/strong&gt;  2-4 months.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Course Price:&lt;/strong&gt; starting at $500 monthly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Course Link:&lt;/strong&gt; &lt;a href="https://academy.masteringbackend.com/?ref=top-5-backend-development-courses&amp;amp;utm_source=masteringbackend&amp;amp;utm_campaign=top-5-backend-development-courses&amp;amp;utm_medium=blog" rel="noopener noreferrer"&gt;https://academy.masteringbackend.com&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Building Scalable Java Microservices with Spring Boot and Spring Cloud
&lt;/h2&gt;

&lt;p&gt;Are you a Java developer looking to take your microservices skills to the next level? Google Cloud, in collaboration with Coursera, offers an  &lt;strong&gt;intermediate-level course&lt;/strong&gt;  that teaches you how to build scalable, cloud-native microservices using  &lt;strong&gt;Spring Boot&lt;/strong&gt;  and  &lt;strong&gt;Spring Cloud&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this course, you'll learn how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Build Spring Boot microservices that integrate with  &lt;strong&gt;Google Cloud managed services&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use  &lt;strong&gt;Pub/Sub&lt;/strong&gt;  and  &lt;strong&gt;Spring Integration&lt;/strong&gt;  for message handling&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Store data with  &lt;strong&gt;Cloud SQL&lt;/strong&gt;  and migrate to  &lt;strong&gt;Cloud Spanner&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Implement distributed tracing using  &lt;strong&gt;Cloud Trace&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This course is perfect if you already have some experience with Java and want to deepen your skills by working with real-world cloud tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Course Highlights:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;3 hands-on modules&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Approx.  &lt;strong&gt;12 hours of content&lt;/strong&gt;  — learn at your own pace&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;2 assignments&lt;/strong&gt;  to test your knowledge&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A  &lt;strong&gt;shareable certificate&lt;/strong&gt;  for your LinkedIn or resume&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lifetime access via  &lt;strong&gt;Coursera Plus&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The course is taught by instructors from  &lt;strong&gt;Google Cloud&lt;/strong&gt;, who bring real-world expertise and practical examples to every lesson.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;Choosing the right Java backend development course in 2025 is more than just selecting a popular program — it's about finding the one that aligns with your learning style, career goals, and current experience level. Whether you're a complete beginner starting from scratch or a developer looking to deepen your expertise, the courses listed above provide a comprehensive roadmap to mastering Java for backend engineering.&lt;/p&gt;

&lt;p&gt;From industry-aligned programs like  &lt;strong&gt;"Become a Java + Spring Backend Developer"&lt;/strong&gt;  by Masteringbackend to practical, hands-on courses from  &lt;strong&gt;Oracle University&lt;/strong&gt;,  &lt;strong&gt;JetBrains&lt;/strong&gt;, and  &lt;strong&gt;Google Cloud&lt;/strong&gt;, these options are carefully curated to help you build real-world skills and become job-ready. Each course combines structured modules, project-based learning, expert-led instruction, and certifications that can give you an edge in today’s competitive job market.&lt;/p&gt;

&lt;p&gt;Now is the best time to invest in your backend engineering career. Choose the course that suits you best and take the first step toward becoming a professional Java Backend Developer in 2025.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ready to Become a Java Backend Engineer?
&lt;/h3&gt;

&lt;p&gt;If you're serious about launching your backend engineering career with Java, then  &lt;a href="https://masteringbackend.com/courses/become-a-java-spring-backend-engineer?ref=top-5-backend-development-courses&amp;amp;utm_source=masteringbackend&amp;amp;utm_campaign=top-5-backend-development-courses&amp;amp;utm_medium=blog" rel="noopener noreferrer"&gt;&lt;strong&gt;Become a Java+Spring Backend Developer&lt;/strong&gt;&lt;/a&gt;  is the ultimate course to get you there.&lt;/p&gt;

&lt;p&gt;With a structured roadmap, real-world projects, and modules that take you from complete beginner to job-ready backend engineer, this course is your all-in-one solution. You'll learn everything from Java fundamentals to advanced Spring Boot microservices and even containerization with Docker and Kubernetes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Lifetime access&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hands-on projects&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Live sessions with experts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Certification on completion&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Designed by backend engineers for backend engineers&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Join thousands of developers already learning Java the right way.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://masteringbackend.com/courses/become-a-java-spring-backend-engineer?ref=top-5-backend-development-courses&amp;amp;utm_source=masteringbackend&amp;amp;utm_campaign=top-5-backend-development-courses&amp;amp;utm_medium=blog" rel="noopener noreferrer"&gt;Start Learning Today&lt;/a&gt;  — and build your future in backend engineering!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/kaperskyguru" rel="noopener noreferrer"&gt;Solomon Eseme&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Originally published at&lt;/em&gt; &lt;a href="https://blog.masteringbackend.com/top-5-java-backend-development-courses" rel="noopener noreferrer"&gt;&lt;em&gt;https://blog.masteringbackend.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>backenddevelopment</category>
      <category>courses</category>
      <category>backend</category>
    </item>
    <item>
      <title>Which AI Skills Actually Get You Hired in 2026?</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Thu, 19 Mar 2026 17:00:00 +0000</pubDate>
      <link>https://dev.to/masteringbackend/which-ai-skills-actually-get-you-hired-in-2026-4dlc</link>
      <guid>https://dev.to/masteringbackend/which-ai-skills-actually-get-you-hired-in-2026-4dlc</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzm513domz85vwjbaq6j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuzm513domz85vwjbaq6j.png" alt="imagedescription" width="800" height="1003"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've been thinking a lot about the AI job market lately.&lt;/p&gt;

&lt;p&gt;Everyone says "learn AI", but which skills actually matter?&lt;/p&gt;

&lt;p&gt;After talking with hiring managers and seeing what's actually in demand, here are&lt;br&gt;
the 3 skills that separate candidates:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;RAG Implementation&lt;/strong&gt; — Real document processing and vector databases, not
just API calls&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Observability&lt;/strong&gt; — Tracking and debugging AI systems in production&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost Optimization&lt;/strong&gt; — Making AI affordable to run at scale&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Notice what's NOT on this list? "Prompt engineering." Everyone claims that.--&lt;/p&gt;

&lt;p&gt;If you want to go deeper, I'm hosting a free workshop this Saturday with Victor&lt;br&gt;
Eduoh from Laand.&lt;/p&gt;

&lt;h3&gt;
  
  
  "How to Land AI Engineering Jobs."
&lt;/h3&gt;

&lt;p&gt;Saturday, March 22nd. 4 PM UTC. Free.&lt;/p&gt;

&lt;h3&gt;
  
  
  Register here: &lt;a href="http://lu.ma/mb-events" rel="noopener noreferrer"&gt;http://lu.ma/mb-events&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Even if you never take my bootcamp, this workshop will change how you approach AI&lt;br&gt;
jobs.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>backenddevelopment</category>
      <category>skills</category>
      <category>backend</category>
    </item>
    <item>
      <title>Spring Boot + Redis + Docker: Ultimate Guide to Caching in Java</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Thu, 19 Mar 2026 10:30:00 +0000</pubDate>
      <link>https://dev.to/masteringbackend/spring-boot-redis-docker-ultimate-guide-to-caching-in-java-4lbp</link>
      <guid>https://dev.to/masteringbackend/spring-boot-redis-docker-ultimate-guide-to-caching-in-java-4lbp</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyj1wgo4zi0hiupvr9tf9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyj1wgo4zi0hiupvr9tf9.png" alt="Spring Boot + Redis + Docker: Ultimate Guide to Caching in Java" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With Redis, your Spring Boot app can become faster and handle more traffic without breaking a sweat. This article will show you how to set it up step by step. However, before diving deep into Redis, we need to understand the concept of  &lt;strong&gt;caching&lt;/strong&gt;.&lt;/p&gt;

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

&lt;p&gt;Cache is a fast, small, temporary storage frequently used by the computer or application to store and access important data.&lt;/p&gt;

&lt;p&gt;It stores data in a key-value format. By leveraging cache memory, we can minimize database calls, improving application performance since database queries are typically resource-intensive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The main objective of a cache is to speed up the retrieval of data by making a copy of the data in a location that can be accessed faster than the source or database.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A cache is a small and fast, and efficient memory space that an application frequently uses to store or access important data.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynfr6tswotyvb306edmc.png" alt="image (8).png" width="800" height="401"&gt;Why Caching?
&lt;/h3&gt;

&lt;p&gt;The main objective of a cache is to speed up the retrieval of data by making a copy of the data in a location that can be accessed faster than the source or database.&lt;/p&gt;

&lt;p&gt;In our application, whenever multiple requests access static data (data that is not changed frequently), we fetch the data from the database every time. Therefore, the number of database calls increases, which affects the performance of our application because database calls are always costly.&lt;/p&gt;

&lt;p&gt;However, the static data can be stored in a cache, and whenever a request is made to access the data, it is fetched from the cache. As a result, the number of database calls is reduced, and the application's performance is improved.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does a Cache work?
&lt;/h3&gt;

&lt;p&gt;In the diagram above, multiple requests made to access the data in the application will first check the cache to determine whether the data is present. If the data is found, it is returned from the cache, a concept known as a  &lt;em&gt;Cache Hit&lt;/em&gt;. If the data is not found, it is retrieved from the database, which is referred to as a  &lt;em&gt;Cache Miss&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cache Hit
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Data is found in the cache, so it has to be fetched from a faster source.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can understand the cache hit like this: imagine you have a notebook where you write down answers to questions you frequently ask. You ask a question, and the answer is already written in your notebook. You quickly find it without searching elsewhere.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cache Miss
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Data is not found in the cache, so it has to be fetched from a slower source.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Similarly, you asked a question, but it’s not in your notebook. You have to search in a big textbook (which takes more time) and then write the answer in your notebook for future use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Redis
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo0wor1d5l5eebsv7spco.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo0wor1d5l5eebsv7spco.webp" alt="redis.webp" width="512" height="512"&gt;&lt;/a&gt;Redis (Remote Dictionary Server) is an open-source, in-memory key-value data store that supports various data structures, including strings, lists, sets, and hashes. Its in-memory architecture ensures high performance, making it an ideal choice for caching and session management in modern applications.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;spring-boot-starter-redis&lt;/strong&gt; is a Spring Boot starter that simplifies integrating Redis into Spring applications. It includes all the necessary dependencies to connect, configure, and operate with Redis.&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;dependency&amp;gt;
      &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
      &amp;lt;artifactId&amp;gt;spring-boot-starter-data-redis&amp;lt;/artifactId&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Spring Boot provides the  &lt;code&gt;spring-boot-starter-redis&lt;/code&gt;  starter, enabling seamless communication with the Redis server. It includes various components that facilitate efficient interaction with Redis.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JedisConnectionFactory&lt;/strong&gt;: Manages and establishes the connection between the Spring Boot application and the Redis server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;RedisTemplate&lt;/strong&gt;: It provides methods to perform operations like saving, retrieving, and deleting data in Redis.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;StringRedisTemplate&lt;/strong&gt;: A specialized version of  &lt;code&gt;RedisTemplate&lt;/code&gt;  that simplifies operations for String-based keys and values.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OpsForValue&lt;/strong&gt;: Supports operations on simple key-value pairs in Redis.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OpsForHash&lt;/strong&gt;: It is providing methods to perform operations based on the Hash Data structure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OpsForList&lt;/strong&gt;: Provides methods to interact with Redis Lists.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OpsForSet&lt;/strong&gt;: Facilitates operations on Redis Sets.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Spring Boot with Redis Integration
&lt;/h2&gt;

&lt;p&gt;Spring Boot provides seamless integration with Redis, an in-memory data store, through the  &lt;code&gt;spring-boot-starter-redis&lt;/code&gt;  starter. It simplifies configuration and enables developers to use Redis for caching, messaging, and data persistence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites for Running the Spring Boot Redis Integration Project&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Redis Server (Local or Cloud-based; here we use Docker)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Java Development Kit (JDK 17 or above)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maven (Build tool)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;IDE (e.g., IntelliJ IDEA, Eclipse, or Spring Tool Suite)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Postman (Optional, for testing REST APIs)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Project Build Using Maven&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Docker Redis Setup
&lt;/h3&gt;

&lt;p&gt;In this article, we install Redis using Docker. We can also manually download it from the Redis website, but here, we download the &lt;a href="https://hub.docker.com/_/redis/tags" rel="noopener noreferrer"&gt;latest Redis image from Docker Hub&lt;/a&gt; &lt;a href="https://hub.docker.com/_/redis/tags" rel="noopener noreferrer"&gt;&lt;/a&gt; (ensure Docker is already installed on your machine).&lt;/p&gt;

&lt;p&gt;We have a sample Spring Boot application that you can  &lt;a href="https://github.com/ayushstwt/product-api" rel="noopener noreferrer"&gt;clone from GitHub&lt;/a&gt;  for initial setup. The initial code is available in the main branch, so please check out the main or redis integration branch. I also added the Postman collection to the root directory of the project so you can test all the API before integration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps to Integrate Redis with Spring Boot
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt; Add the Maven dependency in the  &lt;code&gt;pom.xml&lt;/code&gt;  file. Since we are using Docker, we also include the Docker Compose dependency.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;spring-boot-starter-redis&amp;lt;/artifactId&amp;gt;
&amp;lt;/dependency&amp;gt;

&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;spring-boot-docker-compose&amp;lt;/artifactId&amp;gt;
    &amp;lt;scope&amp;gt;runtime&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Configure Redis Connection or database connection (we’re using H2 as database). Add the Redis server configuration to  &lt;code&gt;application.properties&lt;/code&gt;  or  &lt;code&gt;application.yml&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;spring.application.name=spring-boot-redis-cache

spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect

spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true

spring.cache.type=redis
spring.data.redis.host=localhost
spring.data.redis.port=6379

# if we are using local redis or cloud but here we use docker so there is no need of username or password
spring.data.redis.username=
spring.data.redis.password=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the  &lt;code&gt;docker-compose.yml&lt;/code&gt;  file in the root folder with the same naming convention we follow for docker-redis configurations.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services:
  redis:
    image: redis:7.4.2
    ports:
      - 6379:6379
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Mark the Spring Boot application class as  &lt;code&gt;@EnableCaching&lt;/code&gt;  to enable caching in our Spring Boot application. To enable caching in our Spring Boot application, add the &lt;code&gt;@EnableCaching&lt;/code&gt; annotation to one of our configuration classes. This annotation triggers a post-processor that inspects each Spring bean for caching annotations.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.ayshriv.springbootrediscache;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;

@SpringBootApplication
@EnableCaching
public class SpringBootRedisCacheApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootRedisCacheApplication.class, args);
    }

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

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the class  &lt;code&gt;RedisConfig.class&lt;/code&gt;  inside the config package
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.ayshriv.springbootrediscache.config;

import com.techie.springbootrediscache.dto.ProductDto;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializationContext;

import java.time.Duration;

@Configuration  // Marks this class as a Spring configuration class
public class RedisConfig {

    @Bean  // Defines a Spring bean for RedisCacheManager
    public RedisCacheManager redisCacheManager(RedisConnectionFactory redisConnectionFactory) {
        // Define cache configuration
        RedisCacheConfiguration cacheConfig = RedisCacheConfiguration.defaultCacheConfig()
                .entryTtl(Duration.ofMinutes(10)) // Set time-to-live (TTL) for cache entries to 10 minutes
                .disableCachingNullValues() // Prevent caching of null values
                .serializeValuesWith(RedisSerializationContext.SerializationPair
                        .fromSerializer(new Jackson2JsonRedisSerializer&amp;lt;&amp;gt;(ProductDto.class))); // Serialize values using Jackson JSON serializer

        // Create and return a RedisCacheManager with the specified configuration
        return RedisCacheManager.builder(redisConnectionFactory)
                .cacheDefaults(cacheConfig) // Apply default cache configuration
                .build();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This class configures Redis caching in a Spring Boot application. The  &lt;code&gt;@Configuration&lt;/code&gt;  annotation marks it as a configuration class, and the  &lt;code&gt;@Bean&lt;/code&gt;  annotation defines a  &lt;code&gt;RedisCacheManager&lt;/code&gt;  bean.&lt;/p&gt;

&lt;p&gt;The cache configuration includes a time-to-live (TTL) of 10 minutes  &lt;code&gt;(Duration.ofMinutes(10))&lt;/code&gt;, which ensures that cached data expires automatically after this period. It also disables the caching of  &lt;code&gt;null&lt;/code&gt;  values  &lt;code&gt;(disableCachingNullValues())&lt;/code&gt;  to optimize memory usage.&lt;/p&gt;

&lt;p&gt;For serialization, the  &lt;code&gt;Jackson2JsonRedisSerializer&lt;/code&gt;  is used, which converts Java objects  &lt;code&gt;(ProductDto)&lt;/code&gt;  to JSON before storing them in Redis. This ensures that cached data remains structured and readable.&lt;/p&gt;

&lt;p&gt;The  &lt;code&gt;RedisCacheManager.builder(redisConnectionFactory).cacheDefaults(cacheConfig).build()&lt;/code&gt;  the method initializes the cache manager with the given configuration and connects it to the Redis database using  &lt;code&gt;RedisConnectionFactory&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;After doing all the configurations, we implement the caching on the business class (service class).
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package com.ayshriv.springbootrediscache.service;

import com.techie.springbootrediscache.dto.ProductDto;
import com.techie.springbootrediscache.entity.Product;
import com.techie.springbootrediscache.repository.ProductRepository;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class ProductService {

    private final ProductRepository productRepository;

    public ProductService(ProductRepository productRepository) {
        this.productRepository = productRepository;
    }

    @CachePut(value="PRODUCT_CACHE", key="#result.id")
    public ProductDto createProduct(ProductDto productDto) {
        var product = new Product();
        product.setName(productDto.name());
        product.setPrice(productDto.price());

        Product savedProduct = productRepository.save(product);
        return new ProductDto(savedProduct.getId(), savedProduct.getName(),
                savedProduct.getPrice());
    }

    @Cacheable(value="PRODUCT_CACHE", key="#productId")
    public ProductDto getProduct(Long productId) {
        Product product = productRepository.findById(productId)
                .orElseThrow(() -&amp;gt; new IllegalArgumentException("Cannot find product with id " + productId));
        return new ProductDto(product.getId(), product.getName(),
                product.getPrice());
    }

    @CachePut(value="PRODUCT_CACHE", key="#result.id")
    public ProductDto updateProduct(ProductDto productDto) {
        Long productId = productDto.id();
        Product product = productRepository.findById(productId)
                .orElseThrow(() -&amp;gt; new IllegalArgumentException("Cannot find product with id " + productId));

        product.setName(productDto.name());
        product.setPrice(productDto.price());

        Product updatedProduct = productRepository.save(product);
        return new ProductDto(updatedProduct.getId(), updatedProduct.getName(),
                updatedProduct.getPrice());
    }

    @CacheEvict(value="PRODUCT_CACHE", key="#productId")
    public void deleteProduct(Long productId) {
        productRepository.deleteById(productId);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we mark the  &lt;code&gt;createProduct()&lt;/code&gt;  method with this  &lt;code&gt;@CachePut(value = "PRODUCT_CACHE", key = "#result.id")&lt;/code&gt;  annotation, this ensures that the object returned by this method is stored or updated in the cache named  &lt;code&gt;PRODUCT_CACHE&lt;/code&gt;, and the key part specifies that the cache key should be the ID of the returned  &lt;code&gt;ProductDto&lt;/code&gt;  object.&lt;/p&gt;

&lt;p&gt;This is useful in scenarios where a new product is created or an existing product is updated, as it ensures that the latest product details are stored in the cache. By using this annotation, subsequent requests for the same product can be served quickly from the cache,  &lt;strong&gt;reducing database queries and improving application performance&lt;/strong&gt;  while keeping the cache up to date.&lt;/p&gt;

&lt;p&gt;Next, when we mark the  &lt;code&gt;getProductById()&lt;/code&gt;  method with this  &lt;code&gt;@Cacheable(value = "PRODUCT_CACHE", key = "#productId")&lt;/code&gt;  annotation, this ensures that the returned object by this method is  &lt;strong&gt;stored in the cache&lt;/strong&gt;  named  &lt;code&gt;"PRODUCT_CACHE"&lt;/code&gt;, and the  &lt;code&gt;key&lt;/code&gt;  The part specifies that the cache key should be the  &lt;code&gt;productId&lt;/code&gt;  parameter passed to the method.&lt;/p&gt;

&lt;p&gt;If the requested  &lt;code&gt;productId&lt;/code&gt;  is already present in the cache, the method  &lt;strong&gt;skips execution&lt;/strong&gt;  and directly returns the cached value, avoiding a database call. However, if the  &lt;code&gt;productId&lt;/code&gt;  is not found in the cache, the method executes, retrieves the product from the database,  &lt;strong&gt;stores the result in the cache&lt;/strong&gt;, and then returns it.&lt;/p&gt;

&lt;p&gt;When we mark the  &lt;code&gt;deleteProduct()&lt;/code&gt;  method with this  &lt;code&gt;@CacheEvict(value = "PRODUCT_CACHE", key = "#productId")&lt;/code&gt;  annotation, this ensures that the  &lt;strong&gt;cache entry associated with the given&lt;/strong&gt; &lt;code&gt;productId&lt;/code&gt; &lt;strong&gt;is removed&lt;/strong&gt;  from the cache named  &lt;code&gt;"PRODUCT_CACHE"&lt;/code&gt;. The  &lt;code&gt;key&lt;/code&gt;  part specifies that the cache key to be evicted is the  &lt;code&gt;productId&lt;/code&gt;  parameter passed to the method.&lt;/p&gt;

&lt;p&gt;This means that after deleting a product from the database, its cached entry will also be removed, ensuring that  &lt;strong&gt;stale data is not served from the cache&lt;/strong&gt;  in future requests. If the deleted product is requested again, it will be fetched from the database and re-cached if applicable.&lt;/p&gt;

&lt;p&gt;Here, we do all the things with the help of the annotation-based approach, but we can also do the same things with the help of  &lt;code&gt;CacheManager&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The  &lt;code&gt;CacheManager&lt;/code&gt;  It is a  &lt;strong&gt;Spring framework interface&lt;/strong&gt;  responsible for managing different cache implementations. It acts as a central mechanism to store, retrieve, and manage cached data efficiently..&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private final CacheManager cacheManager;

public ProductDto createProduct(ProductDto productDto) {
        var product = new Product();
        product.setName(productDto.name());
        product.setPrice(productDto.price());

        Product savedProduct = productRepository.save(product);
        Cache productCache = cacheManager.getCache("PRODUCT_CACHE");
        productCache.put(savedProduct.getId(), savedProduct);

        return new ProductDto(savedProduct.getId(), savedProduct.getName(),
                savedProduct.getPrice());
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the application
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;ADD-PRODUCT:  &lt;a href="http://localhost:8080/api/product" rel="noopener noreferrer"&gt;http://localhost:8080/api/product&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6z2orxyqpckjgd3b75o8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6z2orxyqpckjgd3b75o8.png" alt="image (9).png" width="800" height="445"&gt;&lt;/a&gt;2. GET-PRODUCT:  &lt;a href="http://localhost:8080/api/product/3" rel="noopener noreferrer"&gt;http://localhost:8080/api/product/3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhs1042233fn8md9mkfz4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhs1042233fn8md9mkfz4.png" alt="image (10).png" width="800" height="449"&gt;&lt;/a&gt;3. UPDATE PRODUCT:  &lt;a href="http://localhost:8080/api/product" rel="noopener noreferrer"&gt;http://localhost:8080/api/product&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwayhfzjksqf7r1bst3t6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwayhfzjksqf7r1bst3t6.png" alt="image (11).png" width="800" height="446"&gt;&lt;/a&gt;4. DELETE PRODUCT:  &lt;a href="http://localhost:8080/api/product/2" rel="noopener noreferrer"&gt;http://localhost:8080/api/product/2&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm5b8vh6ocb3mw51qtwnc.png" alt="image (12).png" width="800" height="446"&gt;Conclusion
&lt;/h2&gt;

&lt;p&gt;Redis with Spring Boot makes apps faster by caching data and reducing database calls. Using  &lt;code&gt;@Cacheable&lt;/code&gt;,  &lt;code&gt;@CachePut&lt;/code&gt;, and  &lt;code&gt;@CacheEvict,&lt;/code&gt; We can easily store, update, and delete cached data. This improves speed, reduces server load, and helps the app handle more users smoothly.&lt;/p&gt;

&lt;p&gt;When we are performing the create operation, the response of this operation is stored in the cache, so whenever we perform operations like the  &lt;code&gt;getProduct()&lt;/code&gt;  It checks the product in the cache first; if the product is present inside the cache, it returns that; if not, then it will return from the database.&lt;/p&gt;

&lt;p&gt;Similarly, when we perform the delete operation, first it deletes the data from the database and then deletes it from the cache as well. All these types of operations reduce the number of DB calls so the performance of the application is increased.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/ayush" rel="noopener noreferrer"&gt;Ayush Shrivastava&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Originally published at&lt;/em&gt; &lt;a href="https://blog.masteringbackend.com/spring-boot-redis-docker-ultimate-guide-to-caching-in-java" rel="noopener noreferrer"&gt;&lt;em&gt;https://blog.masteringbackend.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>springboot</category>
      <category>backenddevelopment</category>
      <category>docker</category>
      <category>caching</category>
    </item>
    <item>
      <title>How to Become a Backend Developer (2026)</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Wed, 18 Mar 2026 10:30:00 +0000</pubDate>
      <link>https://dev.to/masteringbackend/how-to-become-a-backend-developer-2026-2mbm</link>
      <guid>https://dev.to/masteringbackend/how-to-become-a-backend-developer-2026-2mbm</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdevo29pvmrqf2461kp2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdevo29pvmrqf2461kp2k.png" alt="How to Become a Backend Developer (2026)" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The world of backend development can feel overwhelming at first, especially if you're just starting. However, you're in the right place if you’re a newbie or someone curious about backend development. In this guide, we will break down everything you need to know to become a backend developer in 2025, step by step.&lt;/p&gt;

&lt;p&gt;We will explore the core concepts of backend development, the technologies you’ll need to learn, and the pathways to becoming a proficient backend developer. By the end of this guide, you’ll have a clear roadmap for your journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Backend Development?
&lt;/h2&gt;

&lt;p&gt;Backend development refers to the server-side of web applications. It’s everything that happens behind the scenes that users don’t see, but is crucial to make the app work. As a backend developer, you will deal with databases, server management, APIs, and the business logic that powers the app.&lt;/p&gt;

&lt;p&gt;To help you visualize, let’s break down the core components of a backend application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server&lt;/strong&gt;: The physical or virtual machine that hosts the web application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Database&lt;/strong&gt;: The storage system where the application data is stored, such as MySQL, MongoDB, or PostgreSQL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Application&lt;/strong&gt;: The code that runs the logic of the app. It handles the requests made by users and fetches the data from the database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;APIs (Application Programming Interfaces)&lt;/strong&gt;: These allow different systems to communicate with each other. Backend developers often create and manage APIs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s a  &lt;a href="https://masteringbackend.com/hubs/backend-engineering" rel="noopener noreferrer"&gt;structured backend development content hub&lt;/a&gt;  that will guide you step-by-step to become a great backend engineer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to Becoming a Backend Developer
&lt;/h2&gt;

&lt;p&gt;Below are the steps to become a backend developer. We have included course recommendations are the latter part of this guide to help you get started immediately.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkq2yftad24xxt9tjf97d.png" alt="steps.png" width="800" height="1200"&gt;1. Learn the Fundamentals of Programming&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;As with any programming role, learning the fundamentals of coding is crucial. Before jumping into backend-specific technologies, you should have a strong understanding of the following core concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Variables and Data Types&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Control Structures (if statements, loops)&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Functions and Methods&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Object-Oriented Programming (OOP)&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Programming languages that are commonly used in backend development include Python, Java, JavaScript (Node.js), Ruby, PHP, and Go. If you're just starting out, we recommend  &lt;strong&gt;Python&lt;/strong&gt;  for its readability and versatility, which makes it a popular choice for beginners.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Choose a Backend Language&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Once you're comfortable with the basics of programming, it’s time to pick a backend language. Each backend language has its strengths and is suited for different types of applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommended Backend Languages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt;: A great starting language due to its simplicity and wide usage in backend frameworks like Django and Flask.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JavaScript (Node.js)&lt;/strong&gt;: If you already know JavaScript from frontend development, learning Node.js will allow you to use the same language on both the frontend and backend.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java&lt;/strong&gt;: Known for its stability and scalability, Java is used for large enterprise-level applications and backend systems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ruby&lt;/strong&gt;: Ruby on Rails is a popular framework for building web applications quickly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Go (Golang)&lt;/strong&gt;: A systems programming language designed by Google, Go is known for its speed and efficiency, making it ideal for high-performance applications.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For someone starting, we would recommend starting with  &lt;strong&gt;Python&lt;/strong&gt;  or  &lt;strong&gt;JavaScript (Node.js)&lt;/strong&gt;, as both have extensive resources and beginner-friendly frameworks.&lt;/p&gt;

&lt;p&gt;At Masteringbackend, we have a series of courses on  &lt;a href="https://masteringbackend.com/courses/become-a-python-backend-engineer" rel="noopener noreferrer"&gt;Python&lt;/a&gt;,  &lt;a href="https://masteringbackend.com/courses/become-a-nodejs-backend-engineer" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt;,  &lt;a href="https://masteringbackend.com/courses/become-a-rust-backend-engineer" rel="noopener noreferrer"&gt;Rust&lt;/a&gt;,  &lt;a href="https://masteringbackend.com/courses/become-a-ruby-backend-engineer" rel="noopener noreferrer"&gt;Ruby&lt;/a&gt;, PHP, and  &lt;a href="https://masteringbackend.com/courses/become-a-golang-backend-engineer" rel="noopener noreferrer"&gt;Golang&lt;/a&gt;  created following industry-standard roadmaps to turn you into a great backend engineer.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Learn about Databases&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Backend development involves dealing with data, so understanding how databases work is crucial. There are two primary types of databases you'll encounter in backend development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Relational Databases (SQL)&lt;/strong&gt;: These databases store data in tables and use SQL (Structured Query Language) to interact with the data. Popular examples include  &lt;strong&gt;MySQL&lt;/strong&gt;,  &lt;strong&gt;PostgreSQL&lt;/strong&gt;, and  &lt;strong&gt;SQLite&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Non-relational Databases (NoSQL)&lt;/strong&gt;: These databases are more flexible and store data in formats like JSON or key-value pairs. Examples include  &lt;strong&gt;MongoDB&lt;/strong&gt;,  &lt;strong&gt;Redis&lt;/strong&gt;, and  &lt;strong&gt;Cassandra&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Learning SQL is essential for any backend developer, as it’s used to query relational databases. But understanding NoSQL databases is equally important, especially as the web becomes more data-driven.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Use SQL vs. NoSQL:
&lt;/h2&gt;

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

&lt;p&gt;&lt;a href="https://masteringbackend.com/hubs/backend-engineering/mastering-database" rel="noopener noreferrer"&gt;Get acquainted with databases&lt;/a&gt;  and how they help store, retrieve, and manipulate data.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;4. Understand How the Web Works&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;As a backend developer, you’ll need to understand how the web works at a fundamental level. This includes learning about HTTP (Hypertext Transfer Protocol), the protocol that powers web communication. Here are a few key concepts to master:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTP Methods&lt;/strong&gt;: GET, POST, PUT, DELETE, and PATCH.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Request and Response&lt;/strong&gt;: How clients (e.g., web browsers) send requests to the server, and how the server responds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Status Codes&lt;/strong&gt;: What different HTTP status codes (like 200, 404, 500) mean and how to handle them.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;RESTful APIs&lt;/strong&gt;: Learn how REST (Representational State Transfer) works to create standardized APIs that allow different systems to communicate.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding the flow of information from the client to the server is essential in backend development.&lt;/p&gt;

&lt;p&gt;Here's a diagram that illustrates how various components interact in a backend system:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8zqmo7cr8fl93kjkb9z5.png" alt="dev work.png" width="800" height="800"&gt;5. Master a Backend Framework&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Once you’ve chosen your backend language and learned the basics, it’s time to dive into frameworks. Frameworks make backend development easier by providing tools and libraries that handle common tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Popular Backend Frameworks:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt;:  &lt;a href="https://masteringbackend.com/hubs/backend-engineering/django-tutorial-the-ultimate-guide" rel="noopener noreferrer"&gt;Django&lt;/a&gt;, Flask&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JavaScript (&lt;/strong&gt;&lt;a href="https://masteringbackend.com/hubs/backend-engineering/nodejs-essentials" rel="noopener noreferrer"&gt;&lt;strong&gt;Node.js&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;:  &lt;a href="https://masteringbackend.com/hubs/backend-engineering/expressjs-5-tutorial-the-ultimate-guide" rel="noopener noreferrer"&gt;Express.js&lt;/a&gt;, Koa.js&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java&lt;/strong&gt;:  &lt;a href="https://masteringbackend.com/hubs/backend-engineering/spring-boot" rel="noopener noreferrer"&gt;Spring Boot&lt;/a&gt;, Java EE&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ruby&lt;/strong&gt;: Ruby on Rails&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these frameworks has its own strengths, but  &lt;strong&gt;Django (Python)&lt;/strong&gt;  and  &lt;strong&gt;Express (Node.js)&lt;/strong&gt;  are excellent choices for beginners. They both have large communities and extensive documentation, making it easier to get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;6. Learn About APIs and Web Services&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;As a backend developer, you’ll often need to create and manage  &lt;strong&gt;APIs&lt;/strong&gt;  (Application Programming Interfaces). APIs allow the backend to communicate with the frontend, third-party services, and external systems. Understanding how to build, test, and consume APIs is a crucial skill.&lt;/p&gt;

&lt;p&gt;A commonly used architectural style for APIs is  &lt;strong&gt;REST (Representational State Transfer)&lt;/strong&gt;, but you may also encounter  &lt;strong&gt;GraphQL&lt;/strong&gt;  or  &lt;strong&gt;gRPC&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Building a RESTful API:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Use appropriate  &lt;strong&gt;HTTP methods&lt;/strong&gt;  (GET, POST, PUT, DELETE)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ensure the API is  &lt;strong&gt;stateless&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Design  &lt;strong&gt;meaningful resource names&lt;/strong&gt;  and use proper HTTP status codes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;API and API design is a broad topic and one that is necessary for every backend engineer. We have covered  &lt;a href="https://newsletter.masteringbackend.com/archive?tags=API+Design" rel="noopener noreferrer"&gt;API and API design in our newsletter series here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;7. Version Control with Git&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Version control is an essential skill for any developer.  &lt;strong&gt;Git&lt;/strong&gt;  helps you track changes in your code, collaborate with other developers, and deploy your code to production.&lt;/p&gt;

&lt;p&gt;Learn how to use  &lt;strong&gt;Git&lt;/strong&gt;  for managing your code and collaborating with other developers on platforms like  &lt;strong&gt;GitHub&lt;/strong&gt;  or  &lt;strong&gt;GitLab&lt;/strong&gt;. Mastering Git is a must-have skill for backend developers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Branching, Pull Requests, and Merge Conflicts&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Learn how to create feature branches and submit pull requests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Understand how to resolve  &lt;strong&gt;merge conflicts&lt;/strong&gt;  to maintain a clean codebase.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;8. Testing and Debugging&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Testing is a vital part of backend development. It ensures that the application behaves as expected and helps catch bugs early in development. Learn how to write unit tests, integration tests, and use debugging tools to troubleshoot issues in your backend code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of Testing:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unit Testing&lt;/strong&gt;: Testing individual components in isolation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integration Testing&lt;/strong&gt;: Testing how different components work together.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;End-to-End Testing&lt;/strong&gt;: Testing the entire flow of an application.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Testing Tools&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Jest&lt;/strong&gt;  (for Node.js)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PyTest&lt;/strong&gt;  (for Python)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JUnit&lt;/strong&gt;  (for Java)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;9. Deploying Applications&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Once you’ve built a backend application, you need to deploy it. Learning how to deploy your backend code to a server is a critical step in the development process. Popular deployment platforms include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Heroku&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AWS (Amazon Web Services)&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Google Cloud Platform&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Microsoft Azure&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Learn how to deploy your backend applications to one of these platforms and understand the basics of  &lt;strong&gt;CI/CD (Continuous Integration and Continuous Deployment)&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;CI/CD and Docker&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Modern backend development requires not only deploying your applications but also setting up  &lt;strong&gt;CI/CD&lt;/strong&gt;  pipelines to automate testing and deployment.  &lt;strong&gt;Docker&lt;/strong&gt;  is a popular tool for containerizing applications, and  &lt;strong&gt;Kubernetes&lt;/strong&gt;  helps with managing these containers in a scalable way.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;10. Build Projects&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The best way to cement your knowledge is by building projects. Here are some project ideas to get started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Build a simple  &lt;strong&gt;CRUD&lt;/strong&gt;  application (Create, Read, Update, Delete) using a backend framework and database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a  &lt;strong&gt;blog API&lt;/strong&gt;  that allows users to create and manage blog posts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build an  &lt;strong&gt;e-commerce API&lt;/strong&gt;  for managing products, orders, and users.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can explore a list of  &lt;a href="https://projects.masteringbackend.com/" rel="noopener noreferrer"&gt;100+ backend projects&lt;/a&gt;  you can start building now.&lt;/p&gt;

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

&lt;p&gt;Becoming a backend developer takes time, practice, and a commitment to learning. By following the steps outlined in this guide, starting with the basics, learning key technologies, and building projects, you’ll be well on your way to becoming a skilled backend developer.&lt;/p&gt;

&lt;p&gt;If you’re looking for structured courses that will guide you step-by-step, check out  &lt;a href="http://masteringbackend.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;MasteringBackend.com&lt;/strong&gt;&lt;/a&gt;  for a variety of backend-focused courses designed to take you from beginner to pro.&lt;/p&gt;

&lt;p&gt;Remember, the journey to becoming a backend developer is all about consistency. Stay curious, keep building, and you’ll be creating powerful server-side applications in no time.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/kaperskyguru" rel="noopener noreferrer"&gt;Solomon Eseme&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Originally published at&lt;/em&gt; &lt;a href="https://blog.masteringbackend.com/how-to-become-a-backend-developer" rel="noopener noreferrer"&gt;&lt;em&gt;https://blog.masteringbackend.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>developer</category>
      <category>backenddevelopment</category>
      <category>2026</category>
      <category>backend</category>
    </item>
    <item>
      <title>Spring Boot + Docker: Dockerizing Java Spring Boot Apps</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Tue, 17 Mar 2026 10:30:00 +0000</pubDate>
      <link>https://dev.to/masteringbackend/spring-boot-docker-dockerizing-java-spring-boot-apps-10mf</link>
      <guid>https://dev.to/masteringbackend/spring-boot-docker-dockerizing-java-spring-boot-apps-10mf</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkak4ib27u4vmcrqukt1m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkak4ib27u4vmcrqukt1m.png" alt="Spring Boot + Docker: Dockerizing Java Spring Boot Apps" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker has changed the way we build, run, and scale applications.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It lets you package your app with everything it needs, so it runs the same everywhere, on your computer, on someone else’s, or on a server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker is one of the most popular tools for this.&lt;/strong&gt;  It helps keep things consistent and avoids the “it works on my machine” problem.&lt;/p&gt;

&lt;p&gt;In this blog, we will see how to containerize a Spring Boot application using Docker, step by step. By the end, you’ll be able to run your Spring Boot app inside a Docker container and deploy it seamlessly.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Docker&lt;/strong&gt;  gets its name from the term "dock worker," someone who loads and unloads shipping containers. Similarly, Docker "loads" and "runs" software containers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using docker we can implement the containerization technologies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Containerization is a concept that allows us to package software applications along with the necessary libraries and binaries required to run them. This package is called an image.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Docker is tool/platform that makes it easy to create, manage or run the containers.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://masteringbackend.com/posts/docker-tutorial" rel="noopener noreferrer"&gt;Click here to read the definitive guide to Docker.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi6bv9j5daibwu33d74mc.png" alt="Spring Boot Application with Docker.png" width="800" height="257"&gt;Why Docker?
&lt;/h2&gt;

&lt;p&gt;Suppose we're building a Spring Boot application on our local machine. It runs perfectly because our system has the correct versions of Java, Maven, and other necessary tools installed. However, when we want to deploy this application to another machine, we have to manually set up all the required software.&lt;/p&gt;

&lt;p&gt;In real-world projects, applications are typically deployed to multiple environments for testing and production, such as  &lt;strong&gt;DEV&lt;/strong&gt;,  &lt;strong&gt;UAT&lt;/strong&gt;,  &lt;strong&gt;SIT&lt;/strong&gt;, and  &lt;strong&gt;PROD&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Ensuring that each of these environments has the exact setup can be a time-consuming and error-prone process. One machine might have a different Java version or might be missing certain dependencies, leading to unexpected errors.&lt;/p&gt;

&lt;p&gt;Now, if we use Docker, we can create a  &lt;strong&gt;Dockerfile&lt;/strong&gt;  that includes our application, the exact Java version, and all required settings. Once packaged into a  &lt;strong&gt;Docker image&lt;/strong&gt;, the application can run on  &lt;strong&gt;any system with Docker installed,&lt;/strong&gt;  without worrying about environment-specific configurations. We can run the same container across all environments just as we do locally.&lt;/p&gt;

&lt;p&gt;This consistency not only saves time but also greatly simplifies both  &lt;strong&gt;development&lt;/strong&gt;  and  &lt;strong&gt;deployment&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;To follow along, ensure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://masteringbackend.com/hubs/java-backend-development" rel="noopener noreferrer"&gt;Basic knowledge of Java, Spring Boot, and Maven&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Java&lt;/li&gt;
&lt;li&gt;  Maven&lt;/li&gt;
&lt;li&gt;  Docker &amp;amp; Docker CLI&lt;/li&gt;
&lt;li&gt;  An IDE (e.g., IntelliJ, VS Code)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Simple Spring Boot Application
&lt;/h2&gt;

&lt;p&gt;We’ll use a simple Spring Boot project with just one REST API that returns  &lt;strong&gt;"Hello, World!"&lt;/strong&gt;  when the  &lt;strong&gt;/hello&lt;/strong&gt;  endpoint is accessed. We’ve pushed the code to GitHub, so you can simply clone the repository and switch to the  &lt;code&gt;master&lt;/code&gt;  branch.&lt;/p&gt;

&lt;p&gt;You can check out the full code here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ayushstwt/docker-spring-boot" rel="noopener noreferrer"&gt;https://github.com/ayushstwt/docker-spring-boot&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Test Spring Boot Application on  &lt;a href="http://localhost/" rel="noopener noreferrer"&gt;localhost&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://localhost:8080/hello" rel="noopener noreferrer"&gt;http://localhost:8080/hello&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2h9qzz8m4r8pha4csvbh.png" alt="image (17).png" width="800" height="439"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Docker Terminology
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Docker file-&lt;/strong&gt;  It contains set of instructions to build docker image.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Docker Image&lt;/strong&gt;- It is a package which contains application code + dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Docker Hub&lt;/strong&gt;- It is a registry to store docker images. (AWS ECR)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Docker Container&lt;/strong&gt;- It is a runtime instance of our application Run time instance of an image. If you run docker image container will be created that's where our application is running.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;To Generate docker image from our spring-boot application there are three different commonly used approaches. we can choose one of theme.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Dockerfile&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Buildpacks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Google Jib&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Approach 1
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Running a Spring Boot application as a container using Dockerfile
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;  - Run the maven command, “&lt;strong&gt;mvn clean install&lt;/strong&gt;”. to generate a fat jar inside the target folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;- Create the file name as  &lt;strong&gt;Dockerfile&lt;/strong&gt;  inside the root directory to generate a Docker image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM openjdk:17-jdk-slim
COPY target/docker-spring-boot-0.0.1-SNAPSHOT.jar docker-spring-boot-0.0.1-SNAPSHOT.jar
ENTRYPOINT ["java","-jar","/docker-spring-boot-0.0.1-SNAPSHOT.jar"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here in the above file&lt;/p&gt;

&lt;p&gt;&lt;code&gt;FROM openjdk:17-jdk-slim&lt;/code&gt;  – Uses a lightweight OpenJDK 17 base image to run the Spring Boot application.  &lt;code&gt;COPY target/docker-spring-boot-0.0.1-SNAPSHOT.jar docker-spring-boot-0.0.1-SNAPSHOT.jar&lt;/code&gt;  – Copies the built JAR file from the target directory into the Docker image.  &lt;code&gt;ENTRYPOINT ["java","-jar","/docker-spring-boot-0.0.1-SNAPSHOT.jar"]&lt;/code&gt;  – Defines the command to run the Spring Boot JAR when the container starts.&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To use Docker, first download Docker Desktop from  &lt;a href="http://docker.com/products/docker-desktop" rel="noopener noreferrer"&gt;docker.com/products/docker-desktop&lt;/a&gt;. Pick the version for your OS (Windows or macOS). If you're on Linux, follow the guide at  &lt;a href="http://docs.docker.com/engine/install" rel="noopener noreferrer"&gt;docs.docker.com/engine/install&lt;/a&gt;. Install it like any app and launch Docker Desktop.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next, open your terminal and run  &lt;code&gt;docker login&lt;/code&gt;. Enter your Docker Hub username and password. If you don’t have an account, create one at  &lt;a href="http://hub.docker.com/signup" rel="noopener noreferrer"&gt;hub.docker.com/signup&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once logged in, you’re ready to build images, run containers, and manage apps easily.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;  - Execute the docker command to generate the docker image based on the tag name. make sure that your docker desktop is running.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// syntax
docker build -t your-image-name:tag .

// command
docker build -t ayshriv/docker-spring-boot:latest .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After executing this command, you’ll see an output indicating that the Docker image was successfully generated. The  &lt;code&gt;docker build&lt;/code&gt;  command is used to create a Docker image from a Dockerfile. The  &lt;code&gt;-t&lt;/code&gt;  flag allows you to specify a name for your image and optionally assign a version tag.&lt;/p&gt;

&lt;p&gt;For example, in  &lt;code&gt;docker-spring-boot:latest&lt;/code&gt;,  &lt;code&gt;docker-spring-boot&lt;/code&gt;  is the image name and  &lt;code&gt;latest&lt;/code&gt;  is the tag. The  &lt;code&gt;.&lt;/code&gt;  (dot) at the end tells Docker to use the current directory as the build context, where it looks for the Dockerfile and all necessary files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gbwvnmf0l24m3tyob7q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gbwvnmf0l24m3tyob7q.png" alt="image (18).png" width="800" height="191"&gt;&lt;/a&gt;To verify that the image was successfully created, use the  &lt;code&gt;docker images&lt;/code&gt;  command. This will list all the Docker images available on your system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb6pb8efteo084tuobqvt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb6pb8efteo084tuobqvt.png" alt="image (19).png" width="614" height="81"&gt;&lt;/a&gt;&lt;strong&gt;Step 4&lt;/strong&gt;  - Next, execute the following command to create and run a Docker container based on the image you just built.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -p 8080:8080 ayshriv/docker-spring-boot:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The command  &lt;code&gt;docker run -p 8080:8080 ayshriv/docker-spring-boot:latest&lt;/code&gt;  is used to start a Docker container from the image we built. The  &lt;code&gt;-p 8080:8080&lt;/code&gt;  option maps port  &lt;strong&gt;8080 on your host machine&lt;/strong&gt;  to port  &lt;strong&gt;8080 inside the container&lt;/strong&gt;, allowing you to access the application via  &lt;a href="http://localhost:8080/" rel="noopener noreferrer"&gt;http://localhost:8080&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here,  &lt;code&gt;ayshriv/docker-spring-boot:latest&lt;/code&gt;  is the name and tag of the Docker image. This command runs your Spring Boot application inside a container, exactly as it would run in production.&lt;/p&gt;

&lt;p&gt;In the  &lt;code&gt;8080:8080&lt;/code&gt;  format:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The  &lt;strong&gt;first value (host port)&lt;/strong&gt;  is the external port on your machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The  &lt;strong&gt;second value (container port)&lt;/strong&gt;  is the internal port your app listens on inside the container.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After executing this command, you should see output indicating that the container is running successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fye3ozqtqj551qoxwsope.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fye3ozqtqj551qoxwsope.png" alt="image (20).png" width="800" height="278"&gt;&lt;/a&gt;To check if your container is running, use the  &lt;code&gt;docker ps&lt;/code&gt;  command. This will display a list of all currently running containers.&lt;/p&gt;

&lt;p&gt;The Docker image name  &lt;code&gt;ayshriv/docker-spring-boot:latest&lt;/code&gt;,  &lt;code&gt;ayshriv&lt;/code&gt;  is your Docker Hub username, which helps identify you as the owner of the image.  &lt;code&gt;docker-spring-boot&lt;/code&gt;  is the name of your application, and it's good practice to keep this name short, clear, and related to what your app does.&lt;/p&gt;

&lt;p&gt;The part after the colon,  &lt;code&gt;latest&lt;/code&gt;, is the tag, which usually refers to the current or most recent version of the image. You can also use tags like  &lt;code&gt;v1.0&lt;/code&gt;,  &lt;code&gt;prod&lt;/code&gt;, or  &lt;code&gt;dev&lt;/code&gt;  to manage different versions.&lt;/p&gt;

&lt;p&gt;While creating a Docker image using a Dockerfile is effective and widely adopted, it does have some drawbacks. One major issue is the  &lt;strong&gt;size of the resulting image&lt;/strong&gt;, which can be quite large—especially when using base images like OpenJDK. Larger images take more time to build, transfer, and start, which can negatively impact development speed and deployment efficiency.&lt;/p&gt;

&lt;p&gt;Additionally,  &lt;strong&gt;maintaining a Dockerfile requires ongoing effort&lt;/strong&gt;, as you'll need to update it whenever your application's structure or dependencies change. In our case, the generated image size is around  &lt;strong&gt;428MB&lt;/strong&gt;, which is quite substantial.&lt;/p&gt;

&lt;p&gt;The next approach we'll explore helps reduce image size and requires minimal manual effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approach 2
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Running a Spring Boot application as a container using Buildpacks
&lt;/h3&gt;

&lt;p&gt;Cloud Native Buildpacks transform your application source code into images that can run on any cloud. It is an alternative approach to dockerfiles. With the help of Buildpacks we can automatically generate production ready images form our application source code without writing the Dockerfile.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://buildpacks.io/" rel="noopener noreferrer"&gt;https://buildpacks.io/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 1- We need to add the given configuration inside the pom.xml for the image name.&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;build&amp;gt;
        &amp;lt;plugins&amp;gt;
            &amp;lt;plugin&amp;gt;
                &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
                &amp;lt;artifactId&amp;gt;spring-boot-maven-plugin&amp;lt;/artifactId&amp;gt;
                &amp;lt;configuration&amp;gt;
                    &amp;lt;image&amp;gt;
                            &amp;lt;name&amp;gt;ayshriv/${project.artifactId}:latest&amp;lt;/name&amp;gt;
                    &amp;lt;/image&amp;gt;
                &amp;lt;/configuration&amp;gt;
            &amp;lt;/plugin&amp;gt;
        &amp;lt;/plugins&amp;gt;
  &amp;lt;/build&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, also we follows the same naming convention for image name.&lt;/p&gt;

&lt;p&gt;Step 2- Now, we run the given maven command to generate the docker image with out the need of Dockerfile (make sure that docker desktop is running).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mvn spring-boot:build-image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;  – Next, execute the following command to create a Docker container from the image, along with the required port mapping.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -p 8080:8080 ayshriv/docker-spring-boot:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this approach, there’s  &lt;strong&gt;no need to create a Dockerfile manually&lt;/strong&gt;, and the resulting image size is also reduced. However, one limitation is that  &lt;strong&gt;Docker Desktop still needs to be installed&lt;/strong&gt;  on your local machine to build and run the image.&lt;/p&gt;

&lt;p&gt;To overcome this dependency, we can use  &lt;strong&gt;Google JIB&lt;/strong&gt;, a tool specifically designed for Java applications. JIB allows you to generate a Docker image for your Spring Boot application  &lt;strong&gt;without needing a Dockerfile or Docker installed locally&lt;/strong&gt;, while also producing smaller and more optimized images.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approach 3
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Running a Spring Boot application as a container using Google JIB
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/GoogleContainerTools/jib" rel="noopener noreferrer"&gt;https://github.com/GoogleContainerTools/jib&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Google JIB is used to Build container images for your Java applications, without need of Dockerfile and Docker Desktop. it is an alternative approach to dockerfiles. With the help of Google JIB we can automatically generate production ready images form our application source code without writing the Dockerfile.&lt;/p&gt;

&lt;p&gt;Step 1- we need to add the given configuration inside the pom.xml for the image name.&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;build&amp;gt;
  &amp;lt;plugins&amp;gt;
    &amp;lt;plugin&amp;gt;
      &amp;lt;groupId&amp;gt;com.google.cloud.tools&amp;lt;/groupId&amp;gt;
      &amp;lt;artifactId&amp;gt;jib-maven-plugin&amp;lt;/artifactId&amp;gt;
      &amp;lt;version&amp;gt;3.4.0&amp;lt;/version&amp;gt; 
      &amp;lt;configuration&amp;gt;
        &amp;lt;to&amp;gt;
          &amp;lt;image&amp;gt;ayshriv/${project.artifactId}:latest&amp;lt;/image&amp;gt;
        &amp;lt;/to&amp;gt;
      &amp;lt;/configuration&amp;gt;
    &amp;lt;/plugin&amp;gt;
  &amp;lt;/plugins&amp;gt;
&amp;lt;/build&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2- Run the given maven command to generate the docker image (for Google JIB there is no need of Docker Desktop to be installed on your local system).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mvn compile jib:dockerBuild
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;  – After this, execute the following command to create and run a Docker container based on the image, with the appropriate port mapping.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -p 8080:8080 ayshriv/docker-spring-boot:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this approach, we eliminate the need for a Dockerfile, and the resulting image size is significantly reduced. However, one limitation is that Docker Desktop must be installed on the local system to build and run Docker images. To overcome this dependency, we can use  &lt;strong&gt;Google JIB,&lt;/strong&gt;  a powerful tool specifically designed for Java applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Google JIB&lt;/strong&gt;  allows us to containerize our Spring Boot application  &lt;strong&gt;without writing a Dockerfile&lt;/strong&gt;  or having Docker installed locally. It integrates directly with Maven or Gradle, enabling seamless image creation and pushing to container registries. Additionally, JIB optimizes image layering, which helps in  &lt;strong&gt;reducing image size&lt;/strong&gt;  and speeding up rebuild times during development.&lt;/p&gt;

&lt;p&gt;Some Commonly Used Docker Commands for Java Developers&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# 1. Build Docker image from Dockerfile (usually for Spring Boot app)
docker build -t my-java-app .

# 2. List all images
docker images

# 3. Run the Docker container from the built image
docker run -d -p 8080:8080 --name java-app-container my-java-app

# 4. View running containers
docker ps

# 5. View all containers (including stopped ones)
docker ps -a

# 6. Stop a running container
docker stop java-app-container

# 7. Start a stopped container
docker start java-app-container

# 8. Restart a container
docker restart java-app-container

# 9. Remove a container
docker rm java-app-container

# 10. Remove an image
docker rmi my-java-app

# 11. View logs of a container (helpful for debugging)
docker logs java-app-container

# 12. Execute a command inside a running container (like inspecting files, checking logs)
docker exec -it java-app-container bash

# 13. Tag an image (e.g., for pushing to Docker Hub)
docker tag my-java-app ayushshrivastaav/my-java-app:latest

# 14. Login to Docker Hub
docker login

# 15. Push image to Docker Hub
docker push ayushshrivastaav/my-java-app:latest

# 16. Pull image from Docker Hub
docker pull ayushshrivastaav/my-java-app:latest

# 17. Remove all stopped containers
docker container prune -f

# 18. Remove all unused images
docker image prune -a -f

# 19. Check Docker version
docker version

# 20. View system-wide Docker resource usage
docker system df

# 21. Compose up (if using docker-compose.yml for multi-container apps)
docker-compose up -d

# 22. Compose down
docker-compose down
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/ayush" rel="noopener noreferrer"&gt;Ayush Shrivastava&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>springboot</category>
      <category>java</category>
      <category>docker</category>
      <category>backend</category>
    </item>
    <item>
      <title>How to use the Default Trait in Rust</title>
      <dc:creator>Jane</dc:creator>
      <pubDate>Mon, 16 Mar 2026 10:30:00 +0000</pubDate>
      <link>https://dev.to/masteringbackend/how-to-use-the-default-trait-in-rust-3mjj</link>
      <guid>https://dev.to/masteringbackend/how-to-use-the-default-trait-in-rust-3mjj</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F49buta0et2ws3ynwmzma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F49buta0et2ws3ynwmzma.png" alt="How to use the Default Trait in Rust" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;When working with structs or enums in Rust, we often need a way to create a "standard" or "initial" instance without specifying all the fields every time. Manually setting each field can be repetitive, especially for complex types. How can we create a sensible default instance of a type conveniently?&lt;/p&gt;

&lt;p&gt;Enter the  &lt;code&gt;std::default::Default&lt;/code&gt;  trait. This trait provides a standardized way for types to offer a default value. If a type implements  &lt;code&gt;Default&lt;/code&gt;, we can easily get a default instance, simplifying initialization and making our code cleaner, particularly when dealing with configuration structs or optional fields.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Need for Default Values
&lt;/h2&gt;

&lt;p&gt;Imagine a configuration struct for an application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;struct AppConfig {
    timeout_ms: u32,
    retries: u8,
    api_endpoint: String,
    enable_logging: bool,
}

fn main() {
    // Manually creating an instance feels verbose
    let config = AppConfig {
        timeout_ms: 5000,
        retries: 3,
        api_endpoint: "https://api.example.com".to_string(),
        enable_logging: false,
    };
    // ... use config ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we often need a configuration with standard settings (say, a timeout of 5000ms, 3 retries, a default endpoint, and logging disabled), writing this out repeatedly is tedious. Furthermore, if we add new fields to  &lt;code&gt;AppConfig&lt;/code&gt;, we have to update every place where we manually create it.&lt;/p&gt;

&lt;p&gt;This is where the  &lt;code&gt;Default&lt;/code&gt;  trait shines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing  &lt;code&gt;std::default::Default&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The  &lt;code&gt;Default&lt;/code&gt;  trait is remarkably simple. It's defined in the standard library  &lt;code&gt;(std::default::Default)&lt;/code&gt;  and requires implementing just one method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pub trait Default: Sized {
    fn default() -&amp;gt; Self;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The  &lt;code&gt;default()&lt;/code&gt;  associated function takes no arguments and returns an instance of the type  &lt;code&gt;(Self)&lt;/code&gt;  populated with default values. Many primitive types and standard library types already implement  &lt;code&gt;Default&lt;/code&gt;  (e.g., numbers default to 0,  &lt;code&gt;bool&lt;/code&gt;  to  &lt;code&gt;false&lt;/code&gt;,  &lt;code&gt;Option&lt;/code&gt;  to  &lt;code&gt;None&lt;/code&gt;,  &lt;code&gt;String&lt;/code&gt;  and  &lt;code&gt;Vec&lt;/code&gt;  to empty ones).&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementing  &lt;code&gt;Default&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;There are two main ways to make our types implement  &lt;code&gt;Default&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Using  &lt;code&gt;#[derive(Default)]&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If  &lt;em&gt;all&lt;/em&gt;  the fields within our struct also implement  &lt;code&gt;Default&lt;/code&gt;, we can simply ask the compiler to generate the implementation for us using the  &lt;code&gt;derive&lt;/code&gt;  attribute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#[derive(Default, Debug)] // We derive Default here!
struct AppConfig {
    timeout_ms: u32,       // u32 implements Default (defaults to 0)
    retries: u8,           // u8 implements Default (defaults to 0)
    api_endpoint: String,  // String implements Default (defaults to "")
    enable_logging: bool,  // bool implements Default (defaults to false)
}

fn main() {
    let default_config: AppConfig = AppConfig::default();
    println!("Default Config: {:?}", default_config);
    // Output: Default Config: AppConfig { timeout_ms: 0, retries: 0, api_endpoint: "", enable_logging: false }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the easiest way, but the derived defaults might not always be what we consider "sensible" (like 0 for  &lt;code&gt;timeout_ms)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For enums, we can also derive  &lt;code&gt;Default&lt;/code&gt;, but we must explicitly mark  &lt;em&gt;one&lt;/em&gt;  of the unit variants (a variant without data) with  &lt;code&gt;#[default]&lt;/code&gt;  to tell the compiler which one is the default:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#[derive(Default, Debug)]
enum LogLevel {
    Debug,
    Info,
    #[default] // Warning is the default level
    Warning,
    Error,
}

fn main() {
    let level: LogLevel = LogLevel::default();
    println!("Default log level: {:?}", level);
    // Output: Default log level: Warning
}

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

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Manual Implementation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If  &lt;code&gt;derive&lt;/code&gt;  isn't suitable (e.g., some fields don't implement  &lt;code&gt;Default&lt;/code&gt;, or we need specific default values different from the derived ones), we can implement the trait manually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#[derive(Debug)] // Cannot derive Default if we implement manually
struct AppConfig {
    timeout_ms: u32,
    retries: u8,
    api_endpoint: String,
    enable_logging: bool,
}

// Manual implementation
impl Default for AppConfig {
    fn default() -&amp;gt; Self {
        AppConfig {
            timeout_ms: 5000, // Sensible default timeout
            retries: 3,       // Sensible default retries
            api_endpoint: "https://api.example.com".to_string(), // Default endpoint
            enable_logging: false, // Logging off by default
        }
    }
}

fn main() {
    let sensible_defaults: AppConfig = AppConfig::default();
    println!("Sensible Defaults: {:?}", sensible_defaults);
    // Output: Sensible Defaults: AppConfig { timeout_ms: 5000, retries: 3, api_endpoint: "https://api.example.com", enable_logging: false }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we provide the exact default values we want inside the  &lt;code&gt;default()&lt;/code&gt;  function. Remember, we cannot both  &lt;code&gt;derive&lt;/code&gt;  and manually implement  &lt;code&gt;Default&lt;/code&gt;  for the same type.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Default
&lt;/h2&gt;

&lt;p&gt;Once a type implements  &lt;code&gt;Default&lt;/code&gt;, we can get its default value using  &lt;code&gt;TypeName::default()&lt;/code&gt;  or the fully qualified path  &lt;code&gt;std::default::Default::default()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A particularly useful pattern is combining  &lt;code&gt;Default::default()&lt;/code&gt;  with struct update syntax. This lets us specify only the fields we want to change, while the rest take their default values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#[derive(Default, Debug)]
struct AppConfig {
    timeout_ms: u32,
    retries: u8,
    api_endpoint: String,
    enable_logging: bool,
}

impl AppConfig {
 fn default() -&amp;gt; Self { // Custom sensible defaults
        AppConfig {
            timeout_ms: 5000,
            retries: 3,
            api_endpoint: "https://api.example.com".to_string(),
            enable_logging: false,
        }
    }
}


fn main() {
    // Override only timeout and logging, keep other defaults
    let custom_config = AppConfig {
        timeout_ms: 10000,
        enable_logging: true,
        ..AppConfig::default() // Fill the rest with defaults
    };

    println!("Custom Config: {:?}", custom_config);
    // Output: Custom Config: AppConfig { timeout_ms: 10000, retries: 3, api_endpoint: "https://api.example.com", enable_logging: true }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use our &lt;a href="https://playground.masteringbackend.com/javascript/?ref=masteringbackend&amp;amp;utm_source=masteringbackend&amp;amp;utm_medium=custom_code_editor&amp;amp;utm_campaign=blog-post" rel="noopener noreferrer"&gt;Online Code Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This makes creating slightly modified instances very easy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Use Cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configuration Structs&lt;/strong&gt;: Providing sensible defaults for application settings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Builder Pattern&lt;/strong&gt;: Often, the  &lt;code&gt;Default&lt;/code&gt;  implementation provides the starting point for a builder.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Initializing Collections&lt;/strong&gt;: Getting an empty  &lt;code&gt;Vec&lt;/code&gt;,  &lt;code&gt;HashMap&lt;/code&gt;, or  &lt;code&gt;String&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generic Code&lt;/strong&gt;: In generic functions,  &lt;code&gt;T: Default&lt;/code&gt;  allows creating a default instance of  &lt;code&gt;T&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Testing&lt;/strong&gt;: Quickly creating instances with default data for tests.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Considerations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Derive Limitations&lt;/strong&gt;:  &lt;code&gt;#[derive(Default)]&lt;/code&gt;  only works if all fields implement  &lt;code&gt;Default&lt;/code&gt;. If even one field doesn't, we must implement it manually.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Meaningful Defaults&lt;/strong&gt;: Ensure the default values make sense for the type's purpose. Sometimes the derived defaults (like 0 or empty strings) aren't appropriate.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Initialization Cost&lt;/strong&gt;: While usually cheap, the  &lt;code&gt;default()&lt;/code&gt;  function  &lt;em&gt;can&lt;/em&gt;  perform non-trivial work (like allocating memory for a  &lt;code&gt;String&lt;/code&gt;  or  &lt;code&gt;Vec&lt;/code&gt;, or even more complex setup). Be aware if performance in initialization is critical.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The  &lt;code&gt;std::default::Default&lt;/code&gt;  trait provides a clean and standard way to create default instances of Rust types. Whether through the convenient  &lt;code&gt;#[derive(Default)]&lt;/code&gt;  attribute or a manual implementation for more control, it helps reduce boilerplate code and makes initializing structs and enums more ergonomic.&lt;/p&gt;

&lt;p&gt;With  &lt;code&gt;Default::default()&lt;/code&gt;  and struct update syntax, we can create instances with little fuss, focusing only on the values that differ from the standard defaults. If you want to learn more about rust you can always check out our  &lt;a href="https://masteringbackend.com/courses/become-a-rust-backend-engineer" rel="noopener noreferrer"&gt;in-depth course on the language&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have a great one!!!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author: &lt;a href="https://blog.masteringbackend.com/authors/chizaram" rel="noopener noreferrer"&gt;Ugochukwu Chizaram&lt;/a&gt;
&lt;/h3&gt;




&lt;h3&gt;
  
  
  Thank you for being a part of the community
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  Whenever you’re ready
&lt;/h3&gt;

&lt;p&gt;There are 4 ways we can help you become a great backend engineer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Platform:&lt;/strong&gt;&lt;/a&gt; Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://masteringbackend.com/academy?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;The MB Academy:&lt;/strong&gt;&lt;/a&gt; The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://backendweeky.dev/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Join Backend Weekly:&lt;/strong&gt;&lt;/a&gt; If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://getbackendjobs.com/?ref=medium" rel="noopener noreferrer"&gt;&lt;strong&gt;Get Backend Jobs:&lt;/strong&gt;&lt;/a&gt; Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>rust</category>
      <category>backenddevelopment</category>
      <category>trait</category>
      <category>default</category>
    </item>
  </channel>
</rss>
