Forum Stats

  • 3,757,058 Users
  • 2,251,192 Discussions


Multiple Schema vs One in Apex

1033559 Member Posts: 123
edited Jan 20, 2016 9:34PM in APEX Discussions

Is it possible to create an application attached to different schema? Each client would have their own schema but we would use the same application (i.e. not a copy of the application for each schema). We are considering using an identifier for each client within the same schema , and each client would have multiple users and potentially different access levels for different users. This obviously adds another layer of requirements for data security between clients. We are exploring if the multiple schema , same application approach is even possible or is there is another way this can be done ?

If so what are the pros and cons of each approach ? We are looking for the simplest way to create and maintain this over time.

Thank you.



  • Mike Kutz
    Mike Kutz Member Posts: 5,623 Silver Crown
    edited Jan 20, 2016 11:48AM

    one app

    one schema

    one column in each table to identify "this row of data belongs to that Company/user/whatever".

    one VPD policy to rule them all  (I believe VPD is an EE feature)


  • 1033559
    1033559 Member Posts: 123
    edited Jan 20, 2016 12:13PM

    Great. Thank you. That seems to be the most straightforward method.

  • Roadling
    Roadling Member Posts: 294
    edited Jan 20, 2016 9:34PM

    Without knowing your business or data model it is hard to say if it would be a good idea to co-mingle client data or not.

    @Mike Kutz's suggestion to go VPD is certainly the way to go if you decide to co-mingle data.

    If you want to keep data in separate you could introduce an substitution to use similar to the #OWNER# tag that is natively in APEX.   This could be set at login as part of your authentication routine and allow you to keep customer data separate.

    Both have pro's and con's so it really boils down to what your customers will tolerate.



This discussion has been closed.