I want to migrate my Nextcloud instance from MariaDB over to PostgreSQL. I already have a PostgreSQL service running for Lemmy. And I’m pretty starved for RAM.

Would it be better to just have one PostgreSQL service running that serves both Nextcloud and Lemmy? Or should every service have its own PostgreSQL instance?

I’m pretty new to PostgreSQL. But in my mind I would tend towards one service to serve them all and let it figure out by itself how to split resources between everything. Especially when I think that in the long run I will probably migrate more services over to PostgreSQL (and upgrade the RAM).

But maybe I am overlooking something.

Edit: Thanks guys, I’ve settled for a single instance for now. And after a little tuning everything seems to be running better than ever, with room to spare.

  • atzanteol
    link
    fedilink
    English
    arrow-up
    8
    ·
    10 months ago

    There are pros and cons to each…

    There’s the question of isolation. One shared service going down brings down multiple applications. But it can be more resource efficient to have a single DB running. If you’re doing database maintenance it can also be easier to have one instance to tweak. But if you break something it impacts more things…

    Generally speaking I lean towards one db per application. Often in separate containers. Isolation is more important for what I want.

    I don’t think anyone would say you’re wrong for using a single shared instance though. It’s a more “traditional” way of treating databases actually (from when hardware was more expensive).