<?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: Rahul Bhatt</title>
    <description>The latest articles on DEV Community by Rahul Bhatt (@rahulsbhatt).</description>
    <link>https://dev.to/rahulsbhatt</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F410218%2F8f9681f5-8e59-4c22-8af0-23cfdf7cedf8.png</url>
      <title>DEV Community: Rahul Bhatt</title>
      <link>https://dev.to/rahulsbhatt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rahulsbhatt"/>
    <language>en</language>
    <item>
      <title>⚡️ Building a Multi-Tenant Spring Boot Starter from Scratch — with Subdomain Routing, Dynamic Datasources &amp; Ego Logs</title>
      <dc:creator>Rahul Bhatt</dc:creator>
      <pubDate>Sat, 28 Jun 2025 17:55:15 +0000</pubDate>
      <link>https://dev.to/rahulsbhatt/building-a-multi-tenant-spring-boot-starter-from-scratch-with-subdomain-routing-dynamic-1p5g</link>
      <guid>https://dev.to/rahulsbhatt/building-a-multi-tenant-spring-boot-starter-from-scratch-with-subdomain-routing-dynamic-1p5g</guid>
      <description>&lt;h2&gt;
  
  
  🚀 Building a Multi-Tenant Spring Boot Starter from Scratch
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Developer Preview &lt;code&gt;v0.1.0-SNAPSHOT&lt;/code&gt; is live!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🧠 Why This Starter Exists
&lt;/h2&gt;

&lt;p&gt;Spring Boot lacks a true plug-and-play solution for multi-tenant SaaS platforms. Most solutions are deeply coupled, opinionated, or too abstract.&lt;/p&gt;

&lt;p&gt;But also — this project came from a personal place.&lt;/p&gt;

&lt;p&gt;Right after I received a disappointing 0.5 LPA raise (yes, backwards momentum), I decided to convert that frustration into engineering fire. Inspired by &lt;em&gt;Blue Lock&lt;/em&gt;, I wanted to log every technical decision like a striker chasing goals — enter the &lt;code&gt;ego-logs/&lt;/code&gt; folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧱 Project Structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├── starter/       → Core Spring Boot auto-config starter
├── demo/          → Sample app showing real usage
├── ego-logs/      → My engineering journal (yes, Blue Lock–style)
├── scripts/       → Placeholder for CI or future tools
├── daily/         → Temp debug + local artifacts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧩 Features in Developer Preview
&lt;/h2&gt;

&lt;p&gt;✅ Subdomain-based tenant resolution&lt;br&gt;
✅ Header-based tenant resolution&lt;br&gt;
✅ Tenant registry (in-memory)&lt;br&gt;
✅ Per-DB isolation strategy&lt;br&gt;
✅ &lt;code&gt;@EnableTenantIsolation&lt;/code&gt; annotation&lt;br&gt;
✅ Clean Spring Boot auto-configuration&lt;br&gt;
⚙️ Extensible resolvers + datasource logic&lt;/p&gt;

&lt;h2&gt;
  
  
  📦 Add It via JitPack
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Maven
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;com.github.rahul-s-bhatt&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;multi-tenant-springboot-starter&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;v0.1.0-SNAPSHOT&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Gradle
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nf"&gt;dependencies&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;implementation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"com.github.rahul-s-bhatt:multi-tenant-springboot-starter:v0.1.0-SNAPSHOT"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  💻 Usage Snapshot
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Enable the starter via &lt;code&gt;application.yml&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;multi-tenancy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;default-tenant-id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;acme&lt;/span&gt;
  &lt;span class="na"&gt;registry&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;IN_MEMORY&lt;/span&gt;
    &lt;span class="na"&gt;in-memory-tenants&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;tenantId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;acme&lt;/span&gt;
        &lt;span class="na"&gt;datasourceUrl&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jdbc:h2:mem:acme&lt;/span&gt;
        &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sa&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;tenantId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;globex&lt;/span&gt;
        &lt;span class="na"&gt;datasourceUrl&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jdbc:h2:mem:globex&lt;/span&gt;
        &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sa&lt;/span&gt;
  &lt;span class="na"&gt;isolation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TENANT_PER_DATABASE&lt;/span&gt;
  &lt;span class="na"&gt;resolution&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;HTTP_HEADER&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧠 How It Works
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowchart TD
  A[Request] --&amp;gt; B[Filter: TenantResolver]
  B --&amp;gt; C[TenantContextHolder]
  C --&amp;gt; D[TenantRegistry]
  D --&amp;gt; E[RoutingDataSource]
  E --&amp;gt; F[DB A or DB B]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔥 About &lt;code&gt;ego-logs/&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This is my commitment to daily logging of what I learned, attempted, failed at, or broke. No GitHub green dots — real dev logs.&lt;/p&gt;

