<?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: Jonathan Ato Markin</title>
    <description>The latest articles on DEV Community by Jonathan Ato Markin (@jonamarkin).</description>
    <link>https://dev.to/jonamarkin</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%2F565336%2F023d510e-4aea-4761-8cbd-47eee0ac46e8.jpg</url>
      <title>DEV Community: Jonathan Ato Markin</title>
      <link>https://dev.to/jonamarkin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jonamarkin"/>
    <language>en</language>
    <item>
      <title>FastMap: Real-Time IoT Anomaly Detection with Redis's Multi-Model Database</title>
      <dc:creator>Jonathan Ato Markin</dc:creator>
      <pubDate>Sun, 10 Aug 2025 12:07:32 +0000</pubDate>
      <link>https://dev.to/jonamarkin/fastmap-real-time-iot-anomaly-detection-with-rediss-multi-model-database-3bg5</link>
      <guid>https://dev.to/jonamarkin/fastmap-real-time-iot-anomaly-detection-with-rediss-multi-model-database-3bg5</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/redis-2025-07-23"&gt;Redis AI Challenge&lt;/a&gt;: Beyond the Cache&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;In today's connected world, monitoring critical infrastructure like water systems, power grids, or server farms is a monumental task. A single failure can be catastrophic. The challenge is detecting problems the instant they occur, not minutes later when a traditional database finally runs its report.&lt;/p&gt;

&lt;p&gt;I built FastMap, a real-time anomaly detection platform for large-scale sensor networks. It provides a live map-based dashboard where operators can monitor thousands of IoT sensors at a glance. When a sensor reports an anomalous value, like a sudden pressure spike or temperature drop, FastMap identifies it in milliseconds and instantly flags the sensor on the map, allowing for immediate intervention.&lt;/p&gt;

&lt;p&gt;The entire application is powered exclusively by Redis, which acts as the high-speed data ingestion layer, the real-time AI/ML feature store, the multi-model primary database, and the real-time notification engine all in one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Here is a live demonstration of FastMap in action. You can see the real-time updates as sensors report data and anomalies are triggered.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Video Demo: &lt;a href="https://www.loom.com/share/087e41cdbfd846a1b01f39a720e2cd2e?sid=1995cd09-8aab-4433-a43d-a20b13f71422" rel="noopener noreferrer"&gt;FastMap Demo Video&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source Code: &lt;a href="https://github.com/jonamarkin/fastmap-redis-challenge" rel="noopener noreferrer"&gt;FastMap Redis Github&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below is also a screenshot of the user interface&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%2Fnmugqjlpxv9uga8mk31v.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%2Fnmugqjlpxv9uga8mk31v.png" alt="FastMap Dashboard" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Used Redis 8
&lt;/h2&gt;

&lt;p&gt;For FastMap, Redis wasn't just a cache; it was the single source of truth and the engine for the entire application. I combined multiple Redis data models to build a robust system without needing a separate relational or NoSQL database.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Primary Database:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Redis Streams: The front door for all incoming data, providing a durable, scalable log for our high-throughput sensor network.&lt;/li&gt;
&lt;li&gt;RedisJSON: Used to store rich, structured metadata for each sensor, including its location, type, and operational parameters. Querying this data was flexible and intuitive.&lt;/li&gt;
&lt;li&gt;Redis TimeSeries: To store historical readings for every sensor, allowing for efficient time-range queries, aggregations, and future trend analysis—all natively within Redis.&lt;/li&gt;
&lt;li&gt;Redis Hashes: For storing the volatile, high-access "current state" of each sensor (e.g., status: 'ANOMALY'), enabling lightning-fast lookups for the dashboard.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Real-Time Messaging&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Redis Pub/Sub: When an anomaly was detected, a message was published to a Pub/Sub channel. This decoupled the backend logic from the frontend dashboard, allowing us to broadcast alerts to all connected users instantly with minimal overhead.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;This multi-model approach, all within a single Redis instance, demonstrates its incredible power and versatility as a complete, real-time data platform.&lt;/p&gt;

