<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Codebase Chronicles]]></title><description><![CDATA[Unpacking the stories behind building robust systems, with insights into the architecture and design choices that drive scalable, high-performance tech.]]></description><link>https://www.venukannuri.com</link><image><url>https://www.venukannuri.com/img/substack.png</url><title>Codebase Chronicles</title><link>https://www.venukannuri.com</link></image><generator>Substack</generator><lastBuildDate>Mon, 06 Apr 2026 05:28:10 GMT</lastBuildDate><atom:link href="https://www.venukannuri.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Venu Kannuri]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[kannuri@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[kannuri@substack.com]]></itunes:email><itunes:name><![CDATA[Venu Kannuri]]></itunes:name></itunes:owner><itunes:author><![CDATA[Venu Kannuri]]></itunes:author><googleplay:owner><![CDATA[kannuri@substack.com]]></googleplay:owner><googleplay:email><![CDATA[kannuri@substack.com]]></googleplay:email><googleplay:author><![CDATA[Venu Kannuri]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[EP02: Understanding Deadlock in database]]></title><description><![CDATA[Navigating the Coffman Conditions and Effective Prevention Strategies]]></description><link>https://www.venukannuri.com/p/ep02-understanding-deadlock-in-database</link><guid isPermaLink="false">https://www.venukannuri.com/p/ep02-understanding-deadlock-in-database</guid><dc:creator><![CDATA[Venu Kannuri]]></dc:creator><pubDate>Sun, 21 Jul 2024 16:33:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ENUM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>It's like a computer traffic jam!</strong> A deadlock happens when programs (like cars) need something (like a resource) that another program is already using. They both wait for each other to finish, but neither can because they're both stuck. It's a circular wait, where everyone needs something someone else has</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ENUM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ENUM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp 424w, https://substackcdn.com/image/fetch/$s_!ENUM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp 848w, https://substackcdn.com/image/fetch/$s_!ENUM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp 1272w, https://substackcdn.com/image/fetch/$s_!ENUM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ENUM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp" width="660" height="371" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:371,&quot;width&quot;:660,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40662,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ENUM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp 424w, https://substackcdn.com/image/fetch/$s_!ENUM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp 848w, https://substackcdn.com/image/fetch/$s_!ENUM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp 1272w, https://substackcdn.com/image/fetch/$s_!ENUM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe92569ed-68b6-42eb-9174-7c5ee9acb4e9_660x371.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p><strong>Coffman Conditions</strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.venukannuri.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Code Captain Letters! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>The Coffman Conditions are four necessary conditions that, if all met, guarantee a deadlock situation in a computer system. They were first described in a 1971 paper by Edward G. Coffman Jr. These conditions are crucial for understanding and preventing deadlocks in operating systems.</p><p><strong>Here's a breakdown of each Coffman Condition:</strong></p><ol><li><p><strong>Mutual Exclusion:</strong> This means a resource can only be used by one process at a time. Imagine a printer &#8211; only one document can be printed at a moment.</p></li><li><p><strong>Hold and Wait:</strong> A process can hold onto some resources while requesting additional resources from other processes that are already holding them. Think of a program editing a file (holding that resource) while also needing access to a database (held by another program).</p></li><li><p><strong>No Preemption:</strong> Once a process acquires a resource, it cannot be forcibly taken away by the system and given to another process. The program editing the file can't be forced to give up the file until it's done.</p></li><li><p><strong>Circular Wait:</strong> There exists a circular chain of waiting processes. Process A waits for a resource held by process B, process B waits for a resource held by process C, and so on, all the way back to process A waiting for something held by itself. Imagine a situation where program A needs a printer held by program B, program B needs a scanner held by program C, and program C needs the file being edited by program A &#8211; a loop with no way out.</p></li></ol><p>If all four Coffman Conditions are met, a deadlock is guaranteed to occur. By understanding these conditions, system designers can implement strategies to prevent them from happening altogether, ensuring smooth operation and resource allocation within the system.</p><p>Handling deadlocks typically involves prevention, avoidance, detection, and recovery strategies implemented in operating systems and software systems to ensure that deadlocks are minimized or avoided altogether, or that systems can recover gracefully if a deadlock does occur.</p><div><hr></div><p><strong>Deadlock Prevention</strong></p><ol><li><p>Use alternative approaches that do not require mutual exclusion. For example, implement a software solution where data can be shared using message passing instead of using a shared resource.</p></li><li><p>Define a global order in which resources must be requested. This can prevent circular waits by ensuring that processes always request resources in the same predetermined order.</p></li><li><p>Roll back the process and release its resources if it cannot proceed due to deadlock conditions. This can be implemented in certain real-time systems or databases where transactions can be rolled back.</p></li></ol><p>Implement a policy where a process must request all its resources simultaneously, thereby preventing the possibility of holding one resource and waiting for another.</p><div><hr></div><p><strong>Summary</strong></p><p>Implementing deadlock prevention strategies requires careful design and consideration of system requirements and performance implications. These techniques aim to ensure that the system remains responsive and efficient while minimizing the risk of deadlocks occurring. Often, a combination of prevention techniques is used to provide robust protection against deadlocks in complex systems.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.venukannuri.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Code Captain Letters! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[EP01: Supercharge Your APIs]]></title><description><![CDATA[Proven Techniques for Blazing-Fast Performance]]></description><link>https://www.venukannuri.com/p/ep01-supercharge-your-apis</link><guid isPermaLink="false">https://www.venukannuri.com/p/ep01-supercharge-your-apis</guid><dc:creator><![CDATA[Venu Kannuri]]></dc:creator><pubDate>Mon, 01 Jul 2024 23:19:20 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b3230332-bb4f-49c7-8b7a-731171a71de6_1400x1400.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fqgc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fqgc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp 424w, https://substackcdn.com/image/fetch/$s_!fqgc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp 848w, https://substackcdn.com/image/fetch/$s_!fqgc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp 1272w, https://substackcdn.com/image/fetch/$s_!fqgc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fqgc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp" width="1400" height="1400" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1400,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:43206,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fqgc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp 424w, https://substackcdn.com/image/fetch/$s_!fqgc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp 848w, https://substackcdn.com/image/fetch/$s_!fqgc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp 1272w, https://substackcdn.com/image/fetch/$s_!fqgc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7929a46-6892-4ab4-b13f-e4271aeafce9_1400x1400.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In today's digital world, apps need to be quick to keep users happy. APIs, which are the backbone of app interactions, play a big part in this. Slow APIs can make users frustrated, hurting your app&#8217;s success.</p><p>Here&#8217;s why API speed is important: slow APIs lead to delays and unhappy users, which can reduce your app&#8217;s popularity and revenue. But don't worry! By using some proven tips, you can make your APIs much faster.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.venukannuri.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Code Captain Letters! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Why Slow APIs Are a Problem</p><p>Imagine a user waiting for an app to load. If the API is slow, they see a loading screen instead of the content they want. This can cause:</p><ul><li><p><strong>User Abandonment:</strong> Users might leave the app if it&#8217;s too slow, reducing engagement and conversions.</p></li><li><p><strong>Reduced Functionality:</strong> Slow data transfer can limit what your app can do, making it less useful.</p></li></ul><p>How to Speed Up Your API</p><p>Fix slow APIs with these tips:</p><ol><li><p><strong>Caching:</strong></p><ul><li><p>Think of caching as a shortcut. It stores frequently accessed data temporarily, reducing the need to repeatedly access the database and speeding up response times.</p></li></ul></li><li><p><strong>Database Optimization:</strong></p><ul><li><p>Like a tidy room is easier to navigate, an optimized database is faster. Regular maintenance and proper indexing can speed up data retrieval.</p></li></ul></li><li><p><strong>Keep Payloads Small:</strong></p><ul><li><p>The amount of data sent between the client and server affects speed. Send only the necessary data to reduce payload size and improve performance.</p></li></ul></li></ol><p>Advanced Tips for Extra Speed</p><p>For even better performance, try these advanced techniques:</p><ol><li><p><strong>Connection Pooling:</strong></p><ul><li><p>Creating database connections can be slow. Connection pooling keeps a set of ready connections, improving efficiency.</p><p></p><p><em>Using HikariCP for connection pooling.</em></p><pre><code># application.properties
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.pool-name=SpringBootHikariCP
spring.datasource.hikari.max-lifetime=2000000
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.leak-detection-threshold=2000</code></pre></li></ul></li><li><p><strong>Asynchronous Processing:</strong></p><ul><li><p>Handle certain tasks asynchronously so they don&#8217;t block the main process. This keeps your API responsive while processing tasks in the background.</p><pre><code>import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;

