Why?

To store the required data locally and fetch from the local database instead of making API call.


What kind of data is stored locally ? (might change)

Contacts

Accounts

bill group, biller, denomination code, outgoing category code

shortcut

bank codes

language Reference

device info

currency

branch location

transcation codee

transcation category

Payment Instruction

cards

 


Options Considered

  1. SqFlite - https://pub.dev/packages/sqflite

  2. Moor - https://pub.dev/packages/moor

  3. Hive - https://pub.dev/packages/hive


SqFlite

  1. SQL database - defined set of tables and constraints for columns in tables.

  2. Popularity 1.5K stars in github.

  3. Requires migrations which table design changes

  4. Raw library with all basic function.


Moor

  1. Wrapper on sqlite which provides generators.

  2. Popularity 587 stars in github

  3. Requires migrations which table design changes

  4. Provides features out of the box compared to sqFlite, like filter, batch operations and joins.


Hive

  1. No-Sql Database provides generator

  2. Popularity 957 stars.

  3. No migrations required.


COMPARISON (only differences)

Library

SqLlite

Moor

Hive

Time to code & Developer Friendly

​ ​High

(minus)

Requires developers to create tables, models, migrations and repositories.

​ ​Medium

(plus)

Requires developers to write models, migrations and repositories.

Generators creates table.

​ ​Less

(plus)

Requires developers to write only models and repositories.

Generators creates table.

Maintenance

​ ​Difficult

(minus)

Have to maintain migration versions and update all the data.

 ​ Difficult

(minus)

Have to maintain migration versions and update all the data.

​ ​Easy

(plus)

No migrations required. Just delete and create new table.

Performance

Took example of 1000 contacts in DEV environment

CIF: 8a8e86cf706677df017066a9b83f049d

Same as Moor

Writing 1000 contacts

​844ms

(minus)

Reading 1000 contacts

(minus)

​298ms

Writing 1000 contacts

​28ms

(plus)

Reading 1000 contacts

(plus)

​1ms

 


Selected Option:

HIVE