<?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: Adil Khan</title>
    <description>The latest articles on DEV Community by Adil Khan (@adil_khan_35649a2ba914bfb).</description>
    <link>https://dev.to/adil_khan_35649a2ba914bfb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3980582%2Fb5ea229a-e6a3-4ac9-bc81-6bc3aaf9e466.png</url>
      <title>DEV Community: Adil Khan</title>
      <link>https://dev.to/adil_khan_35649a2ba914bfb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adil_khan_35649a2ba914bfb"/>
    <language>en</language>
    <item>
      <title>🎭 What if fictional characters could actually text you back?</title>
      <dc:creator>Adil Khan</dc:creator>
      <pubDate>Sun, 12 Jul 2026 13:31:35 +0000</pubDate>
      <link>https://dev.to/adil_khan_35649a2ba914bfb/what-if-fictional-characters-could-actually-text-you-back-252o</link>
      <guid>https://dev.to/adil_khan_35649a2ba914bfb/what-if-fictional-characters-could-actually-text-you-back-252o</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-07-09"&gt;Weekend Challenge: Passion Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;Think of a character from a movie or show you loved. Not the show just them.&lt;/p&gt;

&lt;p&gt;How long ago did you watch it? What's the one line, the one expression, the one moment you still remember?&lt;/p&gt;

&lt;p&gt;After finishing a great series, I always wished I could keep talking to the characters instead of waiting months (or years) for the next season.&lt;/p&gt;

&lt;p&gt;So I built the next best thing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FandomDial&lt;/strong&gt; is a WhatsApp-inspired AI chat application where you don't just read about a character you message them, hear their voice, and watch them remember your previous conversations.&lt;/p&gt;

&lt;p&gt;Rather than recreating existing fictional characters, I designed three completely original personalities, each with their own conversational style, humour, and voice.&lt;/p&gt;

&lt;h3&gt;
  
  
  🟢 Gullu
&lt;/h3&gt;

&lt;p&gt;Quiet. Dry. Brutally honest.&lt;/p&gt;

&lt;p&gt;He barely talks but when he does, every sentence lands.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔵 Sohail
&lt;/h3&gt;

&lt;p&gt;The childhood friend who'll help you with almost anything...&lt;/p&gt;

&lt;p&gt;...except lending you money.&lt;/p&gt;

&lt;p&gt;Every conversation turns into an interrogation about your life choices.&lt;/p&gt;

&lt;h3&gt;
  
  
  🟠 Zaid
&lt;/h3&gt;

&lt;p&gt;Endlessly confident.&lt;/p&gt;

&lt;p&gt;King of jugaad.&lt;/p&gt;

&lt;p&gt;Every disaster somehow has a shortcut solution even if it absolutely shouldn't.&lt;/p&gt;

&lt;p&gt;Every character remembers previous conversations, generates responses with &lt;strong&gt;Google Gemini&lt;/strong&gt;, and occasionally just like a real friend sends an unexpected voice note generated with &lt;strong&gt;ElevenLabs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The goal wasn't to build another chatbot.&lt;/p&gt;

&lt;p&gt;It was to build characters people would actually enjoy talking to.&lt;/p&gt;




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

&lt;p&gt;🌐 &lt;strong&gt;Live Demo&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Try this first:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open &lt;strong&gt;Gullu&lt;/strong&gt;, then send him something slightly rude like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Why are you like this?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;His reply usually tells people everything they need to know about the project.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The project is hosted on Render's free tier. If the application has been idle, the first request may take around &lt;strong&gt;30–50 seconds&lt;/strong&gt; while the server wakes up.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Screenshot
&lt;/h3&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpncz1cxjdvpgoi6hs8um.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpncz1cxjdvpgoi6hs8um.png" alt="Screenshot of FandomDial showing a WhatsApp-style conversation with the AI character Gullu, including text messages and voice note playback." width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/FanoyG" rel="noopener noreferrer"&gt;
        FanoyG
      &lt;/a&gt; / &lt;a href="https://github.com/FanoyG/fandomdial-" rel="noopener noreferrer"&gt;
        fandomdial-
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      WhatsApp-inspired AI chat platform with original characters, voice notes, conversation memory, Google Gemini, ElevenLabs, FastAPI, and Hexagonal Architecture.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;p&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/FanoyG/fandomdial-/images/cc.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FFanoyG%2Ffandomdial-%2FHEAD%2Fimages%2Fcc.png" alt="FandomDial Logo" width="180"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;FandomDial&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;strong&gt;A voice for every character worth talking to.&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
Chat with original AI characters that remember conversations, express unique personalities, and occasionally reply with realistic voice notes
&lt;/p&gt;

