Bhety P.’s Post

Scaling to Multi-Tenancy: Logic vs. Automation? Question to Senior Devs.🏗️ I’m currently refactoring a Live Selling management platform from a single-tenant model to a "One User, One Store" multi-tenant architecture. (This will not go to production it is a learning project in Java) I’ve decided on a Shared Database / Shared Schema approach using store_id discriminator columns across all business entities (Orders, Items, Customers etc). I’d love to hear from the architects and senior devs in my network: How are you building your "Logical Walls" in production?  1️⃣ The Manual Approach: Do you trust your team (and yourself) to never forget WHERE store_id = ? in every repository   2️⃣ The Automated Filter: Are you using Hibernate’s @TenantId, global @Filter definitions, or AOP/Interceptors to inject the ID automatically?   3️⃣ Identity Propagation: Are you extracting the Tenant ID strictly from JWT claims, or are you using a custom X-Store-ID header? None of the above... Any suggestion is welcome. I will try it on my end. Looking forward to your war stories and best practices! 🚀 #Java #SpringBoot #SoftwareArchitecture #MultiTenancy #SaaS #BackendEngineering #SpringSecurity

To view or add a comment, sign in

Explore content categories