Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How much can SQLite store on the iPhone?

I have an idea for a webapp for the iPhone but its unknown to me how much data can be stored in mobile Safari's SQLite db. I tried searching through the Apple docs but found nothing:

Safari Client-Side Storage and Offline Applications Programming Guide: Using the JavaScript Database

like image 548
Geuis Avatar asked Nov 18 '09 00:11

Geuis


3 Answers

Most of these answers are totally wrong. Safari will not allow you to create SQLite databases over 50MB (or expand existing databases beyond that size).

This is a limit imposed by Safari - as other people have noted, SQLite itself supports much larger databases that you can use from native apps. But webapps are limited to 50MB.

It might be useful to note that this is per database - if you really need the extra space, you can create multiple databases, although this would obviously cause a lot of hassle.

like image 169
Ironfrost Avatar answered Oct 12 '22 17:10

Ironfrost


It's as the other posters say. You're only limited by the drive space on the device.

You also need to consider your in memory footprint though. There is a finite amount of memory on the iphone, and in general it's quiet small, so the amount of data/hydrated objects you'll be able to have in memory is another potential limitation for your app.

like image 2
Bryan McLemore Avatar answered Oct 12 '22 18:10

Bryan McLemore


There are a LOT of people answering that have clearly never tested it. I am on the latest version of iOS (4.3.3) and have set up a system to create multiple databases and keep them under 45 MB but found that the 50 MB cap is for the site as a whole. So, no matter how much you split the data up, it still restricts it to an aggregated cap of 50 MB.

like image 2
Matt Ray Avatar answered Oct 12 '22 18:10

Matt Ray