The is no "best database". The selection of a database will depend on what you want to use it for. How much data it needs to hold. How fast do you want to update and/or query it. What kind of data, a times series log or some complex relational thing or what? What kind of queries do you want to make.
For relational data I would stick with the tried and trusted MySql or SqlLite.
I don't like messing with SQL much so for lesser structured data I like RethinkDB
https://rethinkdb.com/blog/temperature- ... ide-of-pi/
But that's just me.
I would not keep a database on a Pi's SD card. Better to a lot of reading and writing to a USB hard drive or flash stick.
If you are dealing with users, usernames, passwords then I would consider having letting a service like stormpath.com handle the login, logout, signup, stuff and take care of keeping passwords securely. Assuming your Pi will have net access when in use.
Slava Ukrayini.