Context: A Java client-side application needs to access a server-side MySQL database.
Need: Limit the possible number of requests to the database for each client (based on the client’s IP).
Question 1: Is it possible to do this just by changing the MySQL database settings?
Question 2: Is it a good idea to allow access to the database directly from the client-side application? Or should I rather make the client-side app communicate with a server-side app by TCP ? (and thus only allowing access to the DB by the server-side app)
About Question 2.
I think it depends on the sensitivity of the data, the network connection between the server and the client, and the rollout schema of the clients.
I’d personally go for an intermediate server, as it is way simpler to maintain and optimize. There are good solutions in both Python and Java which allow you to quickly create SOAP/XML servers with database access. You can then define XML messages based on what’s needed in a certain screen, with appropriate locks, and no regard (ehm) for the database schema. It decouples the database model from the MVC model in the client and allows the client to be relatively clean.