Hi Sacawulu,

I think what would really help you would be the upcoming multi-tenancy
catalogs feature. Unfortunately, it's not quite clear yet when or in which
version we might expect this to be implemented.
https://mariadb.org/projects/catalogs/

In the meantime, if you must have all the databases in the same MariaDB
instance, there are features such as the resource options on users:
https://mariadb.com/docs/server/reference/sql-statements/account-management-sql-statements/create-user#resource-limit-options

And there are also ways of limiting the size of temporary files/tables:
https://mariadb.com/docs/server/security/limiting-size-of-created-disk-temporary-files-and-tables/limiting-size-of-created-disk-temporary-files-and-tables-overview

Cheers
Karl


On Wed, 13 Aug 2025 at 10:50, sacawulu via discuss <
[email protected]> wrote:

> Hi,
>
> I am planning to setup a (three-node) galera cluster, holding three
> different databases for three different mysql client servers.
>
> I am isolating the three databases with users like db1-user@client1 /
> db2-user@client2 / db3-user@client3 and created grants accordingly.
>
> Additionally we want to prevent any DB from filling up the datadir, so I
> created three lvm volumes db1/db2/db3 and mounted them under the
> datadir. (correct permissions, selinux, etc, etc)
>
> Now, here is what AI (perplexity.ai) tells me abut doing this:
>
> > Manually creating a directory (e.g. with mkdir) directly under the
> MariaDB data directory is unsupported and can lead to inconsistencies or
> MariaDB not recognizing the database properly.
> >
> > MariaDB includes tooling like mariadb-install-db to initialize the data
> directory and its system tables correctly, which is part of setting up the
> database environment safely.
>
> However, as I've also tried all of this: it seems to work fine so far.
> As far as I can tell, the only difference is the absence of db.opt in
> the lvm-mounted db directories.
>
> This is how I've now created the mounts to be:
>
> > /dev/mapper/mysql-tmp            458M   30M  428M   7% /var/lib/mysqltmp
> > /dev/mapper/mysql-mysql          458M  161M  297M  36% /var/lib/mysql
> > /dev/mapper/mysql-db1            458M   30M  428M   7% /var/lib/mysql/db1
> > /dev/mapper/mysql-db2            458M   30M  428M   7% /var/lib/mysql/db2
> > /dev/mapper/mysql-db3            458M   30M  428M   7% /var/lib/mysql/db3
>
> Some questions I have:
>
> Is mounting separate LVM volumes at individual database directories
> under the MariaDB data directory a good or safe practice, or should I
> avoid this to maintain compatibility with MariaDB tools and consistency?
>
> What other or additional methods can help minimize the impact of a
> problematic database or user from affecting the others?
>
> Are there other best practices I should consider in this Galera cluster
> setup?
>
> Background: I have three client nodes, each primarily using one Galera
> node, with failover to the others via HAProxy. This setup has worked
> well so far.
>
> I'm interested in your feedback and recommendations.
>
> Thanks!
> _______________________________________________
> discuss mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>
_______________________________________________
discuss mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to