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

  • cwagner@lemmy.cwagner.me
    link
    fedilink
    arrow-up
    22
    ·
    edit-2
    11 months ago

    (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
      link
      fedilink
      arrow-up
      4
      arrow-down
      2
      ·
      11 months ago

      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
        link
        fedilink
        arrow-up
        10
        ·
        11 months 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.