Alpha DevCon 2018
Results 1 to 7 of 7

Thread: How to bulid multi Tenant application

  1. #1
    Member
    Real Name
    Chinedu Duru
    Join Date
    Aug 2014
    Posts
    180

    Post How to bulid multi Tenant application

    Hi everyone!

    How can i develop a multi- Tenancy application that can be hosted on cloud so that my Tenants like companies when i sign up for them the will have there page with their log displayed for them only, whatever they do will be filtered, the can register there only admin staffs on it as well. can i acheive this with a single TabbedUI page and also with the web-security-tables created by alpha?

    Thanks

    Edu

  2. #2
    "Certified" Alphaholic mikeallenbrown's Avatar
    Real Name
    Mike Brown
    Join Date
    Nov 2009
    Location
    United States
    Posts
    1,608

    Default Re: How to bulid multi Tenant application

    Your questions are quite broad. Yes, I'm sure you could create this type of app using a TabbedUI. As for filtering when a user logs in you could set a session variable (client id perhaps) and use the variable anywhere you need filtering.
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

  3. #3
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    1,946

    Default Re: How to bulid multi Tenant application

    Yes, it is possible and that is exactly what I do. I basically filter my "tenants" by company_id and then permissions by usergroup. If you are just starting out I would suggest that you first get a simple table to filter by company_id in other words start off with a table with 2 records in it, one for each unique company_id.
    Then a login component, so you can login with each user and ONLY see the records that should be there for each unique company_id.

    I have a table called users and besides the usual login (email) first name, last name, etc I have another hidden field called company_id that belongs to every user who belongs to that company.
    Every user belongs to a group. IN my case it is Owner, Secretary, Technician and Customer. btw, I have other user groups such as "newuser" as well as EXPIRED levels.
    The expired levels are important for recognizing paid and unpaid accounts.

    As mike said your asking a ALOT more than you know! It is however doable - I am doing it.
    NWCOPRO Nuisance Wildlife Control Software-My Application: http://www.nwcopro.com "I am not discouraged, because every wrong attempt discarded is another step forward."

  4. #4
    Member
    Real Name
    Chinedu Duru
    Join Date
    Aug 2014
    Posts
    180

    Default Re: How to bulid multi Tenant application

    Quote Originally Posted by CharlesParker View Post
    Yes, it is possible and that is exactly what I do. I basically filter my "tenants" by company_id and then permissions by usergroup. If you are just starting out I would suggest that you first get a simple table to filter by company_id in other words start off with a table with 2 records in it, one for each unique company_id.
    Then a login component, so you can login with each user and ONLY see the records that should be there for each unique company_id.

    I have a table called users and besides the usual login (email) first name, last name, etc I have another hidden field called company_id that belongs to every user who belongs to that company.
    Every user belongs to a group. IN my case it is Owner, Secretary, Technician and Customer. btw, I have other user groups such as "newuser" as well as EXPIRED levels.
    The expired levels are important for recognizing paid and unpaid accounts.

    As mike said your asking a ALOT more than you know! It is however doable - I am doing it.
    Thank you Charles. Can i have the logo dislpyed on logon for each Tenant? Note; I want each tenant to have their own Admin page and they can register there customers and there customers can login an view there profile and records on the application. The expired level is not clear to me.

    If you have clue of this share with me please.

    Kind regards
    Last edited by eduduru; 04-05-2016 at 04:25 AM.

  5. #5
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    1,946

    Default Re: How to bulid multi Tenant application

    Yes you can, but you have a lot to learn and build first! A good database structure to include the tenant_id and user_id during data entry is a must if you plan on separating the records by tenant. I display the individual company logo on lets say invoices for each tenant - I use a session variable to get the information from a table called company defaults where each "tenant" stores their unique defaults that I can call in other areas when needed.
    I can help you a little here and there - but speaking from my own experience you will HAVE to learn this on your own - otherwise you will never get anywhere!

    The absolute BEST advice I can give you is to start with small goals and work your way up into your application. My first goal was to create a simple login where I could just log in, create a record - edit it, save and delete.

    Then I said ok, let me create two logins and filter the records by tenant_id

    For me grids were easiest to learn, then the UX and finally the list control - which after you start learning some xbasic you soon realize just how little you really know!
    Like I said - start small and work your way into it. Read everything you can on the design phase of your database, and understand that asking the right questions will get you the right answers - asking overly broad questions will result in either NO answer or more questions...

    It is not an easy thing to learn to ask the right questions when you first start off - even searching the forums for the right stuff can be a challenge. Do yourself a favor and ask yourself - no write it down - EXACTLY what you want to know first.

    For example, your question "can I have the logo displayed on logon for each tenant?" The answer is "Yes" however that gets you nowhere in getting it done. Your real question is how do I display an image based on the tenant_id - which only leads to more questions...is this a grid? is this a UX, is this a list control...and so on.
    For some questions, you may need to tell people, the device your using, the browser displaying the info, the build your on, etc.


    As far as the expired level - I just created an additional usergroup called expired, so that my users can always login and download their information however expired users cannot "Insert" or "Update" records. My users pay a monthly fee, if they do not they can still log in and view their records, an expired technician cannot login at all.

    So as you can see, there is a lot to learn and like I said - start small. NEVER GIVE UP! I can assure you I am NOT a genius and if you look at my profile, it has taken me years to get where I am - mostly because I am fairly thick headed. I cursed everyone within earshot, called myself stupid and swore it was impossible many nights - in a row. If I had a nickel for every time I told myself I was too stupid to do this - I would admittedly be making money in a weird way, but I would be rich!

    Good luck, sorry so long winded!
    NWCOPRO Nuisance Wildlife Control Software-My Application: http://www.nwcopro.com "I am not discouraged, because every wrong attempt discarded is another step forward."

  6. #6
    Member
    Real Name
    Chinedu Duru
    Join Date
    Aug 2014
    Posts
    180

    Default Re: How to bulid multi Tenant application

    Yes you are right. but how can I build something like that with alpha? that is my question.

    Thank you.

  7. #7
    "Certified" Alphaholic DaveM's Avatar
    Real Name
    Dave Mason
    Join Date
    Jul 2000
    Location
    Hudson, FL
    Posts
    5,930

    Default Re: How to bulid multi Tenant application

    Charles gave a pretty good idea of what it takes and it is basically the same regardless of what tool, language or container used.
    Dave Mason
    dave@aldaweb.com

    Skype is dave.mason46

Similar Threads

  1. Develop Messaging System for Multi-Tenant Application
    By DoronF in forum General Questions
    Replies: 4
    Last Post: 01-01-2016, 04:51 PM
  2. Replies: 5
    Last Post: 05-29-2014, 05:55 PM
  3. Software as a Service (Saas) and Multi-tenant Architecture
    By ssmoore1 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 39
    Last Post: 05-07-2013, 01:12 PM
  4. Multi-user, multi company one server web application
    By qfactor in forum Application Server Version 10 - Web/Browser Applications
    Replies: 16
    Last Post: 06-18-2012, 06:53 AM
  5. Multi-tenant Web app
    By blancolandau in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 12-20-2010, 09:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •