We have made 100 0000 inserts of encrypted data for both Data Bases for our study.
The table below displays the results of our analysis.
We tested Data Bases for iPhones 5s, 6 and 6s.
We wrote and read 100 000 encrypted elements from the database and checked the system’s productivity under these conditions. Then we got those 100 000 data elements from the first, middle and last parts of the DB and monitored the time nedeed for the performance of the task. All the indices below are averaged.
|Device||DataBase||Write 100K Items (Separately)||Read 100K Items (Separately)||Get Item ID = 25000||Get Item ID = 50000||Get Item ID = 750000|
≈ 26.5 minutes
≈ 1.02 minute
≈ 28.5 minutes
≈ 1.04 minute
≈ 0.8 ms
|iPhone-6||SQLite + SQLCipher||1627.521456 seconds
≈ 27 minutes
≈ 2 minutes
|iPhone- 6s||SQLite + SQLCipher||1504.579757208 seconds
≈ 25 minutes
≈ 1.8 minute
This analysis helped us make a choice in favour of Realm.
It will be a perfect database for encrypred data for Multy.io because:
- it is fast in performing queries and synchronizing objects;
- it provides encryption services to protect the database;
- it is a cross-platform DB;
- it can work offline creating lines of queries;
- easy to use;
- well supported by the developers.
Conclusion: If your project requires encryption or high-speed, then Realm is an obvious choice. If your project has a complex data model that changes frequently, then Core Data might be a better choice.
The reserch was conducted by Ivan Apet, IOS Developer, Multy.io.