&lt;p&gt;Just like &lt;em&gt;Blue Lock&lt;/em&gt;'s Ego Jinpachi believes in personal records to dominate the game, these ego logs are my engineering training arcs.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛣️ What's Coming
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;JWT-based tenant resolution&lt;/li&gt;
&lt;li&gt;Schema-based isolation&lt;/li&gt;
&lt;li&gt;Runtime tenant onboarding APIs&lt;/li&gt;
&lt;li&gt;Liquibase / Flyway integration&lt;/li&gt;
&lt;li&gt;Multi-tenant Spring Security support&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧑‍💻 Contribute or Fork
&lt;/h2&gt;

&lt;p&gt;If you're working on a SaaS platform, this is for you.&lt;br&gt;
Star 🌟 the repo, fork it, build your own isolation strategy.&lt;/p&gt;

&lt;p&gt;GitHub → &lt;a href="https://github.com/rahul-s-bhatt/multi-tenant-springboot-starter" rel="noopener noreferrer"&gt;rahul-s-bhatt/multi-tenant-springboot-starter&lt;/a&gt;&lt;br&gt;
JitPack → &lt;a href="https://jitpack.io/#rahul-s-bhatt/multi-tenant-springboot-starter" rel="noopener noreferrer"&gt;jitpack.io/#rahul-s-bhatt&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🫡 Final Words
&lt;/h2&gt;

&lt;p&gt;Dev discipline isn't just commits — it's clarity, context, and ego-fueled progress.&lt;/p&gt;

&lt;p&gt;This is just the beginning.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you enjoyed this drop, follow &lt;a href="https://twitter.com" rel="noopener noreferrer"&gt;@rahul_s_bhatt&lt;/a&gt; for future dev logs, open-source updates, and architecture deep dives.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>springboot</category>
      <category>java</category>
      <category>opensource</category>
      <category>multitenant</category>
    </item>
    <item>
      <title>Day 3 : DX-First Thinking: Why I Added @EnableTenantIsolation to My Spring Boot Starter</title>
      <dc:creator>Rahul Bhatt</dc:creator>
      <pubDate>Mon, 23 Jun 2025 18:14:58 +0000</pubDate>
      <link>https://dev.to/rahulsbhatt/day-3-dx-first-thinking-why-i-added-enabletenantisolation-to-my-spring-boot-starter-5fba</link>
      <guid>https://dev.to/rahulsbhatt/day-3-dx-first-thinking-why-i-added-enabletenantisolation-to-my-spring-boot-starter-5fba</guid>
      <description>&lt;h2&gt;
  
  
  DX-First Thinking: Why I Added &lt;code&gt;@EnableTenantIsolation&lt;/code&gt; to My Spring Boot Starter
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Day 3 of building &lt;code&gt;multi-tenant-springboot-starter&lt;/code&gt;&lt;/strong&gt; was less about code, more about mindset.&lt;/p&gt;

