mvysny / aedict

Original Aedict 2 source codes
http://www.aedict.eu
GNU General Public License v3.0
40 stars 7 forks source link

Aedict 4: new data storage #834

Closed mvysny closed 6 years ago

mvysny commented 6 years ago

Possible CouchBase replacements:

  1. Using Sync Adapters. I've saw the API. I'd rather kill myself than use that horrible shit.
  2. Use Firebase: https://firebase.google.com/docs/database/android/start/ disadvantages: probably Aedict Online can't connect there; also to scale for 5k users I'd need $25/month which is okay: https://firebase.google.com/pricing/
  3. Use other forms of sync: https://www.quora.com/What-is-the-best-way-to-sync-local-user-data-with-server-data-for-mobile-apps: a. PouchDB + cloudant sync ?
mvysny commented 6 years ago

Related issue: https://github.com/mvysny/aedict/issues/721

Just did a very simple performance benchmark, and the CloudAnt performance is simply terrible: it takes 40ms to create a document, and 40ms to run a single query. I'm pretty sure that CouchBase with ForestDB was way faster; I'll need to attach performance measurements.

mvysny commented 6 years ago

On the same machine performance-testing CouchBase+ForestDB: creating a document takes ~1ms, a single query takes 2ms and single document retrieval takes ~1,5ms. That's like 20-40 times faster than CloudAnt Sync! It's probably because CloudAnt Sync uses Sqlite underneath, while CouchBase uses ForestDB. However the performance of CloudAnt Sync is simply unacceptable.

mvysny commented 6 years ago
mvysny commented 6 years ago

This looks VERY interesting: https://www.dizitart.org/nitrite-database.html - and it has Kotlin support! https://github.com/dizitart/nitrite-database/tree/master/potassium-nitrite Getting started: https://dzone.com/articles/nitrite-an-embedded-nosql-database-for-javaandroid

mvysny commented 6 years ago

Nitrite looks awesome: it is based on a well-tested H2 mvstore and is extremely fast:

And it's pure Java! So it's 10 times faster than CouchBase Lite, and 200-400 times faster than CloudAnt. Unfortunately there are sync issues: https://github.com/dizitart/nitrite-database/issues/73

mvysny commented 6 years ago

Using the underlying H2 MVStore yields even more brutal performance: saving a binary entry takes 0,03ms; retrieval of a saved binary takes 0,01ms. And what's the best thing - we can simply use Kafka for synchronization purposes!

mvysny commented 6 years ago

Replaced CBL with UMN: https://gitlab.com/mvysny/umn in Aedict 3.50