&lt;p&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/324b4cfa68deb1b9c0008c02e910370ae1e1b7141ce0fe77972b6ea034e7abb7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f507974686f6e2d3337373641423f7374796c653d666f722d7468652d6261646765266c6f676f3d707974686f6e266c6f676f436f6c6f723d7768697465"&gt;&lt;img src="https://camo.githubusercontent.com/324b4cfa68deb1b9c0008c02e910370ae1e1b7141ce0fe77972b6ea034e7abb7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f507974686f6e2d3337373641423f7374796c653d666f722d7468652d6261646765266c6f676f3d707974686f6e266c6f676f436f6c6f723d7768697465"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/f1089fe65f9ac27d38b03b1b728ac926659fcd1c88dc75269faa736fa95131d3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466173744150492d3030393638383f7374796c653d666f722d7468652d6261646765266c6f676f3d66617374617069266c6f676f436f6c6f723d7768697465"&gt;&lt;img src="https://camo.githubusercontent.com/f1089fe65f9ac27d38b03b1b728ac926659fcd1c88dc75269faa736fa95131d3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466173744150492d3030393638383f7374796c653d666f722d7468652d6261646765266c6f676f3d66617374617069266c6f676f436f6c6f723d7768697465"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/c9413dece30c8c0bd1328b804e6e54e1ff6f0c4b39b2c78fb8dfae74836e9a97/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f476f6f676c655f47656d696e692d3432383546343f7374796c653d666f722d7468652d6261646765266c6f676f3d676f6f676c65266c6f676f436f6c6f723d7768697465"&gt;&lt;img src="https://camo.githubusercontent.com/c9413dece30c8c0bd1328b804e6e54e1ff6f0c4b39b2c78fb8dfae74836e9a97/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f476f6f676c655f47656d696e692d3432383546343f7374796c653d666f722d7468652d6261646765266c6f676f3d676f6f676c65266c6f676f436f6c6f723d7768697465"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/93a9a516890e784d4e7eab1581ffc574910da02c5a32f544920f7294a49f05f2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c6576656e4c6162732d3030303030303f7374796c653d666f722d7468652d6261646765"&gt;&lt;img src="https://camo.githubusercontent.com/93a9a516890e784d4e7eab1581ffc574910da02c5a32f544920f7294a49f05f2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c6576656e4c6162732d3030303030303f7374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/66ec33ccfacd954142cd078977fbdc4c668ea64be2e25dd8fd40dc6e2aa20064/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f48657861676f6e616c5f4172636869746563747572652d3641314239413f7374796c653d666f722d7468652d6261646765"&gt;&lt;img src="https://camo.githubusercontent.com/66ec33ccfacd954142cd078977fbdc4c668ea64be2e25dd8fd40dc6e2aa20064/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f48657861676f6e616c5f4172636869746563747572652d3641314239413f7374796c653d666f722d7468652d6261646765"&gt;&lt;/a&gt;
&lt;/p&gt;



&lt;p&gt;🚀 Built for the &lt;strong&gt;DEV Weekend Challenge — Passion Edition (2026)&lt;/strong&gt;&lt;/p&gt;




&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🎥 Demo&lt;/h1&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://fandomdial.onrender.com" rel="nofollow noopener noreferrer"&gt;https://fandomdial.onrender.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Note: hosted on Render's free tier, which sleeps after ~15 minutes of inactivity. First load may take 30-50 seconds to wake up.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;
  &lt;a rel="noopener noreferrer" href="https://github.com/FanoyG/fandomdial-/images/demo.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FFanoyG%2Ffandomdial-%2FHEAD%2Fimages%2Fdemo.png" alt="FandomDial Demo" width="100%"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;What you're seeing&lt;/h3&gt;

&lt;/div&gt;

&lt;p&gt;The screenshot below demonstrates a live conversation with &lt;strong&gt;Gullu&lt;/strong&gt;, one of FandomDial's original AI characters.&lt;/p&gt;

&lt;p&gt;Responses are generated using Google Gemini, synthesized with ElevenLabs when voice is triggered, and delivered through a WhatsApp-inspired interface that preserves conversational memory.&lt;/p&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Table of Contents&lt;/h2&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-overview" rel="noopener noreferrer"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-why-we-built-it" rel="noopener noreferrer"&gt;Why We Built It&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-highlights" rel="noopener noreferrer"&gt;Highlights&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-meet-the-characters" rel="noopener noreferrer"&gt;Characters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-architecture" rel="noopener noreferrer"&gt;Architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-engineering-decisions" rel="noopener noreferrer"&gt;Engineering Decisions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-project-structure" rel="noopener noreferrer"&gt;Project Structure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-api-overview" rel="noopener noreferrer"&gt;API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-running-locally" rel="noopener noreferrer"&gt;Running Locally&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-design-decisions" rel="noopener noreferrer"&gt;Design Decisions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-roadmap" rel="noopener noreferrer"&gt;Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/FanoyG/fandomdial-#-license" rel="noopener noreferrer"&gt;License&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;✨ Overview&lt;/h1&gt;

