-
Hi, We've been relying on Drift (and Moor before that) for a very long time, and we can't thank enough all the people working on this library. Our app (secure E2EE messaging for healthcare) has historically been mostly native (iOS and Android) but our users have been asking for a web version, which we started to work on about a year ago. One of the hurdles was the storage layer so we were delighted when the more modern web implementation came out. Lately, after extensive internal testing, we released the web version out of beta and to our users in a healthcare setting. Our data architecture is relatively complex:
So as the users switch between one session and another, they close M databases and open M others. The authentication layer, though, does not move between close and open state at all. It stays open for the lifecycle of the app. Only on the web since we released it, relatively frequent reports of SQL errors (code 1 and code 10) started to pour in, so we forced "in-memory only" implementation of SQLite except for the authentication layer. We still see these reports coming from the app, but now only for the authentication layer. Example of error reports:
Quickly followed by
Do you see, in our design, issues that can arise with the current (or recent) web implementation of Drift? Can you think of another DB layout strategy that would be more resilient? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In previous drift versions, web databases weren't properly closed if hosted on workers. This has been fixed in drift 2.15.0, but you also need the most recent worker to benefit from that. So that might have caused a lot of connections being open at the same time. It should be possible to have multiple databases open at the same time though, and it looks like the amount of databases did not cause the problem as it still appears when the authentication layer is the only thing using a database. So I think the problem comes from drift or the Do you have a way to correlate these reports with the chosenImplementation when the database was opened? With |
Beta Was this translation helpful? Give feedback.
In previous drift versions, web databases weren't properly closed if hosted on workers. This has been fixed in drift 2.15.0, but you also need the most recent worker to benefit from that. So that might have caused a lot of connections being open at the same time. It should be possible to have multiple databases open at the same time though, and it looks like the amount of databases did not cause the problem as it still appears when the authentication layer is the only thing using a database. So I think the problem comes from drift or the
sqlite3
package, not from the way you're using them.Do you have a way to correlate these reports with the chosenImplementation when the database was ope…