Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum SQLite size using blob

I want to create a database where text and images will be stored using blob. There will be about 5-6k entries and the size of the image will be around 1MB. That means 5-6GB of storage. Will my app be able to handle all that storage or it will crash? I wonder cause my phone is 16GB and it will be around 50% of phone's free storage. In case blob doesn't work is there an other method I can use?

like image 538
marduc812 Avatar asked Nov 17 '14 08:11

marduc812


People also ask

Does SQLite have a size limit?

Maximum Database SizeThe maximum size of a database file is 4294967294 pages. At the maximum page size of 65536 bytes, this translates into a maximum database size of approximately 1.4e+14 bytes (281 terabytes, or 256 tebibytes, or 281474 gigabytes or 256,000 gibibytes).

Does SQLite support a BLOB type?

(10) Does SQLite support a BLOB type? SQLite allows you to store BLOB data in any column, even columns that are declared to hold some other type. BLOBs can even be used as PRIMARY KEYs.

What is the maximum row size of the SQLite database?

A SQLite database can have maximum 2147483646 pages. Hence the maximum number of tables in a schema cannot reach more than 2147483646. The maximum number of rows in a table is 264. The maximum number of columns is 32767 in a table.

What is BLOB storage SQLite?

A BLOB (large binary object) is an SQLite data type that stores large objects, typically large files such as images, music, videos, documents, pdf, etc. We need to convert our files and images into binary data (byte array in Python) to store it into SQLite database.


1 Answers

SQLite itself will handle that much data just fine. (Databases can have up to 140 TB.)

It might be more efficient to store large images in files instead; see Internal Versus External BLOBs in SQLite. However, mobile devices behave differently; you'd have to measure it to find out which is faster.

Regardless of how you store the data, as long as you still have free space, you still can store data.

like image 157
CL. Avatar answered Sep 27 '22 16:09

CL.