Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
"Is there any best practice that prefers databases over files" ?
> all of them
> why would you store datas in files???
Only "env" file should contain important datas, but these datas are precisely there for a website's secret key or some key for google maps
If anyone has access to your server by a way or another and reaches your files, you can kiss them goodbye -
devNaut1627ySome private and public keys and some spare configuration info are more suitable for plain files ..but user credentials, token, sessions, i'm not sure......
-
devNaut1627y@Drillan767 is't that the same for a db? If I gain access to the backend I can probably see the db too 😅
Or db credentials more than the db itself -
It really depends on the app. Sometimes I use files as a quick and dirty database, either by json or just serialized data. If I care about data resilience, and tracking changes, with multiple requests using the same data, I'll use a proper database.
-
stop68047y- serverbased databases : multiple client or concurrent connections
- sqlite : local stuff, multiple rows persistent format, binary data
- files : all other
Related Rants
For persistence, either credentials or data, is there any best practice that prefer DATABASES over FILES? Files such as JSON or txt or whatever...
Do dbs offer better perfomance or security?💾
question
database
persistence
security