&lt;/div&gt;

&lt;p&gt;FandomDial is a WhatsApp-inspired conversational platform where users interact with &lt;strong&gt;original AI characters&lt;/strong&gt;, each designed with a unique…&lt;/p&gt;&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/FanoyG/fandomdial-" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;The repository includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complete FastAPI backend&lt;/li&gt;
&lt;li&gt;WhatsApp-style frontend&lt;/li&gt;
&lt;li&gt;Hexagonal Architecture&lt;/li&gt;
&lt;li&gt;Full engineering documentation&lt;/li&gt;
&lt;li&gt;Deployment instructions&lt;/li&gt;
&lt;li&gt;Detailed README explaining every architectural decision&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;From the beginning, I wanted this to feel like a real software project rather than a weekend prompt wrapper.&lt;/p&gt;

&lt;p&gt;The application follows &lt;strong&gt;Hexagonal Architecture (Ports &amp;amp; Adapters)&lt;/strong&gt; with &lt;strong&gt;SOLID principles&lt;/strong&gt;, allowing the business logic to remain independent from AI providers, voice engines, and storage implementations.&lt;/p&gt;

&lt;p&gt;The core services communicate only through interfaces (&lt;code&gt;AIProvider&lt;/code&gt;, &lt;code&gt;VoiceProvider&lt;/code&gt;, and &lt;code&gt;SessionStore&lt;/code&gt;), making providers replaceable without touching the domain logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tech Stack&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FastAPI&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Google Gemini&lt;/li&gt;
&lt;li&gt;ElevenLabs&lt;/li&gt;
&lt;li&gt;HTML&lt;/li&gt;
&lt;li&gt;CSS&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🧠 Google Gemini
&lt;/h3&gt;

&lt;p&gt;Google Gemini powers every conversation.&lt;/p&gt;

&lt;p&gt;Each character has a carefully designed behavioral prompt built around a different conversational mechanism instead of simply "being funny."&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gullu uses deadpan honesty.&lt;/li&gt;
&lt;li&gt;Sohail constantly questions your decisions.&lt;/li&gt;
&lt;li&gt;Zaid solves everything with reckless confidence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One challenge was conversation growth.&lt;/p&gt;

&lt;p&gt;Passing the entire message history to the LLM eventually becomes slow and expensive.&lt;/p&gt;

&lt;p&gt;To solve that, I built a &lt;strong&gt;Context Builder&lt;/strong&gt; that summarizes older conversations while preserving recent exchanges, keeping token usage predictable without losing conversational memory.&lt;/p&gt;

&lt;p&gt;During development I also encountered real &lt;strong&gt;429 quota errors&lt;/strong&gt;, which led me to implement an ordered fallback chain so conversations continue even when a preferred model becomes temporarily unavailable.&lt;/p&gt;




&lt;h3&gt;
  
  
  🎙️ ElevenLabs
&lt;/h3&gt;

&lt;p&gt;ElevenLabs powers all voice responses.&lt;/p&gt;

&lt;p&gt;Every character has a matched voice, and about &lt;strong&gt;20% of replies&lt;/strong&gt; are automatically delivered as voice notes instead of plain text.&lt;/p&gt;

&lt;p&gt;That randomness isn't arbitrary.&lt;/p&gt;

&lt;p&gt;A dedicated &lt;strong&gt;VoiceTriggerDecider&lt;/strong&gt; controls when voice should be generated.&lt;/p&gt;

&lt;p&gt;Before using it in the application, I validated the probability over &lt;strong&gt;2,000 simulated message iterations&lt;/strong&gt; to ensure the distribution matched the intended behavior.&lt;/p&gt;

&lt;p&gt;Another unexpected challenge appeared when the ElevenLabs API returned &lt;strong&gt;HTTP 402&lt;/strong&gt; errors.&lt;/p&gt;

&lt;p&gt;It turned out that community Voice Library voices aren't accessible through the free-tier API.&lt;/p&gt;

&lt;p&gt;Instead of hardcoding voice IDs, I queried the authenticated account for available voices and dynamically assigned compatible ones to each character.&lt;/p&gt;




&lt;h3&gt;
  
  
  ⚡ Performance &amp;amp; Reliability
&lt;/h3&gt;

&lt;p&gt;Several engineering problems appeared once the application started feeling "real."&lt;/p&gt;

