Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

multi-tenant Application,

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    multi-tenant Application,

    Hi,
    I have a multi-tenant application (one database with a company id field).
    It's getting complex to manage. I am thinking of switching to having a different database per company.
    is there any easy way?
    What do you think? is it better to have a different database for each company or keep it in 1 database?

    Thank you for any input
    Paul


    #2
    I have a couple of these types. I can't imagine doing it with separate databases to maintain -- I'd rather do it with one database. Tell us why you think multiple databases would simplify?
    -Steve
    sigpic

    Comment


      #3
      I have few issues, such as logging in, I can't have the same user name twice.
      The app has a mobile application (offline), so users need to enter a "company code", so I know which company to load the data.
      Checking for duplicates is tricky, I always have to include the company code.
      But the main issue is with users logging in, they need to have different username across companies.
      of course there are solutions but I was thinking about different databases...

      Comment


        #4
        I have done both. Each has its pluses and minuses. I have one component where the user logs in and then after you log in you can choose which company you want to see. Are you using the extended Users table in security?

        Comment


          #5
          I might have put too much effort into the project, but I used to use a landing page (www.comp1.com, www.comp2.com, www.comp3.com), and use that
          to set the various variables (database, logos, phone numbers) from that.
          Gregg
          https://paiza.io is a great site to test and share sql code

          Comment


            #6
            Separate databases can become unruly. If you fix/add something to your project it'll be hard to ensure it works across all, adds testing time, and more break points.
            I use email addresses for logins. It also makes password resets and 2fa convenient.

            I'd make a copy of the project and the database. Then hopefully you can run a sql query to update all of the original usernames from their email field. Give them the test site to ensure they can log in, and after you speak with your clients, give them 90 days before you switch.

            This is of course a 50,000 ft. comment, and Lee and Steve may have some great input to fixes as well.
            (Also, Lee is on it with using the Extended Users Table).

            Comment


              #7
              I did this a long time ago I was working on a multi-tenanted site that may have used unlimited entities. I made the Security ID a generated code (whatever way GUID etc.) the extended user table with a readable login ID PeteConway and the tenant ID is in the extended user table, Once security is summited, I used the Extended user table as the login: for a given entity - at this point the AA security system has no knowledge of what's happening. So I'm on the ACME landing page and I enter PeteConway then use a SQL view to see if I exist for the Entity ID of the landing page, If I do then ask for the password then call one of the web security functions using GUID as the user ID and see if the password is ok - if so yes - no exit.

              Hope that helps.
              Insanity: doing the same thing over and over again and expecting different results.
              Albert Einstein, (attributed)
              US (German-born) physicist (1879 - 1955)

              Comment


                #8
                In a couple different multitenant web apps I'm using multi databases. One database is my control or system admin DB. It contains Alpha's security tables and other tables/data that all tenants use. Then each tenant gets their own DB. I use Alpha's dynamic SQL connection method. It all works well together. I use stored procedures to sync-up the databases when ever I make a change to one of them.

                As for why I chose multi DB: Admittedly part of the reason is the challenge of it. After working through some kinks and figuring out a solid/easy way to update multi DB's it's really no different than a single DB. The other part is that it feels more secure. Each DB has their own unique encryption. Another reason is the occasional subpoena of data. Easier to follow through with that when the effected user has their own DB.
                Mike Brown - Contact Me
                Programmatic Technologies, LLC
                Programmatic-Technologies.com
                Independent Developer & Consultant​​

                Comment


                  #9
                  I note Mikes comment above with interest but I think it somewhat depends on how complex your DB will get.

                  We run a multi-tenanted platform deploying multiple functional modules (~10 complex modules and another 8 supporting modules) for multiple Groups, each with multiple Companies. Users are defined within and limited to a single Group of Companies. Users have company/module specific security roles and on login, their roles for a 'default' company are loaded. They can then switch to any other company they have access to within the group. All alpha components and lookup controls are filtered by groupid and companyid session variables. Although this sounds dramatic, we are primarily focused on servicing the needs of our own group of companies and so our active daily user list is relatively small (<50).

                  We run this on a single SQL Server database with over 4200 objects (tables, triggers, views, functions, stored procedures etc) and AA has about the same number of components. Given our rate of development and the granularity of the stored security data, I would not want to be synching changes across multiple databases. That being said, I am not sure how this approach will scale if our daily active user count increases substantially.

                  One advantage of the single database approach is that we have deployed modules in which, by design, companies in different Groups can share data across the normally fixed Group barrier e.g. companies in our industry often share R&D data and colloborate on research. This would be more complex to achieve in a multi-database solution.

                  But yes, multi-tenancy adds a layer of data and security filtering that is more complex and which you have to be super diligent about implementing on the AA side.
                  Last edited by ChristopherG; 01-27-2024, 12:21 AM.

                  Comment

                  Working...
                  X