Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-5248

Allow MULTI_TENANT to use any PK column

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Phoenix's multi-tenancy support is incredibly useful, because it allows systems to give users connections that transparently filter a multi-tenant environment to return only their data. However, it's only supported for the leading column of the PK and has to be manually enabled per-table.

      One common use case I've encountered is a multi-tenant table whose keyspace is fully covered by disjoint views, with the views all filtering on enumerations of the same PK column – let's call it ViewId. The most natural way to represent that is by a PK of <ViewId, TenantId, ...> which would allow fast lookups by tenant connections AND fast cross-tenant queries by admin processes. However, multi-tenancy requires the key be <TenantId, ViewId> which is only fast for the tenant connections, not global processes. It would be great if I could set a property on the table, MULTI_TENANT_COLUMN = "TenantId", and column was used for auto-filtering instead.

      Attachments

        Issue Links

          Activity

            People

              gjacoby Geoffrey Jacoby
              gjacoby Geoffrey Jacoby
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: