# Plex Media Server - SQLite - MySql

**URL:** https://forums.plex.tv/t/plex-media-server-sqlite-mysql/623281
**Category:** Plex Media Server
**Tags:** library-management
**Created:** [August 13, 2020, 4:18pm UTC](https://forums.plex.tv/t/plex-media-server-sqlite-mysql/623281 "2020-08-13T16:18:37Z")
**Posts on this page:** 7
**Page:** 1

<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: [August 13, 2020, 4:18pm UTC](https://forums.plex.tv/t/plex-media-server-sqlite-mysql/623281/1 "2020-08-13T16:18:38Z")

</div>

I have noticed that when a Plex Server has over 10k content that there is constant issues with the SQLite database. Sometimes it is just lag, but moreover crashes and lockups happen more often. I have tracked down the process cause and it is the database not Plex. When will Plex have an option or switch to MySQL or similar database? This should be a top issue on the developer todo list as it is the main cause of stability issues. I have confirmed the former on over 30 Plex installations. Furthermore once content reaches 30k monthly database related issues are almost certain. Please discuss and provide timeline for DB modernization.

---

<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: [August 13, 2020, 4:32pm UTC](https://forums.plex.tv/t/plex-media-server-sqlite-mysql/623281/2 "2020-08-13T16:32:41Z")

</div>

There’s an actual feature suggestion discussing this topic (and what database servers to use instead).

> [@\[REQUEST\] Move from SQLite to MySQL or Postgres](https://forums.plex.tv/t/request-move-from-sqlite-to-mysql-or-postgres/78346):
>
> 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;

---

<div class="post-metadata">

### Author: ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)
#### Post date: [August 13, 2020, 4:39pm UTC](https://forums.plex.tv/t/plex-media-server-sqlite-mysql/623281/3 "2020-08-13T16:39:40Z")

</div>

I will respectfully disagree with that statement.

1. 133,732 media items

```auto
sqlite> select count(*) from metadata_items;
133742
sqlite> 

```

1. Zero database issues.

I assert:

1. Plex Media Server host computer system (or NAS) not keeping up with demand
2. Abrupt power-off / forced shutdown before clean exit / power interruptions are the greater cause of corrupt databases

EDIT: Addendum

```auto
sqlite> select count(*) from metadata_items;
133742
sqlite> 
[chuck@lizum qnap.77]$ sqlite3 *.db .dump > db.sql
[chuck@lizum qnap.78]$ wc -l db.sql
1006567 db.sql
[chuck@lizum qnap.79]$ 

```

---

<div class="post-metadata">

### Author: ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)
#### Post date: [August 13, 2020, 11:18pm UTC](https://forums.plex.tv/t/plex-media-server-sqlite-mysql/623281/4 "2020-08-13T23:18:39Z")

</div>

SQLite is objectively among the highest-quality code _in the world_.

[https://sqlite.org/testing.html](https://sqlite.org/testing.html)

30k, 100k, 1M records … those are absolutely trivial database sizes.

> **[Scaling SQLite to 4M QPS on a Single Server (EC2 vs Bare Metal)](https://blog.expensify.com/2018/01/08/scaling-sqlite-to-4m-qps-on-a-single-server/)**
>
> Tips and tricks for scaling SQLite for 4M real-ish queries per second on a single server, and how bare metal compares to EC2 for this workload.

He describes some very beefy servers, yes. He also describes SQLite databases with **10B rows** and **4M queries/second**.

SQLite is well-suited for Plex’s current architecture, too.

If you have 30 systems with problems, I suggest that there is another commonality …

I jest. But maybe you could share the problems that you’re seeing? If it’s blowing up repeatedly, there’s something wrong.

How are you diagnosing database issues, “not Plex”?

---

<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:46pm UTC](https://forums.plex.tv/t/plex-media-server-sqlite-mysql/623281/5 "2020-09-06T17:46:27Z")

</div>

SQLite is not the highest quality code nor is it the best database too use for this application. It’s good, but not great. Without going into the great SQL debate there are real SQL servers that should be used. #bump the SQL server option feature request.

---

<div class="post-metadata">

### Author: ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)
#### Post date: [September 6, 2020, 7:49pm UTC](https://forums.plex.tv/t/plex-media-server-sqlite-mysql/623281/6 "2020-09-06T19:49:07Z")

</div>

I don’t have any particular affection for SQLite, but I hold it in high regard and it seems appropriate for Plex. It is flexible and lightweight. Code quality is high and maintenance is low. The lack of concurrent user support doesn’t affect Plex.

You stated that you tracked down SQLite as the main cause of stability issues. Such statements should generally be accompanied by evidence.

If you are aware of specific issues it would be useful to share them so that they can be investigated and addressed.

Perhaps there **is** something wrong with SQLite. Or the way Plex interacts with the database. Maybe SQLite settings can be optimized. Or perhaps Plex’s database structures, indexes, or maintenance processes could be improved. Or a million other things.

If so, sharing could benefit the community.

“You should change technologies” is tiresome and meaningless without details of how it would apply and why it would help.

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [December 5, 2020, 7:49pm UTC](https://forums.plex.tv/t/plex-media-server-sqlite-mysql/623281/7 "2020-12-05T19:49:13Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
