[Dbix-class] Multi-tennant application/data and dbix-class

Trevor Leffler tleffler at uw.edu
Thu Jan 11 17:43:58 GMT 2018


Hi Aaron,

I do something a little different in my multi-tenant application. Each customer gets a subdomain and their own database schema. The subdomain string is passed to my catalyst schema model, which maps it to the correct schema and performs a 'USE' prior to executing any queries.

I appreciate the separation of customer data and whatever safety that may afford me, restoration of customer data is cleaner for me, as is data deletion, and probably some other things I'm not thinking of at the moment. On the other hand, performing queries across all customer datasets becomes more challenging.

Best,

Trevor Leffler
Sr. Software Engineer and Scrum Master | University of Washington
Office of Educational Assessment
tleffler at uw.edu | 206.616.1479


-----Original Message-----
From: dbix-class-bounces at lists.scsys.co.uk [mailto:dbix-class-bounces at lists.scsys.co.uk] On Behalf Of Aaron Trevena
Sent: Wednesday, January 3, 2018 12:38 PM
To: DBIx::Class user and developer list <dbix-class at lists.scsys.co.uk>
Subject: [Dbix-class] Multi-tennant application/data and dbix-class

Hi All,

I was wondering if anyone can share any success, tips and problems of using dbix-class in a multi-tenant application.

I'm looking at using tenant id in the main tables, and thinking best approach will be to add logic to a resultset base class or role to hook in forcing queries to restrict by tenant id, but would really like to hear what anybody who's done this stuff already did and what worked or not and any gotchas,

Thanks,

A.

--
Aaron J Trevena, BSc Hons
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Consulting

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk



More information about the DBIx-Class mailing list