A Ruby on Rails gem for adding multi-tenancy with Devise integration, using row-based data separation.
Milia is a Ruby on Rails gem that adds multi-tenancy support to applications, allowing a single Rails app to serve multiple organizations (tenants) with securely isolated data. It solves the problem of building SaaS platforms by integrating with Devise for authentication and enforcing row-based data separation in the database. Developers use it to create applications where each tenant's users can only access their own organization's data.
Rails developers building multi-tenant SaaS applications, particularly those using Devise for authentication and needing a structured, secure way to isolate tenant data. It's suited for teams creating B2B platforms where each client organization requires separate data silos.
Developers choose Milia because it provides a battle-tested, Devise-integrated multi-tenancy solution that minimizes boilerplate and enforces security by default. Its row-based approach avoids the complexity of schema-based tenancy, and its transparent scoping keeps application code clean and focused.
Easy multi-tenanting for Rails5 (or Rails4) + Devise
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works out-of-the-box with Devise for user authentication and registration, reducing setup time for Rails+Devise apps as highlighted in the README's setup guides.
Stores all tenant data in a single database with row-level isolation, avoiding the complexity of schema-based approaches while maintaining data separation, which the README argues is a 'good reason' for this design.
Uses Rails default_scope to enforce tenant boundaries and raises exceptions on illegal access attempts, preventing cross-tenant data leaks without manual coding.
Supports custom sign-up processes, EULA acceptance, and member invitations, allowing SaaS platforms to tailor tenant onboarding as per the README's features list.
Tightly coupled with Devise; using alternative authentication systems requires significant customization or workarounds, limiting flexibility for non-Devise projects.
Adding Milia to an existing Rails app is non-trivial, requiring careful grafting and manual steps as advised in the README's 'Add milia to an existing application' section.
Relies on default_scope for tenant scoping, which can interfere with other model scopes and poses risks if unscoped accidentally, as warned in the Security/Caution section.
The project has slower development pace and fewer community resources compared to alternatives, with README branches still supporting older Rails versions like 4.2.x.