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
  • Brite
  • 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

Offical apps | Community apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Feature Requests
  3. PostgreSQL addon: optional logical replication for apps that need it

PostgreSQL addon: optional logical replication for apps that need it

Scheduled Pinned Locked Moved Feature Requests
postgresqlreplicationwgeraddons
6 Posts 4 Posters 72 Views 4 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.
  • L
    L
    LoudLemur
    wrote last edited by
    #1

    Some apps now need PostgreSQL logical replication. The one I've hit is wger: since version 2.0, its mobile app requires PowerSync, which reads changes from the wger database through a logical replication slot. PowerSync, ElectricSQL, Supabase Realtime, Zero and Debezium all work this way.

    The addon currently can't support this. The server runs with wal_level=replica, and app roles don't have the REPLICATION attribute. Neither can be changed from inside a package, so the only option is to bundle a separate PostgreSQL in the app and give up the addon's managed backups and upgrades.

    Would you consider an opt-in addon option, something like "postgresql": { "logicalReplication": true }? It would need to:

    • run the server with wal_level=logical (the only cost to other apps is somewhat more write-ahead log (WAL) volume)
    • grant REPLICATION to the role of each app that asks for it
    • set max_slot_wal_keep_size, so an abandoned slot can't fill the shared disk
    • drop the app's replication slots on uninstall and before a restore

    With that, packages like wger could stay on the addon instead of each shipping its own database.

    1 Reply Last reply
    2
    • girishG
      girishG
      girish
      Staff
      wrote last edited by
      #2

      @loudlemur I will have to read up on this, to see what this is

      jdaviescoatesJ 1 Reply Last reply
      1
      • girishG girish

        @loudlemur I will have to read up on this, to see what this is

        jdaviescoatesJ
        jdaviescoatesJ
        jdaviescoates
        wrote last edited by
        #3

        @girish see also:

        @roliG said:

        FYI, it seems postgres 19 won't need the explicit "wal_level = replica", as it will automatically set it if there's a replication

        I use Cloudron with Gandi & Hetzner

        1 Reply Last reply
        1
        • girishG
          girishG
          girish
          Staff
          wrote last edited by
          #4

          Oh thanks for that @jdaviescoates , i had missed that note from @rolig . So, we will roll out postgres 18 next week as part of 10.1. I guess we might just wait it out instead of adding this feature flag.

          jdaviescoatesJ 1 Reply Last reply
          0
          • girishG girish

            Oh thanks for that @jdaviescoates , i had missed that note from @rolig . So, we will roll out postgres 18 next week as part of 10.1. I guess we might just wait it out instead of adding this feature flag.

            jdaviescoatesJ
            jdaviescoatesJ
            jdaviescoates
            wrote last edited by
            #5

            @girish said:

            postgres 18

            I presume you noticed, but, 18 is not 19 🙂

            I use Cloudron with Gandi & Hetzner

            R 1 Reply Last reply
            1
            • jdaviescoatesJ jdaviescoates

              @girish said:

              postgres 18

              I presume you noticed, but, 18 is not 19 🙂

              R
              R
              roliG
              App Maintainer
              wrote last edited by
              #6

              I presume you noticed, but, 18 is not 19 🙂

              that's sadly true. 19 will be released... soon this autumn (also, I haven't tested that change yet, only have that from the docs)

              1 Reply Last reply
              1

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              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