# Is anyone working on MySQL MIAB version?

**URL:** <https://discourse.mailinabox.email/t/is-anyone-working-on-mysql-miab-version/9265>\
**Category:** Improvements\
**Created:** [June 26, 2022, 11:43am UTC](https://discourse.mailinabox.email/t/is-anyone-working-on-mysql-miab-version/9265 "2022-06-26T11:43:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoq1](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/y/a183cd/32.png) [@yoq1](https://discourse.mailinabox.email/u/yoq1)\
**Post date:** [June 26, 2022, 11:43am UTC](https://discourse.mailinabox.email/t/is-anyone-working-on-mysql-miab-version/9265/1 "2022-06-26T11:43:20Z")

</div>

Hello there. I want to know is anyone working on mysql/other non-db lock database?  
sqlite can’t handle many users and many new emails simultaneously. Sometimes i get many

```auto
postfix/smtpd[23273]: fatal: dict_sqlite_lookup: /etc/postfix/virtual-alias-maps.cf: SQL finalize failed for query 'SELECT destination from (SELECT destination, 0 as priority FROM aliases WHERE source='xxx' AND destination<>'' UNION SELECT email as destination, 1 as priority FROM users WHERE email='xx') ORDER BY priority LIMIT 1;': database is locked?
postfix/trivial-rewrite[32074]: warning: dict_sqlite_lookup: /etc/postfix/virtual-alias-maps.cf: SQL step failed for query 'SELECT destination from (SELECT destination, 0 as priority FROM aliases WHERE source='xxx' AND destination<>'' UNION SELECT email as destination, 1 as priority FROM users WHERE email='xxx') ORDER BY priority LIMIT 1;': database is locked?

```

in logs.  
As i understand sqlite can’t handle more than one simultaneously operation. So when it’s 5 or 10 access to database, only one is being processed, the rest are waiting.  
MySQL supports row lock, no need to block the whole database.  
Thank you.

---

<div class="post-metadata">

**Author:** ![openletter](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@openletter](https://discourse.mailinabox.email/u/openletter)\
**Post date:** [June 26, 2022, 12:03pm UTC](https://discourse.mailinabox.email/t/is-anyone-working-on-mysql-miab-version/9265/2 "2022-06-26T12:03:31Z")

</div>

I’m not the best on this, but my understanding is that `postfix` isn’t using a database for messages, so it’s users and Nextcloud accounting for the load on `sqlite3`.

As far using a different RDBMS, on the low end of the spectrum MySQL creates a measurable increase in memory requirements that may cause MiaB to no longer function on a 512MB server, which there are users at this level. At the high end, there are reports of active servers with \>120 users not reporting issues related to MiaB. Since MiaB is geared more toward the smaller servers, I’m not clear that if you were to submit a PR it would be accepted, but you are certainly welcome to try.

There is a popular fork called [Power Mail-in-a-Box](https://github.com/ddavness/power-mailinabox) that adds a lot of advanced features to MiaB, but still maintains using SQLite3.

I half wonder if a fork that adds [MySQL/MariaDB/PostgreSQL], one of the newer Dovecot `dbox` mailbox formats (they do de-duplication, migration of older messages to different storage location, improved search indexing), plus an actual indexing search tool [Solr/Sphinx] would have a niche to fill.

---

<div class="post-metadata">

**Author:** ![openletter](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@openletter](https://discourse.mailinabox.email/u/openletter)\
**Post date:** [June 26, 2022, 12:48pm UTC](https://discourse.mailinabox.email/t/is-anyone-working-on-mysql-miab-version/9265/3 "2022-06-26T12:48:28Z")

</div>

Oh, and I forgot that Roundcube is also using `sqlite3`. Perhaps if you have a lot of users on Roundcube, you might encourage to use clients and that might reduce the load on `sqlite3`.

---

<div class="post-metadata">

**Author:** ![S4\_Hosting](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/s4_hosting/32/1465_2.png) [@S4\_Hosting](https://discourse.mailinabox.email/u/S4_Hosting)\
**Post date:** [June 27, 2022, 7:23am UTC](https://discourse.mailinabox.email/t/is-anyone-working-on-mysql-miab-version/9265/4 "2022-06-27T07:23:56Z")

</div>

> [@openletter](#):
>
> I half wonder if a fork that adds [MySQL/MariaDB/PostgreSQL], one of the newer Dovecot `dbox` mailbox formats (they do de-duplication, migration of older messages to different storage location, improved search indexing), plus an actual indexing search tool [Solr/Sphinx] would have a niche to fill.

I think it might, and would be a really interesting fork.

---

<div class="post-metadata">

**Author:** ![mveplus](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/mveplus/32/708_2.png) [@mveplus](https://discourse.mailinabox.email/u/mveplus)\
**Post date:** [July 2, 2022, 7:56pm UTC](https://discourse.mailinabox.email/t/is-anyone-working-on-mysql-miab-version/9265/5 "2022-07-02T19:56:01Z")

</div>

@yoq1 in the past for a long time I was using [iredmail](http://www.iredmail.org/) script for my mail box; it also offers good support both free and payed package. May be more appropriate for heavier use cases.  
I like the simplicity of MIAB and its low footprint, adding a full DB will get have trade off as mentioned. I’m sure someone can make a fork with \*db but then it will need ongoing support as well so weigh your options and go with solution that best suits your use case.

Cheers,

---

<div class="post-metadata">

**Author:** ![system](https://discourse.mailinabox.email/uploads/default/original/2X/4/4d0933d13c456b7e57f296aa6cc344525b6f0c70.png) [@system](https://discourse.mailinabox.email/u/system)\
**Post date:** [August 26, 2022, 11:43am UTC](https://discourse.mailinabox.email/t/is-anyone-working-on-mysql-miab-version/9265/6 "2022-08-26T11:43:41Z")

</div>

This topic was automatically closed after 61 days. New replies are no longer allowed.
