flutterobjectboxflutter-moor

Moor Vs ObjectBox: For Complex Flutter DB


For my next flutter project, Please suggest to me, which will be the best option to implement DB

Moor or ObjectBox

Thanks in advance


Solution

  • It mostly depends on the kind of data you'll be working with. Since the data I'm working with is all relational (stored in Postgres on the back-end) I use Moor. It requires some more setup to join and get the correct data together in the app, but the watch/StreamBuilder capabilities of Moor make it worth it for my use-case. If any data changes in the background, the UI will update accordingly.

    If your data exists only within the app or your backend uses a NoSQL solution like Firestore, using NoSQL (Objectbox) to store the objects likely requires much less effort, and is probably preferred. See also this Moor FAQ remark about Firebase.

    In the end, as with so many questions in computer science, the answer boils down to "it depends".

    Note

    I have worked with Flutter + Moor, I do not have experience with ObjectBox. I have worked with Firestore in combination with a React web app before.