snippetsqlMinor
Would it be sensible to create a MySQL user for each user account of a web application?
Viewed 0 times
eachcreateapplicationuseraccountsensiblewouldmysqlforweb
Problem
The thought occurred to me recently, but I have a suspicion the idea might be insane. A couple of benefits I'm perceiving are:
Obviously this would yield me a ridiculously long table of users, but any penalties of that aren't clear to me yet: the
- facilitate automated logging via triggers
- control mysql connections on a per-(web-application-)user level
Obviously this would yield me a ridiculously long table of users, but any penalties of that aren't clear to me yet: the
User table is properly indexed for O(Log(n)) single-user lookups.Solution
What type of logging would you be looking at gaining? What I do in my application is an audit table that tracks application user, application command, and result (among other things). This, along with another audit table that tracks individual table changes, provides all the logging we need per user.
You could also set up a connection pool in your application to control connections per application.
At first blush, I think trying to manage so many users is a burden that outweighs any possible benefits.
You could also set up a connection pool in your application to control connections per application.
At first blush, I think trying to manage so many users is a burden that outweighs any possible benefits.
Context
StackExchange Database Administrators Q#3345, answer score: 7
Revisions (0)
No revisions yet.