Maximum size of byte array in Realm cloud

Hello,

i want to save documents in realm and want to use byte arrays for this. i can´t find informations on the maximum size of such byte arrays in realm in the cloud instance at the documentation.

can anyone help me?

best regards

Volkhard

2 Likes

For realm, the max size is 16Mb for Data and String properties.

NSData and NSString properties cannot hold data exceeding 16MB in size. To store larger amounts of data, either break it up into 16MB chunks or store it directly on the file system, storing paths to these files in the Realm. An exception will be thrown at runtime if your app attempts to store more than 16MB in a single property.

The Realm documentation is here

Keep in mind that Realm discourages L A R G E files to be stored in realm - you would be better off storing them in another source, such as Firebase Storage and keeping a link in realm.

To avoid size limitations and a performance impact, it is best not to store large blobs (such as image and video files) directly in Realm

3 Likes

Do you know, if the limit is 16 * 1,000,000B or 16 * 1,048,576B?

I would guess that it would be 16MB (bytes), a multiple of a single byte. So it would be most accuratelty represented by 1,048,576. (1,048,576 being 1 Megabyte in computer-ese or 2^20 bytes)