&lt;p&gt;To solve them, I implemented:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Request-ticket playback&lt;/strong&gt;, preventing older voice requests from interrupting newer ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local audio caching&lt;/strong&gt;, so replaying the same response never consumes another API call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latency masking&lt;/strong&gt;, using lightweight filler audio only when generation exceeds a short threshold, making the application feel responsive even while AI responses are still being generated.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🚧 Design Trade-offs
&lt;/h3&gt;

&lt;p&gt;Some production features were intentionally left out to keep the project achievable within a weekend.&lt;/p&gt;

&lt;p&gt;Current limitations include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conversation sessions are stored in memory and reset when the server restarts.&lt;/li&gt;
&lt;li&gt;Voice quality is limited by the free ElevenLabs tier.&lt;/li&gt;
&lt;li&gt;Real-time voice calls were intentionally scoped out in favor of asynchronous voice notes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because storage, AI providers, and voice engines are all abstracted behind interfaces, these improvements can be added later without changing the application's core architecture.&lt;/p&gt;




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

&lt;p&gt;Building the interface was actually the easy part.&lt;/p&gt;

&lt;p&gt;Making conversations feel believable turned out to be much harder.&lt;/p&gt;

&lt;p&gt;The biggest challenges weren't writing prompts they were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;managing conversation context,&lt;/li&gt;
&lt;li&gt;controlling latency,&lt;/li&gt;
&lt;li&gt;handling API failures gracefully,&lt;/li&gt;
&lt;li&gt;preventing overlapping voice playback,&lt;/li&gt;
&lt;li&gt;and making voice notes feel spontaneous without exhausting API quotas.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those engineering decisions ended up shaping the architecture far more than any single feature.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;🏆 &lt;strong&gt;Best Use of Google AI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Google Gemini powers all dialogue generation, contextual memory, model fallback handling, and personality-driven conversations.&lt;/p&gt;

&lt;p&gt;🏆 &lt;strong&gt;Best Use of ElevenLabs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ElevenLabs provides realistic voice synthesis, smart voice-note generation, caching, and race-condition-safe playback.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This started as a weekend hackathon project.&lt;/p&gt;

&lt;p&gt;By Sunday night, it had become something much bigger.&lt;/p&gt;

&lt;p&gt;I no longer see FandomDial as just an AI chat application.&lt;/p&gt;

&lt;p&gt;I see it as the beginning of a platform where writers could publish original AI-powered characters, let readers interact with them, and discover which personalities people genuinely connect with before investing months writing a book, game, or screenplay.&lt;/p&gt;

&lt;p&gt;Whether it remains a hackathon project or grows into something more, building it reminded me that memorable software isn't created by APIs alone.&lt;/p&gt;

&lt;p&gt;It's created by thoughtful engineering and by designing experiences people actually want to come back to.&lt;/p&gt;

&lt;p&gt;Thanks for reading. ❤️&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>ai</category>
      <category>showdev</category>
    </item>
    <item>
      <title>The Logic vs. Syntax Gap: A Backend DSA Journey, Documented</title>
      <dc:creator>Adil Khan</dc:creator>
      <pubDate>Mon, 06 Jul 2026 09:54:06 +0000</pubDate>
      <link>https://dev.to/adil_khan_35649a2ba914bfb/the-logic-vs-syntax-gap-a-backend-dsa-journey-documented-ife</link>
      <guid>https://dev.to/adil_khan_35649a2ba914bfb/the-logic-vs-syntax-gap-a-backend-dsa-journey-documented-ife</guid>
      <description>&lt;h2&gt;
  
  
  Why This Series Exists
&lt;/h2&gt;

&lt;p&gt;I froze on a simple dictionary access problem for 4 minutes last week.&lt;/p&gt;

&lt;p&gt;Not because I didn't understand the pattern. I knew exactly what needed to happen: group by key, track the max, and return matching entries. But when it came to actually writing it, my fingers hesitated. I second-guessed syntax that I should have known cold.&lt;/p&gt;