</description>
      <category>redischallenge</category>
      <category>devchallenge</category>
      <category>database</category>
      <category>ai</category>
    </item>
    <item>
      <title>Local Development, Remote Data: Accessing Fly.io PostgreSQL from Your Java API</title>
      <dc:creator>Jonathan Ato Markin</dc:creator>
      <pubDate>Sun, 26 Jan 2025 20:12:32 +0000</pubDate>
      <link>https://dev.to/jonamarkin/local-development-remote-data-accessing-flyio-postgresql-from-your-java-api-2jb5</link>
      <guid>https://dev.to/jonamarkin/local-development-remote-data-accessing-flyio-postgresql-from-your-java-api-2jb5</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Inter-communication between databases when developing applications is not an entirely new challenge to developers or the software engineering space. I recently found myself in a situation where I had to access data from an external PostgreSQL database while developing a Java API locally. The external database was hosted on &lt;a href="https://fly.io/" rel="noopener noreferrer"&gt;Fly.io&lt;/a&gt; and my local development setup had to interact with it seamlessly. After some research and consultation, I discovered that I could harness the power of &lt;a href="https://www.postgresql.org/docs/current/postgres-fdw.html" rel="noopener noreferrer"&gt;PostgreSQL Foreign Data Wrapper (FDW)&lt;/a&gt; and &lt;a href="https://fly.io/docs/flyctl/proxy/" rel="noopener noreferrer"&gt;Fly Proxy&lt;/a&gt; to make it work. In this article, I’ll walk you through my journey, the steps I took, and how you can apply this solution to your projects.&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%2Ffr0dince0q3gzyebqalx.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%2Ffr0dince0q3gzyebqalx.png" alt="Server down" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenge
&lt;/h2&gt;

&lt;p&gt;I was working on a Java API(with SpringBoot) that needed to fetch data from a table that was being managed by another application's Postgres database. The external application and its database were all hosted on Fly.io. While developing locally, I could not directly connect to the Fly Postgres database due to &lt;a href="https://fly.io/docs/networking/private-networking/" rel="noopener noreferrer"&gt;network restrictions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I had two main issues to contend with&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Establishing a connection or communication channel with Fly.io from my local setup&lt;/li&gt;
&lt;li&gt;Accessing the data from the external database on Fly.io&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Finding solutions for the above issues led me to discover &lt;a href="https://fly.io/docs/reference/fly-proxy/" rel="noopener noreferrer"&gt;Fly Proxy&lt;/a&gt; and &lt;a href="https://www.postgresql.org/docs/current/postgres-fdw.html" rel="noopener noreferrer"&gt;PostgreSQL Foreign Data Wrapper&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%2Fuiovq3m4t1t920a28wxf.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%2Fuiovq3m4t1t920a28wxf.png" alt="Postgres Elephant Logo" width="540" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is PostgreSQL Foreign Data Wrapper?
&lt;/h2&gt;

&lt;p&gt;PostgreSQL Foreign Data Wrapper (FDW) is a powerful module that allows you to query external data sources as if they were local. It acts as a bridge between the local database and the external one.&lt;/p&gt;

&lt;p&gt;I used the &lt;code&gt;postgres_fdw&lt;/code&gt; extension to connect to the external Fly.io PostgreSQL database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up The Proxy
&lt;/h2&gt;