&lt;p&gt;I wanted developers to switch between &lt;code&gt;DATABASE&lt;/code&gt;, &lt;code&gt;SCHEMA&lt;/code&gt;, and &lt;code&gt;SHARED&lt;/code&gt; isolation strategies for tenants. The default Spring Boot way would be &lt;br&gt;
&lt;code&gt;application.yml:&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tenant:
  strategy: DATABASE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That works, but I asked myself:&lt;/p&gt;

&lt;p&gt;“What would it look like if Spring had built this?”&lt;/p&gt;

&lt;p&gt;So I created:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@EnableTenantIsolation(strategy = TenantIsolationStrategy.SCHEMA)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 This annotation uses ImportBeanDefinitionRegistrar and EnvironmentAware to inject the tenant.strategy key into the Spring Environment — before anything binds.&lt;/p&gt;

&lt;p&gt;What I learned:&lt;br&gt;
Boot auto-config works great, but it doesn't understand your custom annotations — unless you bridge them using &lt;a class="mentioned-user" href="https://dev.to/import"&gt;@import&lt;/a&gt;(...)&lt;/p&gt;

&lt;p&gt;The BEAN_CONTAINER trick in JPA is mandatory when manually wiring multiple EntityManagerFactoryBeans — without it, entity scanning breaks&lt;/p&gt;

&lt;p&gt;Key Takeaway:&lt;br&gt;
Framework-level DX is about thinking like Spring, not just using it.&lt;/p&gt;

&lt;p&gt;Tomorrow: schema-per-tenant Hibernate integration.&lt;/p&gt;

&lt;p&gt;Repo: github.com/rahul-s-bhatt/multi-tenant-springboot-starter&lt;/p&gt;

&lt;p&gt;Follow for more build-in-public logs ✨&lt;/p&gt;

</description>
      <category>springboot</category>
      <category>java</category>
      <category>opensource</category>
      <category>dx</category>
    </item>
    <item>
      <title>Day 1 of My Spring Boot Multitenancy Starter: Contexts, Filters, and Auto-Config</title>
      <dc:creator>Rahul Bhatt</dc:creator>
      <pubDate>Sun, 22 Jun 2025 10:25:14 +0000</pubDate>
      <link>https://dev.to/rahulsbhatt/day-1-of-my-spring-boot-multitenancy-starter-contexts-filters-and-auto-config-2mlk</link>
      <guid>https://dev.to/rahulsbhatt/day-1-of-my-spring-boot-multitenancy-starter-contexts-filters-and-auto-config-2mlk</guid>
      <description>&lt;h2&gt;
  
  
  Day 1 of My Spring Boot Multitenancy Starter: Contexts, Filters, and Auto-Config
&lt;/h2&gt;

&lt;p&gt;After Day 0’s emotional ignition, Day 1 was about structure, clarity, and hands-on bootstrapping.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Goal
&lt;/h2&gt;

&lt;p&gt;Scaffold the foundational skeleton of a plug-and-play Spring Boot multitenancy starter — just like how Spring Boot itself feels.&lt;/p&gt;




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

&lt;h3&gt;
  
  
  🧠 Core Concepts Implemented
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Thread-safe TenantContextHolder&lt;/strong&gt; using &lt;code&gt;ThreadLocal&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pluggable &lt;code&gt;TenantResolver&lt;/code&gt; interface&lt;/strong&gt; (subdomain strategy default)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;TenantFilter&lt;/code&gt;&lt;/strong&gt; to set/clear context per request&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;TenantDefinition&lt;/code&gt; (record)&lt;/strong&gt; to hold metadata like tenantId, creds, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;TenantRegistry&lt;/code&gt; + &lt;code&gt;InMemoryTenantRegistry&lt;/code&gt;&lt;/strong&gt; to register and fetch tenants&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;TenantRoutingDataSource&lt;/code&gt;&lt;/strong&gt; to delegate dynamically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;DataSourceFactory&lt;/code&gt;&lt;/strong&gt; to build isolated &lt;code&gt;HikariDataSource&lt;/code&gt;s per tenant&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom YAML props via &lt;code&gt;HikariTenantPoolProperties&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spring Boot AutoConfig:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;MultitenancyAutoConfiguration&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TenantRegistryAutoConfig&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TenantDataSourceAutoConfig&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;code&gt;@EnableMultitenancy&lt;/code&gt; annotation&lt;/strong&gt; to wire everything&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  🧪 Tests Added
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;code&gt;TenantContextTest&lt;/code&gt; — validate isolation&lt;/li&gt;
&lt;li&gt;✅ &lt;code&gt;TenantContextLeakTest&lt;/code&gt; — simulate misuse&lt;/li&gt;
&lt;li&gt;✅ &lt;code&gt;TenantContextConcurrencyTest&lt;/code&gt; — 100-thread stress test&lt;/li&gt;
&lt;/ul&gt;




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