&lt;p&gt;That gap — between understanding a concept and executing it under pressure — is what quietly fails people in technical interviews and real-world backend engineering. It is rarely a lack of knowledge. It is execution lag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ Mental Logic ] ─── ( 4-Minute Execution Lag ) ───&amp;gt; [ Working Production Code ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This series isn't another generic DSA course. There are already excellent, polished resources for that — NeetCode, Striver, take your pick.&lt;/p&gt;

&lt;p&gt;Instead, this is a documented, honest account of me closing my own execution gap — problem by problem, mistake by mistake, with nothing filtered out.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You'll Find Here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real diagnostic sets&lt;/strong&gt; — patterns I build to test where I actually stand. Not curated textbook problems, but the exact patterns that trip backend engineers up: aggregates, lambda sorting, nested dictionary access, loop tracking variables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timed attempts, not polished solutions&lt;/strong&gt; — if I fumble, get an error, or blank out, you'll see it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The reasoning, not just the answer&lt;/strong&gt; — why a pattern works, and how the same logic scales when you move from a script to a real backend system.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where I'm Starting
&lt;/h2&gt;

&lt;p&gt;Before jumping into complex algorithms, I built a 15-question set covering three core areas:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;List aggregates&lt;/li&gt;
&lt;li&gt;Dictionary + lambda operations&lt;/li&gt;
&lt;li&gt;String processing&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's one example from the set:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Input&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Alice&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;85&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bob&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;92&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Charlie&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;78&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;David&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;92&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="n"&gt;Output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bob&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;David&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;# Task: Return the names of students with the highest score.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It reads easy. Try writing it on a blank screen in under 60 seconds without looking anything up. That's the actual test — and that time constraint is where most developers, myself included, find their real gaps.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://drive.google.com/file/d/1iOEDksqWfjWH5osPubnOCciovYr5UC_A/view?usp=sharing" rel="noopener noreferrer"&gt;Grab the full 15-question set here to test yourself&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow Along
&lt;/h2&gt;

&lt;p&gt;I'm working through this in public — partly for accountability, partly because the messy middle of learning is more useful to see than a polished end result.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you're a developer on a similar path, this series will help you audit your own execution speed.&lt;/li&gt;
&lt;li&gt;If you're a hiring manager looking for engineers who care about clean execution over memorized patterns, this is a live view into how I think.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Next post&lt;/strong&gt;: breaking down exactly where I got stuck on the 15-question set, and the fixes that closed the gap.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Tags: #python #dsa #beginners #softwareengineering&lt;/em&gt;&lt;/p&gt;

</description>
      <category>backend</category>
      <category>python</category>
      <category>software</category>
      <category>cleancode</category>
    </item>
    <item>
      <title>How to Learn SOLID Principles Through Real Python Projects (2026 Guide)</title>
      <dc:creator>Adil Khan</dc:creator>
      <pubDate>Fri, 03 Jul 2026 13:36:47 +0000</pubDate>
      <link>https://dev.to/adil_khan_35649a2ba914bfb/how-to-learn-solid-principles-through-real-python-projects-2026-guide-egb</link>
      <guid>https://dev.to/adil_khan_35649a2ba914bfb/how-to-learn-solid-principles-through-real-python-projects-2026-guide-egb</guid>
      <description>&lt;p&gt;If you have ever tried to learn SOLID principles, you have probably run into the same boring textbook examples: a &lt;code&gt;Shape&lt;/code&gt; class with a &lt;code&gt;Square&lt;/code&gt; subclass, or a &lt;code&gt;Bird&lt;/code&gt; class that cannot fly. &lt;/p&gt;

&lt;p&gt;Let’s be honest: &lt;strong&gt;Nobody builds a flying bird app at a real backend job.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;When you are trying to learn Object-Oriented Programming (OOP) and Clean Code architectures, theoretical definitions just don't stick. You learn logic by building real systems, making mistakes, breaking things, and refactoring them with intent.&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;The Practical SOLID Series&lt;/strong&gt;. In this hands-on course, we skip the textbook definitions. Instead, we take messy, real-world Python scripts and systematically refactor them into clean, production-pattern prototypes. &lt;/p&gt;




&lt;h2&gt;
  
  
  🗺️ The Complete 12-Project SOLID &amp;amp; Test-Driven Roadmap
&lt;/h2&gt;

&lt;p&gt;This series is broken into four ascending difficulty tiers, moving you step-by-step from raw in-memory mutations to distributed production architecture.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ LEVEL 4: SYSTEM DESIGN &amp;amp; PRODUCTION ] -&amp;gt; Projects 10, 11, 12 (Async, Live SQL, Packaging)
                  ▲
                  │
[ LEVEL 3: MIDDLEWARE &amp;amp; CONTRACTS ]    -&amp;gt; Projects 7, 8, 9   (Generators, Decorators, ABCs)
                  ▲
                  │
[ LEVEL 2: DECOUPLED INJECTION ]       -&amp;gt; Projects 4, 5, 6   (Multi-file, DI, ORM Relationships)
                  ▲
                  │
