<?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[AI Software Engineer  ]]></title><description><![CDATA[A weekly newsletter about AI in software development. ]]></description><link>https://asenewsletter.com</link><image><url>https://substackcdn.com/image/fetch/$s_!03ZT!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F472f3334-7b85-44b1-a9e4-3788c31cd200_238x238.png</url><title>AI Software Engineer  </title><link>https://asenewsletter.com</link></image><generator>Substack</generator><lastBuildDate>Sat, 29 Aug 2026 12:20:08 GMT</lastBuildDate><atom:link href="https://asenewsletter.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Joe Njenga]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[aisoftwareengineer@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[aisoftwareengineer@substack.com]]></itunes:email><itunes:name><![CDATA[Joe]]></itunes:name></itunes:owner><itunes:author><![CDATA[Joe]]></itunes:author><googleplay:owner><![CDATA[aisoftwareengineer@substack.com]]></googleplay:owner><googleplay:email><![CDATA[aisoftwareengineer@substack.com]]></googleplay:email><googleplay:author><![CDATA[Joe]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[How OpenAI Scales Single PostgreSQL Instance to Millions of Queries per Second]]></title><description><![CDATA[Scaling Lessons from 800 Million ChatGPT Users and What You Can Apply to Your AI Apps]]></description><link>https://asenewsletter.com/p/how-openai-scales-single-postgresql</link><guid isPermaLink="false">https://asenewsletter.com/p/how-openai-scales-single-postgresql</guid><dc:creator><![CDATA[Joe]]></dc:creator><pubDate>Thu, 29 Jan 2026 19:59:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!jEWM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png" 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_!jEWM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jEWM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!jEWM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!jEWM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!jEWM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jEWM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png" width="1200" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:94217,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://aisoftwareengineer.substack.com/i/185539477?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jEWM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!jEWM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!jEWM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!jEWM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F042ec2f0-b17b-4bdc-be66-8895209cf908_1200x600.png 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 aria-hidden="true" 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><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>I always knew PostgreSQL was the database of choice if you&#8217;re serious about building any scalable AI app.</p><blockquote><p><strong>I know most of you want to build AI apps that can scale to millions of users, and if that&#8217;s the case, you need to learn how to use PostgreSQL efficiently or at least understand the architecture design mindset for such an app.</strong></p></blockquote><p>When I came across this article on <em><strong><a href="https://openai.com/index/scaling-postgresql/">OpenAI is scaling a single PostgreSQL</a></strong></em> instance to handle millions of queries per second for 800 million ChatGPT users, <em><strong>I knew this was a goldmine for our use cases.</strong></em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://asenewsletter.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 AI Software Engineer  ! 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>One of the most common questions I get asked is about technology choices when building large AI applications that won&#8217;t crash on the first heavy load.</p><p><em><strong>OpenAI&#8217;s database load grew by more than 10x over the past year, and they had to push PostgreSQL to its absolute limits to keep ChatGPT running smoothly.</strong></em></p><p> They&#8217;re now serving millions of queries per second with a single primary instance and nearly 50 read replicas spread across multiple regions.</p><p>There are a lot of things that go into designing such a system, and they won&#8217;t all fit in this article, but at least this will point you in the right direction and help you build the right mindset.</p><p>The best part about this guide is that the principles apply whether you&#8217;re building for 1,000 users or 800 million users. The scaling strategies, optimization techniques, and architectural decisions <em>OpenAI made can be adapted to your specific needs.</em></p><blockquote><p><em><strong>Let&#8217;s find out how you can replicate these patterns to fit your current needs or what you can learn to avoid the common pitfalls that bring down production databases.</strong></em></p></blockquote><div><hr></div><h2>Scaling Challenge</h2><p>After ChatGPT launched, traffic grew at an unprecedented rate.</p><p>OpenAI had to scale fast, and they did what most teams would do in that situation. They increased instance sizes, added more read replicas, and implemented optimizations at both the application and database layers.</p><p>This worked well for a long time, but cracks started to form. </p><p><strong> Single-Primary Architecture Problem</strong></p><blockquote><p><em><strong>OpenAI runs a single-primary PostgreSQL setup, which means one writer handles all write operations. This might sound limiting for a service with 800 million users, but it works because their workload is primarily read-heavy.</strong></em></p></blockquote><p>The problem isn&#8217;t the architecture itself but what happens when things go wrong.</p><p>They experienced several high-severity incidents that followed the same pattern.</p><p> An upstream issue causes a sudden spike in database load, such as widespread cache misses from a caching layer failure, a surge of expensive queries saturating the CPU, or a write storm from a new feature launch.</p><p><em>When this happens, resource utilization climbs, query latency rises, and requests begin timing out.</em></p><p><strong> Vicious Cycle Under Load</strong></p><p>When requests time out, applications retry.</p><p> Those retries further amplify the load, triggering a vicious cycle that can degrade the entire ChatGPT and API services.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6wHk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6wHk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png 424w, https://substackcdn.com/image/fetch/$s_!6wHk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png 848w, https://substackcdn.com/image/fetch/$s_!6wHk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png 1272w, https://substackcdn.com/image/fetch/$s_!6wHk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6wHk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png" width="680" height="781" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:781,&quot;width&quot;:680,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19338,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://aisoftwareengineer.substack.com/i/185539477?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6wHk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png 424w, https://substackcdn.com/image/fetch/$s_!6wHk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png 848w, https://substackcdn.com/image/fetch/$s_!6wHk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png 1272w, https://substackcdn.com/image/fetch/$s_!6wHk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37e3128f-65f9-42d8-90da-10beea47f2c9_680x781.png 1456w" sizes="100vw" loading="lazy"></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 aria-hidden="true" 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><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><blockquote><p><em><strong>Cache failures lead to PostgreSQL overload, which causes slow responses, which trigger retries, which further increase the load. This is the  scenario that brings down production databases.</strong></em></p></blockquote><p>PostgreSQL handles read-heavy workloads extremely well, but write-heavy workloads expose limitations in its multiversion <a href="https://www.postgresql.org/docs/7.1/mvcc.html">concurrency control (MVCC)</a> implementation.</p><p>When a query updates even a single field, PostgreSQL copies the entire row to create a new version. </p><p>Under heavy write loads, this results in significant write amplification and increased read amplification since queries must scan through multiple tuple versions to retrieve the latest one.</p><p>OpenAI&#8217;s solution was to migrate shardable write-heavy workloads to sharded systems like <a href="https://azure.microsoft.com/en-us/products/cosmos-db">Azure Cosmos DB</a> while keeping <em><strong>PostgreSQL unsharded with a single primary for their read-heavy workloads</strong></em>.</p><div class="pullquote"><p>The key insight here is understanding your workload characteristics before choosing your scaling strategy.</p></div><p></p><h2> How Does this Apply to Your AI App Design?  </h2><p>The patterns OpenAI encountered aren&#8217;t unique to ChatGPT&#8217;s scale.</p><blockquote><p><em><strong> These same issues show up in applications serving 1,000 users, 10,000 users, or 50,000 users. The vicious cycle doesn&#8217;t care about your user count but your architecture.</strong></em></p></blockquote><p>So, how do you design your application to avoid these problems? Let me show you with a real project that most of you are either working on or will work on soon.</p><p><strong>Your AI Chatbot Project</strong></p><p>You are building an AI-powered customer support chatbot and designing it from the ground up using OpenAI&#8217;s lessons.</p><p>You&#8217;ve built the initial version. It&#8217;s working great in development and has even handled your first 1,000 users without breaking a sweat.</p><p>Your PostgreSQL setup looks reasonable:</p><ul><li><p><em>One database instance handles everything</em></p></li><li><p><em>Direct connections from your application</em></p></li><li><p><em>Basic caching for user sessions</em></p></li><li><p><em>Standard queries to fetch conversation history</em></p></li></ul><p>The application works, and the  early adopters love it. </p><blockquote><p><em><strong>Now you land a big client with 50,000 support agents who will use your platform simultaneously during peak hours.</strong></em></p></blockquote><p>This is where the lessons from OpenAI&#8217;s guide are needed.</p><p>Your chatbot needs to do three main things constantly:</p><ol><li><p><em>Fetch conversation history when agents open a chat (read-heavy)</em></p></li><li><p><em>Store new messages as conversations happen (moderate writes)</em></p></li><li><p><em>Query user context and previous interactions (read-heavy)</em></p></li></ol><p>Within the first hour of launch, you start seeing timeouts.</p><p>Your monitoring dashboard shows:</p><ul><li><p><em>Database CPU at 95%</em></p></li><li><p><em>Connection count is hitting the 5,000 limit</em></p></li><li><p><em>Query response times jumping from 20ms to 2 seconds</em></p></li><li><p><em>Cache hit rate dropping from 80% to 30%</em></p></li></ul><div class="pullquote"><p>You have just started hitting the same Vicious Cycle</p></div><p>Your Redis cache layer goes down for 3 minutes during a deployment.</p><p>Suddenly, every conversation history request hits PostgreSQL directly. What was 100 queries per second becomes 5,000 queries per second.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3NIK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3NIK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png 424w, https://substackcdn.com/image/fetch/$s_!3NIK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png 848w, https://substackcdn.com/image/fetch/$s_!3NIK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png 1272w, https://substackcdn.com/image/fetch/$s_!3NIK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3NIK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png" width="907" height="544" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:544,&quot;width&quot;:907,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17719,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://aisoftwareengineer.substack.com/i/185539477?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3NIK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png 424w, https://substackcdn.com/image/fetch/$s_!3NIK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png 848w, https://substackcdn.com/image/fetch/$s_!3NIK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png 1272w, https://substackcdn.com/image/fetch/$s_!3NIK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4e581c-878e-46aa-98f5-f8808b607049_907x544.png 1456w" sizes="100vw" loading="lazy"></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 aria-hidden="true" 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><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><blockquote><p>The database can&#8217;t handle the load. Queries start timing out. Your application retries those failed queries, which adds even more load.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PqTE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PqTE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png 424w, https://substackcdn.com/image/fetch/$s_!PqTE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png 848w, https://substackcdn.com/image/fetch/$s_!PqTE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png 1272w, https://substackcdn.com/image/fetch/$s_!PqTE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PqTE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png" width="698" height="851" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:851,&quot;width&quot;:698,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:23655,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://aisoftwareengineer.substack.com/i/185539477?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PqTE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png 424w, https://substackcdn.com/image/fetch/$s_!PqTE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png 848w, https://substackcdn.com/image/fetch/$s_!PqTE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png 1272w, https://substackcdn.com/image/fetch/$s_!PqTE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6246e8c-f094-487d-9457-1b97eff9e2b1_698x851.png 1456w" sizes="100vw" loading="lazy"></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 aria-hidden="true" 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><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></p><p><strong>What&#8217;s Happening? </strong></p><p>Your conversation history table looks like this:</p><pre><code><code>CREATE TABLE conversations (
    id SERIAL PRIMARY KEY,
    user_id INTEGER,
    agent_id INTEGER,
    message TEXT,
    created_at TIMESTAMP,
    metadata JSONB
);

CREATE INDEX idx_user_conversations ON conversations(user_id, created_at);
</code></code></pre><p>Every time an agent opens a chat, you run:</p><pre><code><code>SELECT * FROM conversations 
WHERE user_id = ? 
ORDER BY created_at DESC 
LIMIT 50;
</code></code></pre><p>This query is fast when you have 1,000 users. But with 50,000 concurrent users, you&#8217;re running this query thousands of times per second.</p><blockquote><p><em><strong>Each query needs to scan the index, fetch rows, and return data. Under normal load, PostgreSQL handles this fine. Under spike load, it can&#8217;t keep up.</strong></em></p></blockquote><p></p><p><strong>Connection Exhaustion</strong></p><p>Your application opens a new database connection for every request.</p><p>With 5,000 concurrent connections, PostgreSQL hits its connection limit. New requests start failing with &#8220;too many connections&#8221; errors.</p><p>Your application&#8217;s connection pool settings:</p><pre><code><code>pool_size = 50  # connections per app instance
max_overflow = 100  # additional connections when needed
</code></code></pre><p>With 50 application instances, you potentially create 7,500 connections. PostgreSQL can&#8217;t handle it.</p><p><strong>Write Amplification</strong></p><p>Your chatbot also writes every new message to the database:</p><pre><code><code>INSERT INTO conversations (user_id, agent_id, message, created_at, metadata)
VALUES (?, ?, ?, NOW(), ?);
</code></code></pre><p>With 50,000 agents handling an average of 5 conversations simultaneously, you&#8217;re looking at 250,000 active conversations.</p><p>If each conversation generates 10 messages per minute, that&#8217;s 2.5 million writes per minute or roughly 41,000 writes per second.</p><p>PostgreSQL&#8217;s MVCC system creates a new row version for every write. Old versions become dead tuples that need to be cleaned up by <a href="https://www.postgresql.org/docs/17/runtime-config-autovacuum.html">autovacuum.</a></p><div class="pullquote"><p><em><strong>Under this write load, autovacuum can&#8217;t keep up. Your tables bloat, indexes grow, and queries slow down even more. And at this point, you are likely to give up! </strong></em></p></div><p>You start looking at sharding solutions, NoSQL databases, or managed <em><strong>services that promise infinite scale.</strong></em></p><p>But OpenAI showed there&#8217;s another way.</p><p>The problem isn&#8217;t PostgreSQL, but how you&#8217;re using it.</p><blockquote><p><em><strong>Let&#8217;s redesign this architecture using the lessons from OpenAI&#8217;s guide and build something that scales.</strong></em></p></blockquote><div><hr></div><h2>Architecture Solution</h2><p>OpenAI&#8217;s solution centers on one primary PostgreSQL instance with nearly 50 read replicas distributed across multiple geographic regions.</p><p>The architecture looks simple on paper, but making it work at this scale required extensive optimizations across multiple layers.</p><blockquote><p><em><strong>Here&#8217;s how we redesign the AI chatbot platform using OpenAI&#8217;s scaling principles.</strong></em></p></blockquote><p>We&#8217;re keeping the single-primary PostgreSQL architecture but adding critical layers that make it work at scale.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QN8A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QN8A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png 424w, https://substackcdn.com/image/fetch/$s_!QN8A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png 848w, https://substackcdn.com/image/fetch/$s_!QN8A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png 1272w, https://substackcdn.com/image/fetch/$s_!QN8A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QN8A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png" width="857" height="1421" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1421,&quot;width&quot;:857,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40606,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://aisoftwareengineer.substack.com/i/185539477?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QN8A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png 424w, https://substackcdn.com/image/fetch/$s_!QN8A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png 848w, https://substackcdn.com/image/fetch/$s_!QN8A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png 1272w, https://substackcdn.com/image/fetch/$s_!QN8A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa3c07e2-d0dc-45af-a48b-3661a029162c_857x1421.png 1456w" sizes="100vw" loading="lazy"></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 aria-hidden="true" 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><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>Each layer solves a specific problem from the previous section.</p><p><strong>Layer 1: PgBouncer for Connection Pooling</strong></p><p>Instead of your application connecting directly to PostgreSQL, all connections go through PgBouncer first.</p><blockquote><p><em><strong>Your 10,000 application connections get pooled into just 100 PostgreSQL connections. Connection setup time drops from 50ms to 5ms, and you never hit the connection limit.</strong></em></p></blockquote><p><strong>Layer 2: Cache Locking</strong></p><p>The critical feature that prevents a thundering herd during cache failures.</p><p>When your cache goes down, only one request per cache key hits PostgreSQL. All other requests wait for the cache to be repopulated instead of overwhelming the database.</p><p><strong>Layer 3: Read/Write Split</strong></p><p>95% of your chatbot queries are reads (fetching conversation history). Only 5% are writes (storing new messages).</p><blockquote><p><em><strong>All reads go to replicas. Only writes touch the primary. This keeps your primary free to handle write spikes without being saturated by read traffic.</strong></em></p></blockquote><p><strong>Layer 4: Rate Limiting</strong></p><p>Application-level rate limiting prevents any single user from overwhelming your system.</p><blockquote><p><em><strong>You set limits like 100 conversation fetches per minute per user and 30 new messages per minute per user. Even if someone tries to abuse your API, they can&#8217;t take down your database.</strong></em></p></blockquote><p><strong>Layer 5: Regional Replicas</strong></p><p>For a global chatbot, you deploy read replicas in each major region. Users read from their nearest replica, reducing latency from 200ms to 20ms.</p><div><hr></div><h2>How the System Handled Failures </h2><ul><li><p><strong>Cache failure:</strong> Cache locking prevents database overload. Only one request per key hits the database. Performance degrades but doesn&#8217;t crash.</p></li><li><p><strong>Replica failure:</strong> Traffic automatically routes to healthy replicas. There is no manual intervention needed.</p></li><li><p><strong>Primary failure:</strong> Hot standby promotes to primary automatically. Downtime is 30-60 seconds while read traffic continues uninterrupted.</p></li></ul><blockquote><p><em><strong>I&#8217;ll be covering the complete implementation of this architecture in the upcoming AI Build &amp; Deploy Series, where we&#8217;ll build this chatbot step by step with:</strong></em></p></blockquote><ul><li><p><em>Complete Docker setup with PgBouncer, PostgreSQL, and Redis</em></p></li><li><p><em>Python code for the database router (read/write split)</em></p></li><li><p><em>Cache locking implementation that prevents thundering herd</em></p></li><li><p><em>FastAPI endpoints with rate limiting</em></p></li><li><p><em>Load testing scripts to verify it works under pressure</em></p></li><li><p><em>Monitoring dashboards to track what matters</em></p></li></ul><p>The complete code, including error handling, connection pooling configuration, cache implementation, and deployment setup, will be available in the series.</p><p></p><div><hr></div><h2>Final Thoughts </h2><p>OpenAI's approach to scaling PostgreSQL shows it can scale further than most people realize when you apply the right strategies.</p><blockquote><p><em><strong>It demonstrates that with proper architecture, query optimization, connection pooling, caching, and workload isolation, a single-primary PostgreSQL instance can serve hundreds of millions of users.</strong></em></p></blockquote><p>These principles work at 1,000 users, 100,000 users, or 10 million users.</p><p>Your database architecture doesn&#8217;t need to be perfect from day one, but it should be designed to evolve as your application grows.</p><p>If you&#8217;re building an AI application and wondering whether PostgreSQL can handle your scale, the answer is probably yes, as long as you build with these principles in mind.</p><div class="pullquote"><p>What&#8217;s your experience with scaling PostgreSQL? Leave a comment below with your challenges or questions.</p></div><h2>AI Software Engineer </h2><p>Let&#8217;s Build The Coding Future Together</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://asenewsletter.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 AI Software Engineer  ! 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[AI Software Engineer Newsletter]]></title><description><![CDATA[Technical Guides on AI Coding Tools, Trends, & AI Software Engineering Workflows]]></description><link>https://asenewsletter.com/p/ai-software-engineer-newsletter</link><guid isPermaLink="false">https://asenewsletter.com/p/ai-software-engineer-newsletter</guid><dc:creator><![CDATA[Joe]]></dc:creator><pubDate>Fri, 23 Jan 2026 15:02:48 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PViq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png" 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_!PViq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PViq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!PViq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!PViq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!PViq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PViq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png" width="1200" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:947815,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://aisoftwareengineer.substack.com/i/185531557?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cb5e1a-abab-449c-9890-bbe7d20a7bb8_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PViq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!PViq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!PViq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!PViq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6b00ac6-18ea-4e85-8ef9-f482794186d7_1200x600.png 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 aria-hidden="true" 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><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>It&#8217;s said that 12 months from now, AI will replace software engineers and will write all the code.</p><p> But one thing will remain constant &#8212;<em><strong> you will be there, whether AI replaces software engineers or not, your career will be intact as a software engineer.</strong></em></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://asenewsletter.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 AI Software Engineer  ! 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>More important is what you will become since the change is inevitable, but I&#8217;m bullish on what&#8217;s ahead.</p><blockquote><p><em><strong><a href="https://medium.com/@joe.njenga">I hit 10,000 followers on Medium, and most of you have been reading my content there</a>. The engagement has been incredible, but I&#8217;ve felt the constraint for a while now.</strong></em></p></blockquote><p>Medium limits how deep I can go on technical subjects. </p><p>The platform works well for overviews and introductions, but when you ask detailed questions in the comments or request step-by-step implementations, I hit a wall.</p><p><em><strong>That&#8217;s why we&#8217;re <a href="https://aisoftwareengineer.substack.com/">here on Substack.</a></strong></em></p><p>This newsletter gives me the space to go as deep as needed without artificial constraints. </p><p>I can write comprehensive guides, include detailed code examples, and provide the kind of technical depth that helps you  implement these tools in your workflow.</p><blockquote><p><em><strong>Every week, I&#8217;ll publish one deep technical guide covering AI tools, coding trends, and software engineering workflows. Think RAG implementations, tool integration strategies, MCP deep dives, and practical examples you can use immediately.</strong></em></p></blockquote><p>On top of that, you&#8217;ll get daily updates when something important drops. AI moves fast, and I know your time is valuable, so I&#8217;ll break down new releases, model updates, and feature announcements as they happen.</p><p>The goal is to keep you informed and save you time digging through release notes and technical blogs.</p><blockquote><p><em><strong>I test everything before writing about it. You&#8217;ll get my real experience with these tools.</strong></em></p></blockquote><p></p><div><hr></div><p></p><h2>Newsletter Topics </h2><p>This newsletter covers four main areas that matter most to developers working with AI.</p><ol><li><p><strong>AI Coding Tools &amp; Trends</strong></p></li></ol><p>New model releases, coding tools, and frameworks as they launch.</p><p><em><strong>I break down what&#8217;s useful versus what&#8217;s just hype, test the tools in real projects, and share what works.</strong></em></p><p></p><ol start="2"><li><p><strong>AI Software Engineering Workflows</strong></p></li></ol><p>How AI fits into your actual development process. </p><p><em><strong>We&#8217;re talking about productivity gains, workflow automation, and practical integration strategies that don&#8217;t require rebuilding your entire stack.</strong></em></p><p></p><ol start="3"><li><p><strong>AI Deep Technical Guides</strong></p></li></ol><p>Weekly deep dives on subjects like RAG implementations, tool integration patterns, and MCP server architectures. </p><p><em><strong>These are hands-on guides with code examples and real implementations you can use immediately.</strong></em></p><p></p><ol start="4"><li><p><strong>AI Simplified Research</strong></p></li></ol><p>I take research papers and technical blogs that would take hours to digest and break them down into actionable insights. </p><p><em><strong>The goal is to extract what matters for developers and skip the academic overhead.</strong></em></p><p>Every piece of content here serves one purpose &#8212; help you build better software with AI tools that are evolving faster than anyone can keep up with on their own.</p><blockquote><p><em><strong>The content is technical but accessible. I write for software engineers, AI engineers, freelancers, and tech enthusiasts who want substance over surface-level summaries.</strong></em></p></blockquote><p></p><div class="poll-embed" data-attrs="{&quot;id&quot;:437952}" data-component-name="PollToDOM"></div><p></p><div><hr></div><p></p><h2>How it Works</h2><p>The newsletter runs on two tracks.</p><p><strong>Weekly Deep Dives</strong></p><p>Every week, one comprehensive technical guide. </p><p>These are detailed explorations of tools, implementations, and workflows that require more than a quick overview.</p><blockquote><p><em><strong>These guides take time to write because I test everything first. I run the tools in real projects, document what works and what doesn&#8217;t, then break it down in a way that makes sense for developers at different skill levels.</strong></em></p></blockquote><p></p><p><strong>Daily Updates</strong></p><p>When something important drops, you&#8217;ll hear about it fast.</p><p>New model releases, major feature updates, or significant changes in the AI coding space get covered the same day or within 24 hours. These are shorter, focused posts that break down release notes into what you actually need to know.</p><blockquote><p><em><strong>The goal is to save you time. Instead of reading through technical blogs and official documentation, you get the essential information and practical implications in a few minutes.</strong></em></p></blockquote><p></p><p><strong>My Approach</strong></p><p>I want to write about actual insights instead of theoretical overviews.</p><p>The goal isn&#8217;t to hype every new release but to give you honest assessments based on real usage or technical review. </p><blockquote><p><em><strong>This is a two-way conversation.<br>Your questions and the topics you want covered shape what I write about next, so don&#8217;t hesitate to reach out with what you&#8217;re working on or struggling with.</strong></em></p></blockquote><p>This newsletter is built for developers and technical professionals working with AI.</p><p>If you&#8217;re a software engineer exploring AI coding tools, an AI engineer building production systems, a freelancer trying to stay competitive, or a tech enthusiast who wants to understand how these tools  work, this is for you.</p><p></p><div><hr></div><p></p><h2>Let&#8217;s Get Started</h2><p>The first deep technical guide drops soon.</p><blockquote><p><em><strong>We&#8217;ll cover RAG implementations, tool integration patterns, and MCP architecture with code examples and practical use cases you can implement in your projects. It&#8217;s going to be detailed, technical, and useful.</strong></em></p></blockquote><p>In the meantime, you&#8217;ll start seeing daily updates as important releases happen. AI doesn&#8217;t wait for publishing schedules, so neither will we.</p><p></p><p><strong>What I Need From You</strong></p><p>This newsletter works best when it&#8217;s a conversation. If there are specific tools you want me to test, topics you&#8217;re struggling with, or areas where you need deeper guidance, let me know.</p><blockquote><p><em><strong>Reply to this email or drop a comment with what you&#8217;re working on or what you want to see covered. Your questions and interests directly shape what gets published here.</strong></em></p></blockquote><p></p><p><strong>Support This Work</strong></p><p>If you find value in these guides and updates, consider pledging your support. It helps me dedicate more time to testing tools, writing detailed tutorials, and keeping the content quality high.</p><blockquote><p><em><strong>You can pledge support here on Substack, which gives you early access to my books, upcoming AI coding course, and the ability to request specific topics you want covered.</strong></em></p></blockquote><p>Whether you&#8217;re here as a free subscriber or a paying supporter, you&#8217;re part of this community. </p><p>We&#8217;re navigating this together, and the goal is to make sure you come out ahead.</p><p></p><div><hr></div><p><strong>                       Welcome to the AI Software Engineer Newsletter</strong></p><p>                                    Let&#8217;s Build The Coding Future Together </p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://asenewsletter.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 AI Software Engineer  ! 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>