&lt;p&gt;You should install &lt;a href="https://fly.io/docs/flyctl/" rel="noopener noreferrer"&gt;&lt;code&gt;flyctl&lt;/code&gt;&lt;/a&gt; before proceeding to carry out these procedures.&lt;br&gt;
Since Fly.io restricts direct access to its databases, I needed a way to securely connect to it from my local machine. I used Fly.io’s &lt;code&gt;flyctl&lt;/code&gt; proxy to create a secure tunnel. The general command is given by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fly proxy &amp;lt;&lt;span class="nb"&gt;local&lt;/span&gt;:remote&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt;remote_host] &lt;span class="o"&gt;[&lt;/span&gt;flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In setting up my proxy I needed to know the name of the remote_host which was the Fly Postgres database application I wanted to interact with. I then set up the proxy with a similar command as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fly proxy 5433:5432 &lt;span class="nt"&gt;-a&lt;/span&gt; db_app_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This created a local tunnel to the Fly.io database. With my proxy set up, I proceeded to my FDW to interact with the external database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up PostgreSQL FDW
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Install the postgres_fdw Extension
&lt;/h3&gt;

&lt;p&gt;First, I installed the postgres_fdw extension in my local PostgreSQL database:&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="n"&gt;EXTENSION&lt;/span&gt; &lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;postgres_fdw&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Create a Foreign Server Object
&lt;/h3&gt;

&lt;p&gt;Next, I defined the connection to the external database by creating a foreign server object to represent the remote database I wanted to connect to.&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="n"&gt;SERVER&lt;/span&gt; &lt;span class="n"&gt;fly_server&lt;/span&gt; &lt;span class="k"&gt;FOREIGN&lt;/span&gt; &lt;span class="k"&gt;DATA&lt;/span&gt; &lt;span class="n"&gt;WRAPPER&lt;/span&gt; &lt;span class="n"&gt;postgres_fdw&lt;/span&gt;
&lt;span class="k"&gt;OPTIONS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;host&lt;/span&gt; &lt;span class="s1"&gt;'127.0.0.1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="s1"&gt;'5433'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;dbname&lt;/span&gt; &lt;span class="s1"&gt;'db_name'&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;fly_server&lt;/code&gt; can be replaced with any preferred name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Map a Local User to the Remote User
&lt;/h3&gt;

&lt;p&gt;I created a user mapping for each database user I wanted to allow to access each foreign server. In my case, I did for only one user.&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;USER&lt;/span&gt; &lt;span class="n"&gt;MAPPING&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="n"&gt;local_user&lt;/span&gt; &lt;span class="n"&gt;SERVER&lt;/span&gt; &lt;span class="n"&gt;fly_server&lt;/span&gt;
&lt;span class="k"&gt;OPTIONS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;user&lt;/span&gt; &lt;span class="s1"&gt;'remote_user'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="s1"&gt;'remote_password'&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Link the External Table
&lt;/h3&gt;

&lt;p&gt;Next, I had to create a foreign table for each remote table I wanted to access.&lt;br&gt;
I used the &lt;a href="https://www.postgresql.org/docs/current/sql-importforeignschema.html" rel="noopener noreferrer"&gt;IMPORT FOREIGN SCHEMA&lt;/a&gt; approach and limited it to the table I was interested in.&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="n"&gt;IMPORT&lt;/span&gt; &lt;span class="k"&gt;FOREIGN&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="n"&gt;foreign_schema_name&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;remote_table&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;SERVER&lt;/span&gt; &lt;span class="n"&gt;fly_server&lt;/span&gt;
&lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;local_schema_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my case as well, there was an ENUM TYPE in the foreign database that the table depended on so I had to create that TYPE as well in my local database.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Create Materialized View (Optional)
&lt;/h3&gt;

&lt;p&gt;This is an optional step that I found to be useful, especially in situations where data is seldom updated and the only operations being performed are &lt;code&gt;READ&lt;/code&gt; operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating with Your Java API
&lt;/h2&gt;

&lt;p&gt;With the FDW and proxy in place, I could now query the external data directly from my SpringBoot application using either my materialized view or the imported foreign table directly by establishing a connection with my local database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;FDW is powerful but requires careful setup to get things working&lt;/li&gt;
&lt;li&gt;flyctl proxies make it easy to create secure tunnels to interact with remote databases&lt;/li&gt;
&lt;li&gt;This approach also enabled me to treat my app as a separate service with its own db decoupled from the remote application even though it depended on some data from it.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Using PostgreSQL Foreign Data Wrappers and a flyctl proxy, I was able to seamlessly integrate external data into my Java web application. This approach not only solved my immediate problem but also opened up new possibilities for working with distributed data. &lt;br&gt;
If you’re facing a similar challenge, I highly recommend giving FDW a try!&lt;/p&gt;

&lt;p&gt;Feel free to connect with me on &lt;a href="https://www.linkedin.com/in/atomarkin/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Happy Coding!🚀"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>postgres</category>
      <category>database</category>
      <category>java</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Spring Boot Basics: Crafting Your First Application</title>
      <dc:creator>Jonathan Ato Markin</dc:creator>
      <pubDate>Sat, 24 Jun 2023 18:57:46 +0000</pubDate>
      <link>https://dev.to/jonamarkin/spring-boot-basics-crafting-your-first-application-4kf3</link>
      <guid>https://dev.to/jonamarkin/spring-boot-basics-crafting-your-first-application-4kf3</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%2F6x4evw3hatzwzqzanv53.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%2F6x4evw3hatzwzqzanv53.png" alt="Spring Boot Logo" width="600" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Web application development stands at the core of building impactful solutions in almost every field and organization.&lt;br&gt;
Among the many languages, &lt;a href="https://dev.java/learn/" rel="noopener noreferrer"&gt;Java&lt;/a&gt; continues to stand tall and showcase its usefulness and longevity, having been ranked 3rd on the &lt;a href="https://octoverse.github.com/2022/top-programming-languages" rel="noopener noreferrer"&gt;Top Programming Languages at the 2022 Github Octoverse&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://spring.io/projects/spring-boot" rel="noopener noreferrer"&gt;Spring Boot&lt;/a&gt;, currently the most popular framework in the Java ecosystem, offers a simplified and versatile approach to building web applications. This article aims to provide a simplified roadmap for writing your first Spring Boot Java application.&lt;/p&gt;
&lt;h3&gt;
  
  
  📝 Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before starting with this tutorial, there are a few prerequisites you should take care of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java Development Kit (JDK):&lt;/strong&gt; Spring Boot 2.4.0 and later requires at least Java 8. You can download the latest version of the JDK from Oracle's &lt;a href="https://www.oracle.com/java/technologies/javase-jdk11-downloads.html" rel="noopener noreferrer"&gt;official website&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integrated Development Environment (IDE):&lt;/strong&gt; A good IDE makes the development of Spring Boot applications simpler and easier. I recommend downloading and using &lt;a href="https://www.jetbrains.com/idea/download/" rel="noopener noreferrer"&gt;IntelliJ IDEA&lt;/a&gt; but you are free to use any IDE of your choice like &lt;a href="https://netbeans.apache.org/" rel="noopener noreferrer"&gt;Apache NetBeans&lt;/a&gt;, &lt;a href="https://www.eclipse.org/downloads/packages/" rel="noopener noreferrer"&gt;Eclipse&lt;/a&gt;or &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;VSCode&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Basic Java knowledge:&lt;/strong&gt; This tutorial assumes that you have a basic understanding of Java programming. You don't need to be an expert, but you should understand Java syntax and simple concepts like classes, objects, and methods. If you are new to Java,  feel free to check out this &lt;a href="https://learn.microsoft.com/en-us/shows/java-for-beginners/" rel="noopener noreferrer"&gt;Java For Beginners Series&lt;/a&gt; by Microsoft, the &lt;a href="https://dev.java/learn/" rel="noopener noreferrer"&gt;official Java learn website&lt;/a&gt; or any trusted source.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Familiarity with Maven or Gradle:&lt;/strong&gt; Spring Boot uses these tools to manage dependencies. While it's not essential to have in-depth knowledge, a basic understanding of how these tools work will be useful. In this tutorial, we will use &lt;a href="https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html" rel="noopener noreferrer"&gt;Maven&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  🛠️ Create A New Spring Boot Application
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Spring Initializr&lt;/strong&gt; is a tool provided to help create Spring Boot applications easily.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visit &lt;a href="https://start.spring.io/" rel="noopener noreferrer"&gt;https://start.spring.io/&lt;/a&gt;. You should see something similar to the image below.
&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%2Fvrggo4nv8zxllim8ee6s.png" alt="Spring Intializr Image" width="800" height="377"&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Java&lt;/strong&gt; and &lt;strong&gt;Maven&lt;/strong&gt; under the Project and Language sections respectively.&lt;/li&gt;
&lt;li&gt;Select the Spring Boot version of your choice or leave it at the recommended version.&lt;/li&gt;
&lt;li&gt;Name your project as you desire under the Project Metadata and choose a Java version as well.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Dependencies&lt;/strong&gt; section, add &lt;code&gt;Spring Web&lt;/code&gt; to create a web application.&lt;/li&gt;
&lt;li&gt;Finally, click on the &lt;strong&gt;Generate&lt;/strong&gt; button. This will download a .zip file containing your new Spring Boot project.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  🧐 Exploring The Project Structure
&lt;/h3&gt;

&lt;p&gt;Unzip the downloaded file and open the project in IntelliJ IDEA or your favourite IDE. Your project structure should look like this.&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%2F3knfxo2on7jwfab5gl4t.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%2F3knfxo2on7jwfab5gl4t.png" alt="Project Structure" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  📂 Understanding The Project Structure
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;src&lt;/code&gt;: This directory contains all the source code for the project.

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;main&lt;/code&gt;: This folder houses the primary source code for the application.

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;java&lt;/code&gt;: This is where all our Java source files reside.

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;com/example/demo&lt;/code&gt;: This is the package. .

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;DemoApplication.java&lt;/code&gt;: This is the main entry point for the Spring Boot application. Spring Boot applications bootstrap from a main method, which is contained in this class.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;resources&lt;/code&gt;: This folder contains all non-code resources, like JSON, XML, properties files, and static web resources. It's also where we keep:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;application.properties&lt;/code&gt;: This file is where you can specify application configurations, like server port, database connection info, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;test&lt;/code&gt;: This folder contains all of our test source code.

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;java&lt;/code&gt;: Here is where all our Java test files reside.

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;com/example/demo&lt;/code&gt;: This follows the same package structure as the main codebase.

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;DemoApplicationTests.java&lt;/code&gt;: This is where we write tests for our application.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.gitignore&lt;/code&gt;: This file tells Git which files or directories to skip for version control.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pom.xml&lt;/code&gt;: If you're using Maven as your build tool, this is where your project's dependencies and plugins are managed. In our case,  we are using Maven so our dependences will reside here.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;README.md&lt;/code&gt;: This file contains documentation of the project – what it does, how to set it up, and other useful information.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  ✍️ Writing Your First Controller
&lt;/h3&gt;

&lt;p&gt;Controllers in Spring Boot handle incoming web requests and return responses. Let's create a simple controller. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new file called &lt;code&gt;FirstController.java&lt;/code&gt; in the same package as &lt;code&gt;DemoApplication.java&lt;/code&gt;. You can name the controller anything you want.
Paste this code in your controller:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.demo&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.springframework.web.bind.annotation.GetMapping&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.springframework.web.bind.annotation.RestController&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@RestController&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FirstController&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@GetMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/first"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"My First Spring Boot App!"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

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

&lt;/div&gt;

&lt;h3&gt;
  
  
  📖 Code Explanation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;@RestController&lt;/code&gt;: This is an annotation that is itself annotated with &lt;code&gt;@Controller&lt;/code&gt; and &lt;code&gt;@ResponseBody&lt;/code&gt;. &lt;code&gt;@Controller&lt;/code&gt; is an annotation that marks the class as a web controller, capable of handling incoming &lt;code&gt;HTTP&lt;/code&gt; requests. &lt;code&gt;@ResponseBody&lt;/code&gt; indicates that the return values from the methods in this class will be bound to the HTTP response body.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@GetMapping("/first")&lt;/code&gt;: This annotation is used to map &lt;code&gt;HTTP GET&lt;/code&gt; requests onto specific handler methods. Here, it's mapping an &lt;code&gt;HTTP GET&lt;/code&gt; request to the &lt;code&gt;/first&lt;/code&gt; path to the &lt;strong&gt;first()&lt;/strong&gt; method. When someone navigates to &lt;code&gt;/first&lt;/code&gt; on your web service, the &lt;strong&gt;first(){...}&lt;/strong&gt; method will be invoked.&lt;/li&gt;
&lt;li&gt;You can read more about Spring Annotations via the Spring official &lt;a href="https://docs.spring.io/spring-boot/docs/current/reference/html/" rel="noopener noreferrer"&gt;reference documentation&lt;/a&gt; or access a cheat sheet &lt;a href="https://www.jrebel.com/blog/spring-annotations-cheat-sheet" rel="noopener noreferrer"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  🏃 Running Your Application
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You can run your application easily from your IDE by clicking the &lt;code&gt;RUN&lt;/code&gt; button of your IDE, normally shaped as a &lt;em&gt;Play button&lt;/em&gt;.&lt;br&gt;
You can also run the application from the terminal using the following command from the project root directory: &lt;code&gt;./mvnw spring-boot:run&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open your favorite browser and navigate to &lt;a href="http://localhost:8080/first" rel="noopener noreferrer"&gt;http://localhost:8080/first&lt;/a&gt;. You should see the message "My First Spring Boot App!".&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fq3ftra71hrx6ucdcc9l0.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%2Fq3ftra71hrx6ucdcc9l0.png" alt="App Page" width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; By default, Spring Boot applications run on port 8080. If you already have another application running on this port, you will encounter a port conflict, meaning your Spring Boot application won't start correctly. To resolve this, you can configure your Spring Boot application to use a different port. You can do this in the &lt;code&gt;application.properties&lt;/code&gt; file like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="py"&gt;server.port&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;9090&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this configuration, your application will run on port 9090 instead of the default port 8080.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎉 Congratulations! 🎉
&lt;/h2&gt;

&lt;p&gt;You've just developed your first Spring Boot Java application! This is merely the initial step in your journey with Spring Boot. The Spring Boot framework offers many other features 🚀 that you can delve into as you progress in your career as a developer.&lt;/p&gt;

&lt;p&gt;Remember to practice consistently and always challenge yourself!&lt;br&gt;
Happy coding! 🎊👩‍💻🎊&lt;/p&gt;

&lt;h2&gt;
  
  
  📚 References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://spring.io/projects/spring-boot" rel="noopener noreferrer"&gt;Official Spring Boot Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.baeldung.com/spring-boot" rel="noopener noreferrer"&gt;Spring Boot Tutorials | Baeldung&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://spring.io/guides/gs/spring-boot/" rel="noopener noreferrer"&gt;Building an Application with Spring Boot&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
