Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Directus
  3. Multiple projects / multi-tenancy

Multiple projects / multi-tenancy

Scheduled Pinned Locked Moved Directus
8 Posts 2 Posters 2.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • girishG Do not disturb
      girishG Do not disturb
      girish
      Staff
      wrote on last edited by
      #1

      Got a support ticket asking how to create multiple projects on Directus - https://docs.directus.io/guides/projects.html . Investigating this, I found that the Directus app will require access to separate databases for each project you want to create. The current Cloudron package only has access to a single database but the package can be modified to support multiple databases.

      Is this something generally considered useful? If so, I can make the changes.

      1 Reply Last reply
      0
      • girishG Do not disturb
        girishG Do not disturb
        girish
        Staff
        wrote on last edited by
        #2

        Wanted to mention that this will be a breaking change. Meaning, I have to create a new app pretty much since there is no easy way to migrate from a single database to multiple database package at this point. Most likely, users have to do some mysql based migration.

        1 Reply Last reply
        0
        • robiR Offline
          robiR Offline
          robi
          wrote on last edited by
          #3

          this is pretty odd design; and wording.

          the docs cite multitenancy, fine, but entirely new DB is not it. It's just a new set of DB credentials and namespace, ie isolation (per tenant) in the same DB or separate DBs.

          it doesn't make sense to have it single use only.

          you can keep two versions, single and multitenant ;-/

          since it's a fairly new app, it's a good time to 'fix' it too.

          Conscious tech

          girishG 1 Reply Last reply
          2
          • robiR robi

            this is pretty odd design; and wording.

            the docs cite multitenancy, fine, but entirely new DB is not it. It's just a new set of DB credentials and namespace, ie isolation (per tenant) in the same DB or separate DBs.

            it doesn't make sense to have it single use only.

            you can keep two versions, single and multitenant ;-/

            since it's a fairly new app, it's a good time to 'fix' it too.

            girishG Do not disturb
            girishG Do not disturb
            girish
            Staff
            wrote on last edited by
            #4

            @robi right. I initially thought it was something like WP multi-site and you can give it some table prefix per project, but it doesn't work like that. It really wants a separate database.

            Agree with you that since it's a fairly new app, we can fix this. But I am not sure what the common case is. Given that their docs have put this straight up, I am inclined to fix it. It's a pretty minor fix.

            1 Reply Last reply
            1
            • girishG Do not disturb
              girishG Do not disturb
              girish
              Staff
              wrote on last edited by
              #5

              I have to take that back. I am not sure again anymore. It seems the users between projects are totally separate. I thought it was the same because I created them with the same username/password, so I thought there was some sort of shared user management going on, but there isn't. So, it's back to I think it's best not to support multi-tenancy.

              I implemented the change itself - https://git.cloudron.io/cloudron/directus-app/-/commit/309a56c72021f82312fc66bb94101c6692ec0b96#691718f47a3089a202609bee65b689fdc9e57855 . But i won't make a new package.

              1 Reply Last reply
              0
              • robiR Offline
                robiR Offline
                robi
                wrote on last edited by
                #6

                Isn't it just a finer grain isolation?

                Technically the same user can have multiple projects via the same username & pw if the project name is different and the DB instance takes that into account for the same user.

                Does it?

                Conscious tech

                girishG 1 Reply Last reply
                0
                • robiR robi

                  Isn't it just a finer grain isolation?

                  Technically the same user can have multiple projects via the same username & pw if the project name is different and the DB instance takes that into account for the same user.

                  Does it?

                  girishG Do not disturb
                  girishG Do not disturb
                  girish
                  Staff
                  wrote on last edited by
                  #7

                  @robi Each project (and thus each database) has it's own "system" tables with the prefix directus_. There is a directus_users table in each project/database. This means that there really are two separate users. If you change password in one, the other does not change.

                  1 Reply Last reply
                  0
                  • robiR Offline
                    robiR Offline
                    robi
                    wrote on last edited by
                    #8

                    so we could request upstream that they allow for customizing the table prefixes to make this less rigid.

                    Conscious tech

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search