this post was submitted on 10 Oct 2023
9 points (64.5% liked)

Programming

17424 readers
27 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
 

Why do so many programs use rational databases instead of loading the data during startup and keeping it in memory? Especially for smaller datasets I would think, that a database adds unnecessary complexity and overhead. Also, a lot of data can be saved using modern RAM and when using an in-memory approach, optimized data structures can be utilised to further improve the performance

you are viewing a single comment's thread
view the rest of the comments
[–] cwagner@lemmy.cwagner.me 22 points 1 year ago* (last edited 1 year ago) (2 children)

(Relational) Databases can be in-memory. And unless you have very little data, your in-memory storage will probably turn into a database, and if it’s relational it might even turn into a pseudo-relational one. Just without all the benefits of 1000 of dev-hours of optimization. But next, you also need to persist your data. And you probably don’t want to lose everything if your app crashes. More stuff that is already done for you, if you use a non-memory database that probably will hold all frequently accessed data in memory anyway. And there are many, many more issues like that.

edited to be friendlier, original was

Relational Databases can be in-memory? This question sounds a bit like you have little to no experience with data or databases.

[–] cschreib@programming.dev 2 points 1 year ago (1 children)

Why would their experience be relevant? They're asking a question, so obviously they have things to learn. You could be nicer about it.

[–] cwagner@lemmy.cwagner.me 10 points 1 year ago

Why would their experience be relevant?

Partially, because experience in an area means one can understand the answer, but to a probably bigger part see below.

You could be nicer about it.

It read to me like they asked as if they know better than everyone else, and were ranting about others doing it wrong. But that was actually an assumption on my part, and may simply be their style, or even me completely misreading things. So thanks for calling me out on it.