[Feature]: Consider adding SQLite support #240

Closed
opened 2026-02-04 18:57:25 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @oddlama on GitHub (Sep 2, 2022).

Feature detail

I'd like to propose adding SQLite support to Immich. Especially for this use-case, SQLite should be close to the ideal database as opposed to more heavyweight databases like Postgresql and Mysql, at least for personal non-distributed deployments. Refer to this HN thread and the linked article for a more profound explanation of why it is probably easier and faster for "small-scale" (<100TB) databases.

And thank you for this awesome app!

Platform

Server

Originally created by @oddlama on GitHub (Sep 2, 2022). ### Feature detail I'd like to propose adding SQLite support to Immich. Especially for this use-case, SQLite should be close to the ideal database as opposed to more heavyweight databases like Postgresql and Mysql, at least for personal non-distributed deployments. Refer to [this HN thread and the linked article](https://news.ycombinator.com/item?id=29727707) for a more profound explanation of why it is probably easier and faster for "small-scale" (<100TB) databases. And thank you for this awesome app! ### Platform Server
OVERLORD added the nice to have label 2026-02-04 18:57:25 +03:00
Author
Owner

@bo0tzz commented on GitHub (Sep 2, 2022):

We've discussed sqlite before, and while it is a good fit for selfhosted services, it would take a not insignificant effort to move Immich over to it now since we use some postgres-only features for things like search. It's also not ideal for the architecture of Immich, since we use multiple separate services (which would mean sqlite needing to use a global write lock). I still think it would be nice to have in the future, but I believe it is not a priority.

@bo0tzz commented on GitHub (Sep 2, 2022): We've discussed sqlite before, and while it is a good fit for selfhosted services, it would take a not insignificant effort to move Immich over to it now since we use some postgres-only features for things like search. It's also not ideal for the architecture of Immich, since we use multiple separate services (which would mean sqlite needing to use a global write lock). I still think it would be nice to have in the future, but I believe it is not a priority.
Author
Owner

@oddlama commented on GitHub (Sep 2, 2022):

Sounds perfectly reasonable, thanks for the insights.

SQLite went through some kind of renaissance lately and I was hoping to be able to eliminate PostgreSQL completely from my personal deployments, and Immich was the last application left to migrate. That's why this came to my mind. Of course I respect and understand your decision that this isn't a priority. I hopeful you will be able to loosen the dependence on PostgreSQL over time and be able to revisit this in the future, if your time allows. Thanks for the great work!

@oddlama commented on GitHub (Sep 2, 2022): Sounds perfectly reasonable, thanks for the insights. SQLite went through some kind of renaissance lately and I was hoping to be able to eliminate PostgreSQL completely from my personal deployments, and Immich was the last application left to migrate. That's why this came to my mind. Of course I respect and understand your decision that this isn't a priority. I hopeful you will be able to loosen the dependence on PostgreSQL over time and be able to revisit this in the future, if your time allows. Thanks for the great work!
Author
Owner

@webysther commented on GitHub (Jun 23, 2023):

The ideia to have multiple services with a central API in this context maybe fix the problem, sqlite for so many years become a great dev tool and for very low number of users or for a single photographer like me, I look as a alternative to photoprism because they start to be the "emby".

I don't see any restriction in the Architecture to use a layer to translate communication with another database.

@webysther commented on GitHub (Jun 23, 2023): The ideia to have multiple services with a central API in this context maybe fix the problem, sqlite for so many years become a great dev tool and for very low number of users or for a single photographer like me, I look as a alternative to photoprism because they start to be the "[emby](https://www.reddit.com/r/selfhosted/comments/13fj282/tutorial_build_your_own_unrestricted_photoprism_ui/)". I don't see any restriction in the Architecture to use a layer to translate communication with another database.
Author
Owner

@webysther commented on GitHub (Jun 23, 2023):

@bo0tzz full-text-search in sqlite is insane, calibre last year start support this feature, for my personal library with 10k books took 1hour and the search is perfect with new books added fast. Maybe use only a job to write the fts.db?

@webysther commented on GitHub (Jun 23, 2023): @bo0tzz [full-text-search in sqlite](https://www.sqlite.org/fts5.html) is insane, [calibre last year](https://calibre-ebook.com/whats-new) start support this feature, for my personal library with 10k books took 1hour and the search is perfect with new books added fast. Maybe use only a job to [write the fts.db](https://github.com/kovidgoyal/calibre/tree/fd3a42cee8bd74e45424d6a721607c5f8d94c555/src/calibre/db/fts)?
Author
Owner

@webysther commented on GitHub (Jun 23, 2023):

Based on migration to prisma, please look to Database features matrix, for future maybe consider remove any custom commands to support the mostly possible databases will be lovely.

@webysther commented on GitHub (Jun 23, 2023): Based on migration to [prisma](https://github.com/immich-app/immich/pull/1962), please look to [Database features matrix](https://www.prisma.io/docs/reference/database-reference/database-features), for future maybe consider remove any custom commands to support the mostly possible databases will be lovely.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#240