Data Base Research For Encrypted Data (IOS Platform)

We conducted a study for two most popular DataBases with encryption: Realm and SQLite + SQLCipher.

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
 iPhone-6 Realm 1595.26757625 seconds
≈ 26.5 minutes
63.889594291 seconds
≈ 1.02 minute
0.024680166 seconds
≈ 24ms
0.000911209 seconds
≈ 0.9ms
0.00061875 seconds
≈ 0.6ms
  Phone-5s Realm 1712.079746083 seconds
≈ 28.5 minutes
66.468130708 seconds
≈ 1.04 minute
0.023555917 seconds
≈ 23ms
0.0009235 seconds
≈ 0.9ms
0.000887458 seconds
≈ 0.8 ms
iPhone-6 SQLite + SQLCipher 1627.521456 seconds
≈ 27 minutes
120.184145834 seconds
≈ 2 minutes
0.005854 seconds
≈ 5.8ms
0.00222675 seconds
≈ 2.2ms
0.003761292 seconds
≈ 3.7ms
iPhone- 6s SQLite + SQLCipher 1504.579757208 seconds
≈ 25 minutes
100.734026542 seconds
≈ 1.8 minute
0.022970333 seconds
≈ 22.9ms
0.000941875 seconds
≈ 0.9ms
0.000759333 seconds
≈ 0.7ms

This analysis helped us make a choice in favour of  Realm. 

It will be a perfect database for encrypred data for 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,

2 Replies to “Data Base Research For Encrypted Data (IOS Platform)”

Leave a Reply

Your email address will not be published.