Linux & Mac persistent storage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • iggy_hunter
    Apprentice
    • Sep 2021
    • 97

    Linux & Mac persistent storage

    I need persistent storage for "Angband OS" and I want it to be compatible with Windows, Linux and Mac OS. I have the Windows knowledge and recommendations myself ... but I need Linux and Mac experts to tell me what database recommendation they suggest.

    Please help if you are Linux and Mac experts and recommend to me what database services please.
  • Julian
    Adept
    • Apr 2021
    • 122

    #2
    Not an expert, but sqlite is installed by default on MacOS. I suspect it's available by default on most Linux distributions as well, but that's a much more complex question.

    Also, before you get into databases, consider the possibility that you can get what you need with files and directories, which is much easier to port between systems.

    Comment

    • tangar
      Veteran
      • Mar 2015
      • 1004

      #3
      Vanilla use simple files.. so put the data to DBMS will be big job.. and do you really need it?

      Most web uses MySQL. I use it too, not only for web, but also for my Rage of Mages 2 server ( https://tangar.info/en/rom2 ).

      But actually it's not a really big difference, which DBMS to use - PostgreSQL‎, MySQL or SQLite, they all good.. choosing one depends on the programming language/framework which you will use. Btw SQLite written in C (while MySQL in C++) which may ease hardcoding stuff into it (in case if you will go for it).
      https://tangaria.com - Angband multiplayer variant
      tangaria.com/variants - Angband variants table
      tangar.info - my website ⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽⍽
      youtube.com/GameGlaz — streams in English ⍽ youtube.com/StreamGuild — streams in Russian

      Comment

      • iggy_hunter
        Apprentice
        • Sep 2021
        • 97

        #4
        Files and directories are awesome ... but from a webserver environment, they are considered to be off-limits for read-write access.

        Comment

        • iggy_hunter
          Apprentice
          • Sep 2021
          • 97

          #5
          Awesome for the input. SqlLite sounds like common at this point. DBMS is 10x easier than disk storage. As an Angband server hosting multiple users and simultaneous games, a database is the route to take. Love the input.

          Any objections to Sqlite?

          I do believe the Sqlite supports the Entity Framework too. That's a dead ringer for me.
          Last edited by iggy_hunter; August 9, 2022, 17:58.

          Comment

          • Julian
            Adept
            • Apr 2021
            • 122

            #6
            Originally posted by iggy_hunter
            Files and directories are awesome ... but from a webserver environment, they are considered to be off-limits for read-write access.
            Then SQLite’s probably no-go as well. It doesn’t have a server, and does everything through file i/o.

            Also, if you’re using any DB for saves, you’re going to need to rework the save code. Big binary blobs are going to make your DB files grow really, really quickly. (Maybe. It’s possible there’s some kind of support in MySQL or Postgres for storage of large blobs in the filesystem; I’m no expert.)

            Comment

            • iggy_hunter
              Apprentice
              • Sep 2021
              • 97

              #7
              Julian ... yes ... I see that Sqlite will need a file and file i/o. You beat me to that and I may have to reconsider. I'm already at the point where I have an IPersistentStorage class that is working to inject storage services ... so I should be able to test the Sqlite with IIS shortly.

              Also, I see the save games are about 3MB ... but I believe I may be able to trim that down in the future... but disk space is cheap and I'll worry about that later.

              The game also keeps high scores. Those are small. Settings at this point has been mangled and will most likely get reworked based on the clients and other things.

              Comment

              • AnonymousHero
                Veteran
                • Jun 2007
                • 1393

                #8
                If you need a shared database then I'd heartily recommend PostgreSQL. It's free and Free/Libre, it performs well, it's good at preserving data integrity (e.g. you can have data checksumming), etc. etc.

                I've been using it in various production systems for 20+ years at this point and no complaints whatsoever.

                EDIT: Btw, SQLite doesn't do multi-writer, so if you need that (which I'm guessing you do, because multiple concurrent play sessions), it's definite a no-go.

                Comment

                • iggy_hunter
                  Apprentice
                  • Sep 2021
                  • 97

                  #9
                  @AnonymousHero ... that was another nail in the Sqlite coffin ... locking the entire database for each write ... I've been using PostgreSql for some time too ... but I would like to hear from both Linux and Mac users that they would give a thumbs up to PostgreSql and/or MySql. Entity framework support will be a big plus for me.

                  Comment

                  • AnonymousHero
                    Veteran
                    • Jun 2007
                    • 1393

                    #10
                    Originally posted by iggy_hunter
                    @AnonymousHero ... that was another nail in the Sqlite coffin ... locking the entire database for each write ... I've been using PostgreSql for some time too ... but I would like to hear from both Linux and Mac users that they would give a thumbs up to PostgreSql and/or MySql. Entity framework support will be a big plus for me.
                    Can't speak for Mac users, but I'm using Linux exclusively, so that's a thumbs up from me

                    https://www.postgresql.org/download/macosx/ seems to indicate the MacOS is pretty well supported by the project.

                    Comment

                    • HugoVirtuoso
                      Veteran
                      • Jan 2012
                      • 1237

                      #11
                      Originally posted by AnonymousHero
                      Can't speak for Mac users, but I'm using Linux exclusively, so that's a thumbs up from me

                      https://www.postgresql.org/download/macosx/ seems to indicate the MacOS is pretty well supported by the project.
                      What is your primary Linux distro currently?
                      My best try at PosChengband 7.0.0's nightmare-mode on Angband.live:
                      https://www.youtube.com/watch?v=rwAR0WOphUA

                      If I'm offline I'm probably in the middle of maintaining Gentoo or something-Linux or other.

                      As of February 18th, 2022, my YouTube username is MidgardVirtuoso

                      Comment

                      • iggy_hunter
                        Apprentice
                        • Sep 2021
                        • 97

                        #12
                        JSON Persistence

                        Interesting note here ... I believe I'll be needing to convert the binary serialization currently being used into Json serialization (argh) ... because binary serialization is insecure and not supported in .Net 6. This will open a huge set of risks and potential bugs.

                        Comment

                        Working...
                        😀
                        😂
                        🥰
                        😘
                        🤢
                        😎
                        😞
                        😡
                        👍
                        👎