Well you've read it the wrong way. It highly depends on the use-case. If you have to store a lot of stuff and talk to the database frequently it of course makes sense to use an existing library, but one should keep in mind that by doing so, one gives the application direct access to the database, which might get exploited. To kind of prevent that one could proxy everything over a PHP script or similar, thus only the server-sided script has direct access to the database and the application has a link to the script and you can make security checks on both ends. So if you use the server just to update some online highscore the later version seems to me more secure and thus I'd use it in that situation.