Search code examples
databasespringsecurityspring-securityembedded-database

Can I use an embedded database to store accounts?


We are working on java game application and want to add an account login system to it. Our plan was to set up a web server (Spring) and a database (postresql), and handle login requests from the app by the web server. I saw spring has support for an embedded database, and was wondering if I could use that to store users instead of having them on a database server.

From what I read, you should try to have a database containing (salted and hashed) passwords closed off from the outer world. So my question is should I use an embedded database for this?


Solution

  • The Spring framework allow you to use embedded database (for example H2) but the main idea for that is to test your application in development environment where you have limited resources to install fully qualified DB. And if you'll store some data in your app embedded DB in production, you should remember that if you will restart your app, you can loss all of your data. Best practice is to set up independent database with backups and replications if your data is critical.