Problem statement: To provide actionable data on available Offline/Local mobile database capabilities, searching and limitations.
Based on existing research Local storage comparison . So we will focus on “search” capability as per requirement.
2 key questions expected to be answered by the end of the spike.
1. How many transactions can we store in local database? Execution time, CPU, RAM and Disk usage.
2. Given list of top 10 Gojek users mobile phone, (no1 is Samsung J2 Prime) will our offline mobile db approach applicable? We have set aside a similar spec mobile phone for real testing on device.Timebox the spike: (13 March 2020 until 17 March 2020)
So we use the existing TransactionHistory model and objects. Implement searching logic based on 2 fields: partner and note. Then put 100, 500, 1000, 1500, 2000, 10000 data and do full text search on those 2 fields.
Detail implementation of Searching can be read here: Searching using Hive vs Elasticsearch
The chosen mobile phone is Low end based on Gojek’s majority customers are using $100 mobile phone. Mostly based on Snapdragon 4xx series.
EMULATOR BASED RESULT
Option | Description | The spike design/approach | State | Storage (MB) | Cache (MB) | Ram Usage (MB) | Time Elapsed (ms) |
Moor+FFI+SQLite | Fast and light mobile db. But don’t have searching capability. | Emulator with SQL like | Before | 48.91 | 12.88 | 79 | |
|
|
| 100 | 48.95 | 12.91 | 94 | 20 |
|
|
| 500 | 49 | 12.89 | 97 | 11.25 |
|
|
| 1,000 | 49.08 | 12.88 | 97 | 19.25 |
|
|
| 1,500 | 49.15 | 12.88 | 98 | 18.5 |
|
|
| 2,000 | 49.23 | 12.88 | 98 | 24 |
|
|
| 10,000 | 50.4 | 12.88 | 85 | 15.5 |
|
|
| 50,000 | 56.3 | 12.89 | 88 | 27.25 |
|
|
| 100,000 | 63.68 | 12.88 | 94 | 46.5 |
MOBILE TEST RESULT Redmi 4A Snapdragon 425 2GB RAM
Option | Description | The spike design/approach | State | Storage (MB) | Cache (MB) | Ram Usage (MB) | Time Elapsed (ms) |
Hive | Reliable and fast mobile database. It has typesafe searching ability. | Mobile |
|
|
|
|
|
|
|
| 100 | 48.07 | 50.8 | 101.739 | 1.259 |
|
|
| 500 | 48.18 | 55.53 | 84.44641 | 3.23 |
|
|
| 1,000 | 49.31 | 53.91 | 97.08377 | 2.557 |
|
|
| 1,500 | 48.45 | 53.96 | 110.2369 | 2.391 |
|
|
| 2,000 | 48.59 | 53.92 | 99.1894 | 5.613 |
|
|
| 10,000 | 50.77 | 53.94 | 192.7229 | 27.526 |
Option | Description | The spike design/approach | State | Storage (MB) | Cache (MB) | Ram Usage (MB) | Time Elapsed (ms) |
Moor+FFI+SQLite | Fast and light mobile db. But don’t have searching capability. | Mobile with SQL like | Before | 0.283 | 1.11 | 65 | - |
|
|
| 100 | 0.16 | 1 | 75 | 5.95 |
|
|
| 500 | 0.217 | 0.872 | 53 | 9.85 |
|
|
| 1,000 | 0.291 | 0.97 | 65 | 8 |
|
|
| 1,500 | 0.365 | 1.03 | 66 | 7.33 |
|
|
| 2,000 | 0.438 | 1.03 | 70 | 9.95 |
|
|
| 10,000 | 1.61 | 0.97 | 75 | 11.35 |
|
|
| 1,000,000 | 148 | 1.08 | 155 | 602.95 |
Attachments:
list of mobile device.xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)