[Ur] Multitenancy

Rob Manhatton rob.manhatton at gmail.com
Sun May 13 09:20:25 EDT 2018


I don't have any recommendation per say, but when github sells its public gh service, many users can buy accts at the same URL.  When that level of security/ privacy doesn't meet it's customer's needs, they are able to launch a seperate instance of their web app and even store their app server in their customer's data center.  

My philosophy is that because coding is confusing enough as ot is, when you can leverage multiple deployments rather tha multitenancy code, you wind up in a better place.  If you aren't able to codify your deployments (terraform, ansible, docker, etc.) then this approach may be more daunting.

On May 13, 2018 4:50:47 AM CDT, Simon Van Casteren <simon.van.casteren at gmail.com> wrote:
>Hi,
>
>I'm in the process of making a new application for music schools, using
>ur/web for front and backend. I'm at the point where I have two
>customers
>and am starting to implement support for multiple clients/tenants in
>one DB
>(postgres). I've been planning to implement multitenancy from the
>start,
>but haven't had the time yet.
>
>Has anyone implemented a form of multitenancy in ur/web before?
>
>I see two areas that need consideration.
>
>1. Deciding which user belongs to which tenant. Ideally I'd have a
>seperate
>url for each tenant that I can give out to my clients (=the schools),
>do
>some dns magic to send them all to the same exe, extract the tenantname
>from the url and save the tenantId in a cookie. Also ideally, the
>user's
>url would not change, ie. All urls should go to myschool.coolschools.be
>during a session, not getting redirected at all. This is all in an
>ideal
>situation of course.
>
>2. Database access: I'll have tenantId columns in all tables + foreign
>keys
>and indexes on these columns. I'm a bit afraid I'll forget adding
>tenantId
>= cookie.tenantid somewhere, so I was thinking I could make a function
>that
>takes a sql_exp and a tenantId and adds these clauses to all tables
>involved. Not 100% sure that will work but I think it's possible, I
>haven't
>had to dive into the internals of sql_exp yet. Secondly, I wonder if I
>can
>somehow declare my endpoints to be tenantdepandent (all but the most
>general will be) maybe via newtyping the transaction datatype and then
>allowing the execute only sql queries that have the above function
>applied.
>Just dreaming out loud here.
>
>I'd be very interested in any ideas or examples!
>
>Simon
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Ur mailing list
>Ur at impredicative.com
>http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20180513/d4913623/attachment.html>


More information about the Ur mailing list