[ LEVEL 1: IN-MEMORY MUTATION ]        -&amp;gt; Projects 1, 2, 3   (State Machines, References, Slices)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🟢 Level 1: Pure In-Memory State &amp;amp; Isolation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 1: The High-Throughput Vending Metrics Engine&lt;/strong&gt; — Mastering the Single Responsibility Principle (SRP), creating deep-copy memory isolation layers, and setting up strict input validation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 2: The Multi-Currency In-Memory Ledger Wallet&lt;/strong&gt; — Implementing the Open/Closed Principle (OCP) using extensible mapping tables, managing Interface Segregation (ISP) via read-only wrappers, and unlocking testability through Dependency Inversion (DIP).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 3: The Stateful Notification State Machine&lt;/strong&gt; — Managing isolated state changes and memory footprint safely across system-wide event flows.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🟡 Level 2: Multi-File Decoupling &amp;amp; Relational Persistence
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 4: The Decoupled E-Commerce Cart &amp;amp; Billing Bridge&lt;/strong&gt; — Breaking monoliths into distinct files while maintaining clean dependency compilation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 5: The Multi-Service Library Index Adapter&lt;/strong&gt; — Handling deep subclass substitution to actively demonstrate and validate the Liskov Substitution Principle (LSP).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 6: The Relational Transaction Auditing Engine&lt;/strong&gt; — Mapping mock data streams to relational models and structural databases.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🟠 Level 3: Middleware Interception &amp;amp; Contract Abstraction
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 7: The Dynamic Multi-Gateway Payment Router&lt;/strong&gt; — Using Python generators and lookup plugins to extend payment methods seamlessly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 8: The Log Streaming &amp;amp; Security Interceptor Engine&lt;/strong&gt; — Using advanced Python decorators to wrap security contracts and trace analytics without changing business logic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 9: The Validated Enterprise Router Gateway&lt;/strong&gt; — Building absolute protocol abstractions via Python Abstract Base Classes (ABCs).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔴 Level 4: Full-Stack Production System Engineering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 10: The High-Concurrency Flight Fare Engine&lt;/strong&gt; — Tackling asynchronous operations and handling thread race conditions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 11: The Live Production Microservices API Gateway&lt;/strong&gt; — Connecting your local prototypes to a live SQL pipeline with production configurations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Project 12: The Automated Pipeline Verification Suite&lt;/strong&gt; — Bundling your engine as a distributable package and enforcing unit test regression coverage.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💻 The Open-Source Code Sandbox
&lt;/h2&gt;

&lt;p&gt;Don't just read the articles—run the code yourself. You can clone the complete project vault directly from GitHub:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone the open-source repository&lt;/span&gt;
git clone https://github.com/FanoyG/python-oop-solid-projects.git

&lt;span class="c"&gt;# Move inside the project directory&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;python-oop-solid-projects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the repository, every single project has dedicated Git tags (like &lt;code&gt;p1-mvp&lt;/code&gt;, &lt;code&gt;p2-mvp&lt;/code&gt;, and &lt;code&gt;p2-solid-complete&lt;/code&gt;) so you can literally watch the code evolve step-by-step on your local computer.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Why This Project-First Approach Works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;You See the "Why":&lt;/strong&gt; We don't just show you perfect code. We show you the fragile, messy code &lt;em&gt;first&lt;/em&gt;, simulate a problem (like a system crash or a race condition), and watch it break. You learn SOLID because you see exactly what disaster happens when you ignore it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Honest Engineering Over Overclaims:&lt;/strong&gt; We don't pretend our prototypes are magical enterprise systems. Every project includes a &lt;strong&gt;"What's Still Broken"&lt;/strong&gt; section highlighting concurrency bottlenecks, memory limitations, and architectural tradeoffs. That is how real-world senior engineers think.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Built in Public:&lt;/strong&gt; This series is a living portfolio designed to showcase system-thinking over superficial code streaks.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;Are you ready to stop reading theory and start building? Bookmark this index page, grab the GitHub repo, and let's jump into the code!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drop a comment below: Which SOLID principle trips you up the most when writing real backend logic?&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>architecture</category>
      <category>cleancode</category>
      <category>learning</category>
    </item>
    <item>
      <title>UUIDv4 vs UUIDv7 in PostgreSQL: A B-Tree Index Performance Deep Dive</title>
      <dc:creator>Adil Khan</dc:creator>
      <pubDate>Fri, 12 Jun 2026 07:50:07 +0000</pubDate>
      <link>https://dev.to/adil_khan_35649a2ba914bfb/uuidv4-vs-uuidv7-in-postgresql-a-b-tree-index-performance-deep-dive-3f0g</link>
      <guid>https://dev.to/adil_khan_35649a2ba914bfb/uuidv4-vs-uuidv7-in-postgresql-a-b-tree-index-performance-deep-dive-3f0g</guid>
      <description>&lt;h2&gt;
  
  
  Migrating MedicoSync: UUIDv4 → UUIDv7
&lt;/h2&gt;

&lt;h3&gt;
  
  
  (Why I'm doing it, and why it's cheap to defer)
