Playnite Forums
Database backend choice - Printable Version

+- Playnite Forums (https://playnite.link/forum)
+-- Forum: Playnite (https://playnite.link/forum/forum-1.html)
+--- Forum: General (https://playnite.link/forum/forum-2.html)
+--- Thread: Database backend choice (/thread-851.html)



Database backend choice - Xuiwert - 10-18-2021

Hi,

Great to see the new version out, I am fiddling around with it now.  I would like to check the reasoning behind using LiteDB as the backend though.  I know it may be easier to work with being a native C# app, however SQLite has been around for quite a long time and is well supported including having powerful browsers (DB Browser, SQLite studio) and it can have triggers and such like so you can hook in backup of actions and such like.  I am really missing all this functionality.  I see LiteDB has a basic browser, but its missing loads of functionality.  Is it possible to switch in/out backend DB's?
Edit, I note that LiteDB does not work with these db files either, is it possible to access them with any tool?


RE: Database backend choice - Crow - 10-18-2021

Mainly because I've had good experience with it from other projects. We don't really use or need any database features, Playnite just needs it for permanent storage, the database is completely loaded in memory while the app is running and we only use DB backend to store changes. SQLite would not be any advantage to us (it was actually slower in write benchmarks I was doing when deciding what DB to choose, and read speed were about the same).

The reason you can't open Playnite files in those tools is most likely because we don't use latest LiteDB version. Also, you shouldn't be reading/modifying these files in the first place, if you need to work with library data, use Playnite's SDK.

There also isn't any way to switch db backends and I don't plan to add it.


RE: Database backend choice - Xuiwert - 10-18-2021

Thanks for the response. Its a pity, I utilise the metadata for other tasks - such as ensuring database metadata matches what is on the drives, possibly to include Has checks on files in future. Also, there doesn't appear to be a way of exporting the data (an issue I had when using collectorz database, hence why I pretty much against closed databases, try rebuilding several years work). Also ther eis no audit trail within the db, so changes made etc. these could very easily be added to SQLite with hook scripts to just add to anotehr databse file. My idea was that playnite would be more of a frontend to a database setup rather than be sole system as we know, nothing lasts forever so need to think about how to move data onto the next platform.


RE: Database backend choice - Crow - 10-18-2021

"playnite would be more of a frontend to a database setup"

That's not what I'm building, sorry. You could definitely write an extensions for all those things you mention, even tracking and logging changes, but I'm guessing you want to have that done for your by DB engine.