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. Feature Requests
  3. LAMP app version with multiple mysql databases without need for custom app

LAMP app version with multiple mysql databases without need for custom app

Scheduled Pinned Locked Moved Feature Requests
13 Posts 6 Posters 2.0k Views 6 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 girish

      @ccfu is it common for apps to want multiple databases? Can you tell us a bit more about your use case? In app store, only one app uses this feature - phabricator.

      humptydumptyH Offline
      humptydumptyH Offline
      humptydumpty
      wrote on last edited by
      #4

      @girish I have a PHP 5.6 app that installs on a subdomain and has its own database (B2B) and there's a second database for another part of the app that's geared for B2C. I haven't installed it on my Cloudron server yet because if I'm not mistaken, the current LAMP stack supports PHP 7.4 only so I'm still hosting that elsewhere but we're trying to get the app updated soon.

      1 Reply Last reply
      0
      • fbartelsF Offline
        fbartelsF Offline
        fbartels
        App Dev
        wrote on last edited by fbartels
        #5

        In both those cases you can most likely use another table prefix. While this is not really common for backend type of applications, the last time I looked into php based stuff it still was very common (owncloud/nextcloud uses oc_ for example).

        humptydumptyH C marcusquinnM 3 Replies Last reply
        2
        • fbartelsF fbartels

          In both those cases you can most likely use another table prefix. While this is not really common for backend type of applications, the last time I looked into php based stuff it still was very common (owncloud/nextcloud uses oc_ for example).

          humptydumptyH Offline
          humptydumptyH Offline
          humptydumpty
          wrote on last edited by
          #6

          @fbartels Thanks for the tip. I'll pass it along to the developer who will be updating my app.

          1 Reply Last reply
          0
          • fbartelsF fbartels

            In both those cases you can most likely use another table prefix. While this is not really common for backend type of applications, the last time I looked into php based stuff it still was very common (owncloud/nextcloud uses oc_ for example).

            C Offline
            C Offline
            ccfu
            wrote on last edited by
            #7

            @fbartels That is a good solution when it is desirable that the tables reside in the same database, but not always an option for data integrity and data security reasons.

            1 Reply Last reply
            0
            • fbartelsF fbartels

              In both those cases you can most likely use another table prefix. While this is not really common for backend type of applications, the last time I looked into php based stuff it still was very common (owncloud/nextcloud uses oc_ for example).

              marcusquinnM Offline
              marcusquinnM Offline
              marcusquinn
              wrote on last edited by
              #8

              @fbartels Agreed, table prefixes are conventional, and tools like phpMyAdmin have workflows that accommodate for them when importing/exporting.

              Only reason I could think to use separate DBs would be quite extreme security access separation or optimisation separation, doesn't sound like the case here tho.

              Web Design https://www.evergreen.je
              Development https://brandlight.org
              Life https://marcusquinn.com

              1 Reply Last reply
              0
              • nebulonN Offline
                nebulonN Offline
                nebulon
                Staff
                wrote on last edited by
                #9

                Also maybe performance considerations might be a reason to want to have distinct databases, but that would also not apply in the Cloudron case, given that the mysql server instance is anyways shared.

                C 1 Reply Last reply
                1
                • nebulonN nebulon

                  Also maybe performance considerations might be a reason to want to have distinct databases, but that would also not apply in the Cloudron case, given that the mysql server instance is anyways shared.

                  C Offline
                  C Offline
                  ccfu
                  wrote on last edited by
                  #10

                  @nebulon @marcusquinn
                  Optimisation indeed shouldn't really be an issue with Cloudron, but security considerations certainly apply in the case of a CRM (or indeed any situation where personal data is being stored and connected to other applications). Admittedly this is probably a minority requirement.

                  Can one app connect to the databse of another app? If so, the 'issue' can of course be resolved by having the second database in a separate LAMP app.

                  1 Reply Last reply
                  0
                  • nebulonN Offline
                    nebulonN Offline
                    nebulon
                    Staff
                    wrote on last edited by
                    #11

                    By default the databases provided from the shared mysql addon can only be accessed with the credentials issued to the app. Those credentials may change at any time during an update, so that makes it kinda inconvenient to put the credentials in other apps to "share" a database.

                    Also if both applications have connections to both databases, I am not sure how this helps in isolation much.

                    C 1 Reply Last reply
                    0
                    • nebulonN nebulon

                      By default the databases provided from the shared mysql addon can only be accessed with the credentials issued to the app. Those credentials may change at any time during an update, so that makes it kinda inconvenient to put the credentials in other apps to "share" a database.

                      Also if both applications have connections to both databases, I am not sure how this helps in isolation much.

                      C Offline
                      C Offline
                      ccfu
                      wrote on last edited by
                      #12

                      @nebulon
                      OK, thanks, I think I can work with this with a bit of a rethink. I guess I am used to hosting platforms with different architectures and shared mysql instances being separate from the applications.

                      A true isolation is of course not possible with a shared instance, though it depends a bit on the applications.

                      1 Reply Last reply
                      0
                      • girishG Offline
                        girishG Offline
                        girish
                        Staff
                        wrote on last edited by
                        #13

                        I think in theory we could isolate app containers to access only a specific db by restricting based on IP (which MySQL supports). MySQL already has an IP based rate limit for logins, this is why we haven't implemented it. Meaning, an app trying to guess another app's db credentials won't get very far.

                        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