Skip to content

Sunshine: use sqlite db for persistent data #87

Open

Description

@ReenigneArcher

Is there an existing issue for this item?

  • I have searched the existing issues

Repositories

LizardByte/Sunshine

Languages/Skills/Technologies

C++, SQL

Description

I believe it's a better practice to store data in a proper database instead of random json files.

Pros

  • All data in one location
  • Apps can have an actual ID (auto incrementing)
  • No more boost json
  • Can use db fixtures for unit testing different scenarios
  • Can use proper migrations when the db structure changes, storing the db version in migration table... with up and down migrations. For down migrations Sunshine could download the downgrade SQL file from the git repo since it wouldn't be available in the previous versions of Sunshine.

Cons

  • All data in one location
  • SQL

Estimated Effort

effort:Large

Priority

priority:Medium

Target Milestone

6+ months

Dependencies

No response

Activity

  1. jorys-paulin commented on Aug 11, 2026

    @jorys-paulin

    Honestly for a project like Sunshine I don't think you need to bother. SQL is very powerful, especially at scale, but it also comes with a lot of overhead. Just making all the data structures fit in columns can be additional work, like prep commands would need their own table in addition to the applications table, and of course a third table to link the other two.
    I think you can still get away with regular config/data files, that's what most of the self-hosted apps I know use as well. You can use version fields for breaking changes if need be, and for testing you can have "golden" files for reference.
    It is a shame that not everything is stored in the one file, but I feel like it's too late to change this now, the opportunity for it was about five years ago now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions