Mysql – GDPR compliant multitenant MYSQL DB

multi-tenantMySQL

I wonder what are the GDPR constraint on a MySQL DB for a multitenant SaaS application.
While a solution with a single DB per each multitenant customer and restricted access will probably be fine, what about a single DB?

How do I guarantee a proper insulation of data for single tenants?
Pure applicative solutions seems weak to me (…where tenantID=xx for each query).

Will I be forced to create restricted views on each table or for most queries?
How well will MySQL 6.7 handle this? I've read about indexing views and performance, I'm not sure what will happen to my application if I switch every table to a view.

Have new versions of MySQL improved? Should I use a db proxy like MaxScale?
Or maybe it's reason enough to switch to postgres or other db?

Best Answer

Regardless of how you solve the problem, you have to go through some sort of "router". And that may be the least secure part.

Separate computer for each customer -- you need to tell user which machine to go to.

Separate process or API or VM on same machine -- user must log into the appropriate path.

Separate databases (one per customer) on single MySQL server -- either API or MySQL could handle security.

Single database, but separate rows in the tables -- Now the API must take responsibility for security. That is, the user must not have direct access to MySQL, only indirect through an API layer.

Each has "privacy by design".