@EnableAsync
@Service
public class AsyncService {

    @Async
    public void performAsyncTask() throws InterruptedException {
        // Simulate a long-running task
        Thread.sleep(5000);
        System.out.println("Async task completed");
    }
}

@RestController
public class AsyncController {

    @Autowired
    private AsyncService asyncService;

    @GetMapping("/async-task")
    public String triggerAsyncTask() throws InterruptedException {
        asyncService.performAsyncTask();
        return "Async task triggered";
    }
}</code></pre></li></ul></li><li><p><strong>Content Delivery Networks (CDNs):</strong></p><ul><li><p>CDNs are networks of servers in different locations that cache your API responses. This reduces delay for users everywhere, ensuring fast access.</p><p></p><p><em>Serving static content through a CDN requires configuration outside of the code, but here is how you can serve static resources in Spring Boot.</em></p><pre><code># application.properties
spring.resources.static-locations=classpath:/static/</code></pre></li></ul></li></ol><p>Keep Monitoring and Improving</p><p>Using Spring Boot Actuator and Prometheus</p><p>Improving performance is a continuous task. Monitor key performance indicators (KPIs) like response times, error rates, and throughput. Use performance testing tools to simulate real-world use and find bottlenecks.</p><p><em>Using Spring Boot Actuator and Prometheus</em></p><pre><code>&lt;!-- pom.xml --&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
    &lt;groupId&gt;io.micrometer&lt;/groupId&gt;
    &lt;artifactId&gt;micrometer-registry-prometheus&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre><ul><li><p><strong>Spring Boot Starter Actuator</strong>: This dependency adds the Spring Boot Actuator to your project. Spring Boot Actuator provides production-ready features to help you monitor and manage your application. It includes a wide range of endpoints allowing you to view and manage the application's internal state, such as health, metrics, info, dump, env, etc.</p></li><li><p><strong>Micrometer Registry Prometheus</strong>: This dependency integrates Micrometer with Prometheus. Micrometer acts as a facade over application metrics from a variety of monitoring systems, allowing for instrumentation of your application code without being tied to a specific monitoring system. By adding this dependency, you enable your application to export metrics data in a format that Prometheus can scrape and store. Prometheus is an open-source monitoring system with a dimensional data model, flexible query language, efficient time series database, and modern alerting approach.</p></li></ul><p>The Winning Strategy</p><p>By using these optimization techniques and regularly monitoring performance, you can turn your API into a fast and efficient system. A quick and responsive API enhances user experience and boosts your app&#8217;s success. Follow these steps to improve your API's performance and see your user engagement rise!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.venukannuri.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Code Captain Letters! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>