&lt;/h3&gt;

&lt;p&gt;When building MedicoSync (an open-source FastAPI + PostgreSQL medical records platform), hiding internal database IDs was a key requirement on Day 1 [source: 0.1.1].&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Problem with Integers&lt;/strong&gt;: Simple sequential numbers like &lt;code&gt;/api/v1/patients/42&lt;/code&gt; leak data. A malicious user can guess the next numbers and scan your endpoints like &lt;code&gt;/43&lt;/code&gt;, &lt;code&gt;/44&lt;/code&gt;, or &lt;code&gt;/45&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Vulnerability&lt;/strong&gt;: This mistake is called an &lt;strong&gt;IDOR (Insecure Direct Object Reference)&lt;/strong&gt; vulnerability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To fix this security risk, I used standard UUIDv4 keys [source: 0.1.1]. It stopped the endpoint scanning problem perfectly. However, random text strings create a hidden slowdown inside relational database storage engines over time.&lt;/p&gt;




&lt;h2&gt;
  
  
  THE PROBLEM: B-Tree Page Splits with UUIDv4
&lt;/h2&gt;

&lt;p&gt;PostgreSQL keeps database rows organized on disk using a B-Tree index map. Think of your drive storage space as numbered storage boxes that are already completely full:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐
│   Box 1   │ │   Box 2   │ │   Box 3   │ │   Box 4   │
│  [ FULL ] │ │  [ FULL ] │ │  [ FULL ] │ │  [ FULL ] │
└───────────┘ └───────────┘ └───────────┘ └───────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because UUIDv4 is fully random, a brand-new row ID might belong right in the middle of Box 2. PostgreSQL cannot just append it to the end. It must force Box 2 open, execute a &lt;strong&gt;B-Tree page split&lt;/strong&gt;, and reorganize the disk layout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌───────────┐ ┌───────────┐┌───────────┐ ┌───────────┐ ┌───────────┐
│   Box 1   │ │  Box 2A   ││  Box 2B   │ │   Box 3   │ │   Box 4   │
│  [ FULL ] │ │  [ HALF ] ││  [ HALF ] │ │  [ FULL ] │ │  [ FULL ] │
└───────────┘ └───────────┘└─────▲─────┘ └───────────┘ └───────────┘
                                 │
                     [ New random row forced here. ]
                     [ Everything else shifts down. ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When tables grow to 1 million+ rows, this constant random disk fragmentation slows down write speeds.&lt;/p&gt;




&lt;h2&gt;
  
  
  THE FIX: UUIDv7's Time-Ordered Prefix
&lt;/h2&gt;

&lt;p&gt;UUIDv7 solves this problem by arranging its internal layout chronologically:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Layout = [ 48-bit UNIX Timestamp ][ 80 Random Bits ]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Because the prefix is time-prefixed, every newly generated UUIDv7 is greater than the last one. PostgreSQL can now cleanly append new rows directly to the very end of the index tree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐
│   Box 1   │ │   Box 2   │ │   Box 3   │ │   Box 4   │ │   Box 5   │
│  [ FULL ] │ │  [ FULL ] │ │  [ FULL ] │ │  [ FULL ] │ │ [ NEW ROW]│
└───────────┘ └───────────┘ └───────────┘ └───────────┘ └─────▲─────┘
                                                             │
                                                  [ Appends cleanly ]
                                                  [ with zero splits]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No page splits, no disk index reorganizing, and smooth data writing performance at scale.&lt;/p&gt;




&lt;h2&gt;
  
  
  THE STORAGE TRADE-OFF
&lt;/h2&gt;

&lt;p&gt;You must balance system storage memory against data security:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;UUID (v4 or v7)&lt;/strong&gt; ➔ Consumes &lt;strong&gt;16 bytes&lt;/strong&gt; of disk and RAM index space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BIGINT&lt;/strong&gt;          ➔ Consumes &lt;strong&gt;8 bytes&lt;/strong&gt; of disk and RAM index space.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;UUIDs take up double the index storage space compared to standard integers, but they keep sensitive resources hidden.&lt;/p&gt;




&lt;h2&gt;
  
  
  RESOLVING QUERY OVERHEAD: THE DUAL-ID PATTERN
&lt;/h2&gt;

&lt;p&gt;Fixing the &lt;em&gt;write&lt;/em&gt; path with UUIDv7 doesn't fully close the topic. There's a related pattern worth knowing about for systems like this: the &lt;strong&gt;internal ID / external ID split&lt;/strong&gt;, where a lightweight &lt;code&gt;BIGINT&lt;/code&gt; is used for internal joins and lookups, while a UUID is exposed externally as the public-facing identifier.&lt;/p&gt;

&lt;p&gt;A 16-byte UUID is more expensive to push through CPU cache lines and join operations than an 8-byte integer. At a high enough query volume, decoupling "what the database uses internally" from "what the API exposes externally" can shave meaningful overhead off hot-path queries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────────────────┐
│                   INCOMING API REQUEST                 │
│              GET /api/v1/patients/[ UUID ]             │
└───────────────────────────┬────────────────────────────┘
                            │ Public Route Boundary
                            ▼
┌────────────────────────────────────────────────────────┐
│                   BACKEND SERVICE LAYER                │
│    1. Match external public 16-byte UUID               │
│    2. Extract internal private 8-byte BIGINT (Fast)    │
└───────────────────────────┬────────────────────────────┘
                            │ Internal Network Only
                            ▼
┌────────────────────────────────────────────────────────┐
│                   POSTGRESQL DATABASE ENGINE           │
│     Executes blazing fast JOINs via internal BIGINT    │
└────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1. The Internal ID (BIGINT / 8 Bytes)&lt;/strong&gt;: Acts as the primary database key for table lookups and internal resource joins. This key never leaves your private backend network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2. The External ID (UUID / 16 Bytes)&lt;/strong&gt;: A standalone unique column used solely for frontend payloads and public routing links to hide database context from automated scanners.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;📝 &lt;em&gt;Note: I haven't implemented this in MedicoSync — at MVP scale, the query-cost difference is negligible compared to the UUIDv7 write-path fix. But I saw this pattern often, and it's the natural next thing to evaluate if MedicoSync's traffic ever grows to where join performance on the patients/records tables becomes a bottleneck. Worth flagging as the "next escalation point" if you're designing a similar system and expect serious scale early. I will publish a full step-by-step implementation guide on this dual-ID abstraction layer next week!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ARCHITECTURAL SUMMARY: WHICH ONE SHOULD YOU CHOOSE?
&lt;/h2&gt;

&lt;p&gt;Choosing between these options depends on the current lifecycle state of your database project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scenario 1: Starting a Brand New Project&lt;/strong&gt; ➔ Use native &lt;strong&gt;UUIDv7&lt;/strong&gt;. It provides security for public endpoints out of the box while naturally preserving index write performance on disk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scenario 2: Inheriting a Legacy System (Stuck on UUIDv4)&lt;/strong&gt; ➔ Do not rush into a high-risk schema rewrite. You can protect endpoints against scanning attacks by embedding tracking metadata directly inside secure, encrypted &lt;strong&gt;JWT (JSON Web Token) Payloads&lt;/strong&gt;. (I will be breaking down this pattern in an upcoming article!).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scenario 3: High-Throughput Systems&lt;/strong&gt; ➔ If your system writes millions of entries a day, decouple lookup stress entirely by adding a distributed caching store like &lt;strong&gt;Redis&lt;/strong&gt; to protect your primary database tables.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  THE ARCHITECTURAL VERDICT
&lt;/h2&gt;

&lt;p&gt;At MedicoSync's current MVP scale, the UUIDv4 → UUIDv7 gap isn't an urgent fire [source: 0.1.1].&lt;/p&gt;

&lt;p&gt;The reason it's cheap to defer is a foundational choice made on Day 1: &lt;strong&gt;Alembic migrations&lt;/strong&gt; [source: 0.1.1]. Because the schema is wrapped in Alembic from the start, updating the SQLAlchemy model's UUID generation strategy and auto-generating the migration is a scaffolded, low-risk change — not a rewrite [source: 0.1.1].&lt;/p&gt;

&lt;p&gt;Engineering isn't about shipping a flawless schema on day one [source: 0.1.1]. It's about building something clean enough to evolve when you learn there's a better way [source: 0.1.1].&lt;/p&gt;




&lt;h2&gt;
  
  
  LET'S CONNECT
&lt;/h2&gt;

&lt;p&gt;🛠️ Building a secure, high-performance Python/FastAPI backend, data pipeline, or custom workflow automation engine? Let’s design your platform together:&lt;br&gt;
👉 Work with me on Fiverr: &lt;a href="https://www.fiverr.com/s/gDe5pAo" rel="noopener noreferrer"&gt;Fiverr Profile&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;💾 Explore the full tested architecture codebase:&lt;br&gt;
👉 GitHub Profile: &lt;a href="https://github.com/FanoyG/medicosync" rel="noopener noreferrer"&gt;FanoyG GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🛠️ Working through similar backend/schema decisions? Happy to chat — find me here on dev.to or connect on &lt;a href="//linkedin.com/in/adil-khan5/"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>python</category>
      <category>fastapi</category>
      <category>systemdesign</category>
    </item>
  </channel>
</rss>