&lt;h3&gt;
  
  
  🔹 Java Concurrency
&lt;/h3&gt;

&lt;p&gt;Built a cheat-sheet on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ThreadLocal&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ExecutorService&lt;/code&gt;, &lt;code&gt;CountDownLatch&lt;/code&gt;, &lt;code&gt;AtomicBoolean&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔹 Maven Structuring
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Local publish using &lt;code&gt;mvn install&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Clean starter module structure&lt;/li&gt;
&lt;li&gt;IDE tricks for IntelliJ Maven + &lt;code&gt;.iml&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔹 Spring Boot Internals
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;@ImportAutoConfiguration&lt;/code&gt; flow&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AutoConfiguration.imports&lt;/code&gt; mechanism&lt;/li&gt;
&lt;li&gt;Clean starter design, Spring-style&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📁 Folder Structure
&lt;/h2&gt;

&lt;p&gt;multi-tenant-springboot-starter/&lt;br&gt;
├── pom.xml&lt;br&gt;
├── starter/&lt;br&gt;
│ ├── pom.xml&lt;br&gt;
│ └── src/main/java/org/nirvikalpa/...&lt;br&gt;
│ └── src/test/java/org/nirvikalpa/...&lt;br&gt;
├── demo/ # coming tomorrow&lt;/p&gt;




&lt;h2&gt;
  
  
  🧭 Next Steps (Day 2 Plan)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Build a tenant onboarding workflow&lt;/li&gt;
&lt;li&gt;Wire demo app to consume the starter&lt;/li&gt;
&lt;li&gt;Expose &lt;code&gt;/health&lt;/code&gt; per-tenant endpoint&lt;/li&gt;
&lt;li&gt;Reflect in Ego Log #002&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;🔗 Repo: &lt;a href="https://github.com/rahul-s-bhatt/multi-tenant-springboot-starter" rel="noopener noreferrer"&gt;github link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for following my journey.&lt;br&gt;&lt;br&gt;
This is more than code — it's my architectural diary.&lt;/p&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>multitenancy</category>
      <category>opensource</category>
    </item>
    <item>
      <title>I Got a 0.5% Raise. So I’m Building a Multitenancy Starter for Spring Boot.</title>
      <dc:creator>Rahul Bhatt</dc:creator>
      <pubDate>Sat, 21 Jun 2025 17:32:21 +0000</pubDate>
      <link>https://dev.to/rahulsbhatt/i-got-a-05-raise-so-im-building-a-multitenancy-starter-for-spring-boot-4hck</link>
      <guid>https://dev.to/rahulsbhatt/i-got-a-05-raise-so-im-building-a-multitenancy-starter-for-spring-boot-4hck</guid>
      <description>&lt;h2&gt;
  
  
  I Got a 0.5% Raise. So I’m Building a Multitenancy Starter for Spring Boot.
&lt;/h2&gt;

&lt;p&gt;After spending weekends and late nights scaling a multi-tenant SaaS in FinTech, I received a &lt;strong&gt;0.5% raise&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It said more than words ever could.&lt;/p&gt;

