» Best Practices for developing a multi-tenant application with Symfony2 and Doctrine2
Best Practices for developing a multi-tenant application with Symfony2 and Doctrine2
|September 24, 2011
Posted by forumadmin
I am working on an application that needs to support the multi-tenant model. I am using the symfony2 php framework and doctrine2.
I’m not sure the best way to go about architecting this requirement. Does Symfony’s ACL functionality provide a part of the solution?
What recommendations or ideas could you provide? Are there any sample symfony2 applications or open source applications that are available which have implemented this strategy?
My first thought is to use a tenant_id column in all the tables and have this relate to the account object in the application. I’m not sure though if ACL is supposed to take care of what i’m wanting to do, or if your still responsible for all of the queries against your objects so they don’t return un-authorized data.
If I wasn’t using Doctrine, it might be easy to say just append
Where tenant_id = @accountid to each query, but i’m not sure that is the right approach here.
More Related Questions
- Multitenant SAAS Application Development I have developed a java web application using java, spring webmvc and hibernate. right now it can be used by single organization. I want to convert it to multitenant SaaS application.
- Compare values in serialized column in Doctrine with Query Builder I'm building a FormType for a Symfony2 project but I need some Query Builder on the field since I need to compare some values with the one stored on DB and show the results. This is what I […]
- orm:generate-entities Fails With Namespace I have some YAML mapping files created like so:
- How to update entities through a relationship with Symfony? I have an article entity and a tag entity in my Symfony application. I have a nested form to edit and tag articles:
When I add a new tag from this form, Doctrine tries to insert a new […]
- Symfony2 CRUD Generate Error I got this error when generate CRUD :
The CRUD generator expects the entity object has a primary key field named "id" with a getId() method.
I cant find field that using id, I've check […]
- Storing serialized object with doctrine I got some problem with storing php serialized object with doctrine,
when I use the following code to store:
$item = new […]
- SonataAdminBundle with translatable fields (doctrine extensions) I'm having a table with all translations in a "ext_translations" table.
The translating works great. The problem is now: I want to manage those translations via sonata-admin bundle.
- Add columns in an existing databse through Doctrine Symfony framework To add a column in an existing db, I followed this documentation of Doctrine Migrations.
I successfully ran all the commands […]
- Accessing Elements In Doctrine Query Not Working I have a Doctrine query, where the "JOIN p.product pr" is joining in the Product Table and all of its info (id, name, qty, status, created, updated, deletedAt, etc...)
Custom function […]
- Doctrine2 sort by certain string value For example I have blog posts table with status of publication(new, moderation, archive).
How I can get entities where posts with status "moderation" will be in first place?
I know what […]