# Switch from SQLite to PostgreSQL

**URL:** <https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871>\
**Category:** Feature Suggestions\
**Created:** [January 2, 2019, 11:49pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871 "2019-01-02T23:49:11Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![BustyChicksFTW](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@BustyChicksFTW](https://forums.plex.tv/u/BustyChicksFTW)\
**Post date:** [January 2, 2019, 11:49pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/1 "2019-01-02T23:49:11Z")

</div>

So many issues with SQLite and high volumes of data. It crashes so many times. We need PostgreSQL. Please.

---

<div class="post-metadata">

**Author:** ![tycoonbob](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tycoonbob](https://forums.plex.tv/u/tycoonbob)\
**Post date:** [January 31, 2019, 10:13pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/2 "2019-01-31T22:13:05Z")

</div>

Postgres, MySQL, MariaDB…just something.

At the least, give us an option to set the `cache_size` in sqlite within Plex! I have over 20k files in Plex (video files, I’ve removed my audio library because performance reasons), and I can often see slowness during loading of the web client, or other clients. I’ve manually set the `default_cache_size` in my sqlite file, but this is a deprecated feature. Need to have the ability to set `cache_size` from within Plex to something higher than the default 2000 (which is ~2MB).

Better solution would be the OPTION to use an external database, which can also open the door to highly available environments, which are features important to those of us who run plex at scale.

---

<div class="post-metadata">

**Author:** ![TeknoJunky](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/teknojunky/32/165055_2.png) [@TeknoJunky](https://forums.plex.tv/u/TeknoJunky)\
**Post date:** [January 31, 2019, 10:17pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/3 "2019-01-31T22:17:28Z")

</div>

something, anything.

make plex database agnostic and work any standard sql database (local or remote).

---

<div class="post-metadata">

**Author:** ![esolitos](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/esolitos/32/118145_2.png) [@esolitos](https://forums.plex.tv/u/esolitos)\
**Post date:** [February 1, 2019, 4:10pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/4 "2019-02-01T16:10:23Z")

</div>

TBH Switching from SQLite to _anything else_ is not as easy as said. 🙂

The reason why sqlite is _so much used_ is that doesn’t need an external dependencies, no extra daemon running only internal libraries dependencies and one file.

With that i’m not saying that I wouldn’t like see Plex using another db engine, but it’s unlikely to happen.

And if it does I’d actually go for a documental db, like solr/elastic which i think it’s more fitting as data store than a relational db in Plex usecase. But again that alone would be a massive change…

---

<div class="post-metadata">

**Author:** ![BustyChicksFTW](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@BustyChicksFTW](https://forums.plex.tv/u/BustyChicksFTW)\
**Post date:** [February 1, 2019, 4:36pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/5 "2019-02-01T16:36:11Z")

</div>

It’s not that hard. If Plex would have been open-source I’d have forked it and done it myself.

---

<div class="post-metadata">

**Author:** ![GiviMad](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@GiviMad](https://forums.plex.tv/u/GiviMad)\
**Post date:** [November 19, 2019, 8:59pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/6 "2019-11-19T20:59:10Z")

</div>

Seems ridiculous to suggest that the support for other data storages is a hard task to implement, for sure it requires some work time, but the benefits that it brings are a lot. At least enough to get a response from some Plex team member that seems to ignore questions about this. I don’t think Plex could never be scaled as a modern software while they have sqlite as its only storage option, and I see this as a requirement to be the reference as home media server.

---

<div class="post-metadata">

**Author:** ![Chemputer](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@Chemputer](https://forums.plex.tv/u/Chemputer)\
**Post date:** [November 19, 2019, 10:04pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/7 "2019-11-19T22:04:31Z")

</div>

I’d love to see them implement an ODBC compliant client for local or remote databases, with the default being the local SQLite since most people don’t need or want to mess with a database for their media server, but having the _option_ there for those of us who would like it would be very helpful.

I honestly think Plex would go FOSS before they did something like this but still, it’s worth asking for.

---

<div class="post-metadata">

**Author:** ![DeBoet](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/deboet/32/160675_2.png) [@DeBoet](https://forums.plex.tv/u/DeBoet)\
**Post date:** [November 21, 2019, 2:51pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/8 "2019-11-21T14:51:01Z")

</div>

> [@tycoonbob](#):
>
> cache\_size

At the very least me too would like to have an advanced option for this somehow, somewhere. Just giving the SQL DB a bit more juice to work with can work wonders on larger systems and setups.

---

<div class="post-metadata">

**Author:** ![tycoonbob](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tycoonbob](https://forums.plex.tv/u/tycoonbob)\
**Post date:** [November 22, 2019, 4:38pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/9 "2019-11-22T16:38:26Z")

</div>

Glad to see more traction here. My libraries have grown to over 28k files as of today (compared to ~20k Jan 2019), which I’m sure has an impact on my SQLite DB. I’ve maintained my default\_cache\_size to be larger than my page\_count, and it’s definitely been helpful. My page\_count is ~56,000 as of today, so I have my cache\_size set to 64,000.

I still maintain that it would be nice if Plex had an advanced option to set that cache\_size from the application so I didn’t have to manage it, or at least a tick box that would set my cache\_size to a size larger than page\_count if I wanted (do a check on daemon restart to check and set this if needed maybe?). Even if this was a hidden option that I’d have to set Preferences.xml or something…

---

<div class="post-metadata">

**Author:** ![DravorInVa](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@DravorInVa](https://forums.plex.tv/u/DravorInVa)\
**Post date:** [April 18, 2020, 6:43am UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/10 "2020-04-18T06:43:17Z")

</div>

I really think we need more momentum here. Even Chuck said it himself, that when talking to the database designer, sqlite was never expected to hold as much data as many of us have. Especially once we started adding large music libraries. We need more upvotes on this.

Previously from Chuck:

I previously chatted with the actual designer of the database. When I told him the sizes involved, he flat out sold me that “bad things will happen”. I take that to mean that the typical home user , which is what Plex is designed for, was never expected to have that much media.

---

<div class="post-metadata">

**Author:** ![BustyChicksFTW](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@BustyChicksFTW](https://forums.plex.tv/u/BustyChicksFTW)\
**Post date:** [April 18, 2020, 1:36pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/11 "2020-04-18T13:36:22Z")

</div>

I don’t think we’re ever going to get this.

---

<div class="post-metadata">

**Author:** ![7April](https://avatars.discourse-cdn.com/v4/letter/7/71c47a/32.png) [@7April](https://forums.plex.tv/u/7April)\
**Post date:** [May 25, 2020, 3:54pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/12 "2020-05-25T15:54:31Z")

</div>

Hate to say it but the database designer is not all that familiar with 3NF. The database has bigger problems than the engine.

---

<div class="post-metadata">

**Author:** ![phonemainuser\_gmail\_com](https://avatars.discourse-cdn.com/v4/letter/p/bc79bd/32.png) [@phonemainuser\_gmail\_com](https://forums.plex.tv/u/phonemainuser_gmail_com)\
**Post date:** [August 3, 2020, 1:17am UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/13 "2020-08-03T01:17:04Z")

</div>

I tried a variety of media servers, as if only kodi can support external database, but I can’t scan the media library correctly, so I gave it up. I m currently using jellyfin, beautiful interface and multiple platform support, almost perfect, but also only use sqlite, it’s a bit slow when processing pictures and music files, if you can add jellyfin external database interface, many people will be grateful, including me！！！ 🥰

---

<div class="post-metadata">

**Author:** ![bryanpetkus](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@bryanpetkus](https://forums.plex.tv/u/bryanpetkus)\
**Post date:** [September 6, 2020, 5:55pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/14 "2020-09-06T17:55:20Z")

</div>

PostgreSQL isnt my favorite, however I will take anything as an alternative to SQLite!

---

<div class="post-metadata">

**Author:** ![beckfield](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/beckfield/32/7227_2.png) [@beckfield](https://forums.plex.tv/u/beckfield)\
**Post date:** [September 6, 2020, 9:02pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/15 "2020-09-06T21:02:33Z")

</div>

There is already a [feature request](https://forums.plex.tv/t/request-move-from-sqlite-to-mysql-or-postgres/78346) for this. Better to add your vote there than to split votes across multiple threads.

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [September 7, 2020, 9:08am UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/16 "2020-09-07T09:08:03Z")

</div>

A request for the same feature exists already, and it has more votes.

> [@\[REQUEST\] Move from SQLite to MySQL or Postgres](https://forums.plex.tv/t/request-move-from-sqlite-to-mysql-or-postgres/78346/1):
>
> I would like to request that the metadata database com.plexapp.plugins.library.db move from SQLite to MySQL or Postgres ( Or any real external db for that matter). &nbsp;I feel that this would bring additional stability and repair functionality for large collections. &nbsp;Additional if this database was available as an external shared resource it would allow for additional clustering and high availability functionality. &nbsp;

Therefore this one is closed, to prevent spreading the votes across several threads, even though they vote for the same (or at least very similar thing).

Votes are given back to the users who voted on this request. Please think of re-voting in the other thread if you still want it.

* * *

Rules for the Feature Suggestions forum section:

- Please **search** before creating a new suggestion thread.
- Only one feature per thread.

See existing feature suggestions, sorted by **most popular** first  
[https://forums.plex.tv/c/general/feature-suggestions/l/votes](https://forums.plex.tv/c/general/feature-suggestions/l/votes)

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [September 7, 2020, 9:08am UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/17 "2020-09-07T09:08:06Z")

</div>



---

<div class="post-metadata">

**Author:** ![tom80H](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/tom80h/32/19753_2.png) [@tom80H](https://forums.plex.tv/u/tom80H)\
**Post date:** [June 20, 2021, 2:55pm UTC](https://forums.plex.tv/t/switch-from-sqlite-to-postgresql/356871/18 "2021-06-20T14:55:37Z")

</div>


