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
SqFlite - https://pub.dev/packages/sqflite
SqFlite
SQL database - defined set of tables and constraints for columns in tables.
Popularity 1.5K stars in github.
Requires migrations which table design changes
Raw library with all basic function.
Moor
Wrapper on sqlite which provides generators.
Popularity 587 stars in github
Requires migrations which table design changes
Provides features out of the box compared to sqFlite, like filter, batch operations and joins.
Hive
No-Sql Database provides generator
Popularity 957 stars.
No migrations required.
COMPARISON (only differences)
Library | SqLlite | Moor | Hive |
---|---|---|---|
Time to code & Developer Friendly | High Requires developers to create tables, models, migrations and repositories. | Medium Requires developers to write models, migrations and repositories. Generators creates table. | Less Requires developers to write only models and repositories. Generators creates table. |
Maintenance | Difficult Have to maintain migration versions and update all the data. | Difficult Have to maintain migration versions and update all the data. | Easy 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 Reading 1000 contacts 298ms | Writing 1000 contacts 28ms Reading 1000 contacts 1ms |