&lt;p&gt;But instead of burning out or shutting down, I decided to &lt;em&gt;build in public&lt;/em&gt; the very thing I wish existed:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A true Spring Boot Multitenancy Starter — built with clarity, built with pain, built with purpose.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧱 What I'm Building
&lt;/h2&gt;

&lt;p&gt;I don't want to make another wrapper or a copy-paste blog pattern.&lt;/p&gt;

&lt;p&gt;I’m building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🧠 &lt;strong&gt;A thread-safe &lt;code&gt;TenantContextHolder&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🔌 &lt;strong&gt;Database-per-tenant routing&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;⚙️ &lt;strong&gt;Pluggable resolver strategies&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🧰 &lt;strong&gt;Runtime onboarding hooks&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🩺 &lt;strong&gt;Tenant-aware health indicators &amp;amp; logs&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;✨ &lt;strong&gt;Auto-configured like Spring Boot itself&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think: &lt;code&gt;spring-boot-starter-data-jpa&lt;/code&gt; — but for multitenancy.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Day 0: The Ego Kick
&lt;/h2&gt;

&lt;p&gt;It didn’t start with a plan. It started with rage.&lt;/p&gt;

&lt;p&gt;I opened ChatGPT and typed:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“If Spring Boot had to build multitenancy the right way — how would it design it?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then I fell down the rabbit hole of &lt;code&gt;spring-boot-autoconfigure&lt;/code&gt;, conditionals, &lt;code&gt;DataSourceBuilder&lt;/code&gt;, and bean registration logic.&lt;/p&gt;

&lt;p&gt;I wasn’t looking for a tutorial. I was looking for &lt;em&gt;intent&lt;/em&gt;. Design intent. Spring’s kind of intent.&lt;/p&gt;

&lt;p&gt;And slowly, the fog started clearing.&lt;/p&gt;




&lt;h2&gt;
  
  
  🗂️ What I Scaffolded on Day 0
&lt;/h2&gt;

&lt;p&gt;Here’s the first shape:&lt;/p&gt;

&lt;p&gt;org.nirvikalpa.multitenancy&lt;br&gt;
├── context/ # Holds TenantContextHolder (ThreadLocal)&lt;br&gt;
├── resolver/ # JWT / Subdomain / Header strategies&lt;br&gt;
├── datasource/ # RoutingDataSource logic&lt;br&gt;
├── config/ # Auto-config magic&lt;br&gt;
└── starter/ # What end users depend on&lt;/p&gt;




&lt;h2&gt;
  
  
  🔮 Why I’m Building in Public
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🧭 It keeps me honest and aligned&lt;/li&gt;
&lt;li&gt;💬 Feedback can shape design before it ossifies&lt;/li&gt;
&lt;li&gt;🪞 You see not just the final code, but the &lt;em&gt;internal war that built it&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This isn’t just about multitenancy. It’s about building with &lt;strong&gt;intent&lt;/strong&gt; instead of reaction.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 GitHub (Day 0 State)
&lt;/h2&gt;

&lt;p&gt;👉 github.com/rahulsb/spring-boot-starter-multitenancy&lt;br&gt;&lt;br&gt;
(still raw, still real — but it's up)&lt;/p&gt;




&lt;h2&gt;
  
  
  📅 What’s Next?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Finalize the pluggable &lt;code&gt;TenantResolver&lt;/code&gt; interface&lt;/li&gt;
&lt;li&gt;Decide if we default to JWT or subdomain&lt;/li&gt;
&lt;li&gt;Log Ego Entry #002&lt;/li&gt;
&lt;li&gt;Publish a Twitter/X launch thread&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you've ever struggled with multitenant systems in Java or wished for a true starter — follow this build. I’m designing in the open, thinking loud, and logging everything.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;Thanks for reading my Day 0.&lt;br&gt;&lt;br&gt;
I built this out of fire. Hope it helps light someone else's path.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>multitenancy</category>
      <category>java</category>
      <category>buildinpublic</category>
      <category>springboot</category>
    </item>
  </channel>
</rss>
