From e588df84073bfc2bce6a0a72802021b54a48571c Mon Sep 17 00:00:00 2001 From: Chris Bush Date: Mon, 3 May 2021 15:38:49 -0400 Subject: [PATCH 1/4] (DOCSP-14655): Port current limitations to iOS sections --- ...string-sort-and-query-limitations-note.rst | 5 +++++ .../data-types/supported-property-types.txt | 22 +++++++++++++++++++ .../examples/define-a-realm-object-model.txt | 8 +++++++ source/sdk/ios/examples/filter-data.txt | 1 + .../sdk/ios/examples/read-and-write-data.txt | 3 ++- source/sdk/ios/fundamentals/realms.txt | 12 +++++++++- 6 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 source/includes/string-sort-and-query-limitations-note.rst diff --git a/source/includes/string-sort-and-query-limitations-note.rst b/source/includes/string-sort-and-query-limitations-note.rst new file mode 100644 index 0000000000..bdb4378152 --- /dev/null +++ b/source/includes/string-sort-and-query-limitations-note.rst @@ -0,0 +1,5 @@ +.. note:: + + String sorting and case insensitive queries are only supported for + character sets in 'Latin Basic', 'Latin Supplement', 'Latin Extended + A', and 'Latin Extended B' (UTF-8 range 0-591). diff --git a/source/sdk/ios/data-types/supported-property-types.txt b/source/sdk/ios/data-types/supported-property-types.txt index 68c780bf00..f93cb55559 100644 --- a/source/sdk/ios/data-types/supported-property-types.txt +++ b/source/sdk/ios/data-types/supported-property-types.txt @@ -12,6 +12,9 @@ Supported Property Types - iOS SDK :depth: 2 :class: singlecol +Property Syntax +--------------- + .. tabs-realm-languages:: .. tab:: @@ -127,3 +130,22 @@ Supported Property Types - iOS SDK ``CGFloat`` properties are discouraged, as the type is not platform independent. +.. _ios-size-limitations: + +Size Limitations +---------------- + +Data and string properties cannot hold more than 16MB. To store +larger amounts of data, either: + +- Break the data into 16MB chunks, or +- Store data directly on the file system and store paths to the files in the {+realm+}. + +{+service-short+} throws a runtime exception if your app attempts to +store more than 16MB in a single property. + +To avoid size limitations and a performance impact, it is best not to +store large blobs, such as image and video files, directly in a +{+realm+}. Instead, save the file to a file store (such as S3) and +keep only the location of the file and any relevant metadata in the +{+realm+}. diff --git a/source/sdk/ios/examples/define-a-realm-object-model.txt b/source/sdk/ios/examples/define-a-realm-object-model.txt index f8221c1d7e..2ceb62f87e 100644 --- a/source/sdk/ios/examples/define-a-realm-object-model.txt +++ b/source/sdk/ios/examples/define-a-realm-object-model.txt @@ -48,6 +48,10 @@ Define a New Object Type .. literalinclude:: /examples/generated/code/start/ObjectModels.codeblock.define-a-model.m :language: objectivec +.. note:: + + Class names are limited to a maximum of 57 UTF-8 characters. + .. _ios-declare-a-property: Declare Properties @@ -90,6 +94,10 @@ Declare Properties .. literalinclude:: /examples/generated/code/start/ObjectModels.codeblock.array-declaration.m :language: objectivec +.. note:: + + Property names are limited to a maximum of 63 UTF-8 characters. + .. _ios-specify-an-optional-required-property: Specify an Optional/Required Property diff --git a/source/sdk/ios/examples/filter-data.txt b/source/sdk/ios/examples/filter-data.txt index ad51583809..f2440d93ce 100644 --- a/source/sdk/ios/examples/filter-data.txt +++ b/source/sdk/ios/examples/filter-data.txt @@ -383,6 +383,7 @@ Regex-like wildcards allow more flexibility in search. .. literalinclude:: /examples/generated/code/start/QueryEngine.codeblock.string-operators.swift :language: swift +.. include:: /includes/string-sort-and-query-limitations-note.rst Aggregate Operators ~~~~~~~~~~~~~~~~~~~ diff --git a/source/sdk/ios/examples/read-and-write-data.txt b/source/sdk/ios/examples/read-and-write-data.txt index c883ffd72b..9a82ead4e2 100644 --- a/source/sdk/ios/examples/read-and-write-data.txt +++ b/source/sdk/ios/examples/read-and-write-data.txt @@ -191,7 +191,6 @@ guarantees a consistent order of results if you explicitly sort them. ` with the desired key path to sort by. - .. literalinclude:: /examples/generated/code/start/ReadWriteData.codeblock.sort.m :language: objectivec @@ -202,6 +201,8 @@ guarantees a consistent order of results if you explicitly sort them. `, use dot-notation as if it were in a regular, nested object. +.. include:: /includes/string-sort-and-query-limitations-note.rst + .. _ios-query-a-relationship: Query a Relationship diff --git a/source/sdk/ios/fundamentals/realms.txt b/source/sdk/ios/fundamentals/realms.txt index b0ae08c9ef..33788a05f5 100644 --- a/source/sdk/ios/fundamentals/realms.txt +++ b/source/sdk/ios/fundamentals/realms.txt @@ -188,10 +188,20 @@ comparable SQLite database. Unexpected file growth may be related to the .. tip:: Avoid pinning old Realm transactions {+backend-short+} ties read transaction lifetimes to the memory lifetime - of {+backend-short+} instances. Avoid “pinning” old Realm transactions. + of {+backend-short+} instances. Avoid "pinning" old Realm transactions. Use auto-refreshing {+backend-short+}s, and wrap the use of Realm APIs from background threads in explicit autorelease pools. +.. note:: + + A large {+realm+} file can cause problems for your app. Any single + {+realm+} file cannot be larger than the amount of memory your + application would be allowed to map in iOS. This limit depends on the + device and on how fragmented the memory space is at that point in + time. If you need to store more data, you can map it over multiple + {+realm+} files. There is an open `Radar issue + `__. + Threading ~~~~~~~~~ From e73f2afdc6500d9b09efd639650ee6e91cb15e46 Mon Sep 17 00:00:00 2001 From: Chris Bush Date: Mon, 3 May 2021 16:04:42 -0400 Subject: [PATCH 2/4] Address some comments --- source/sdk/ios/data-types/supported-property-types.txt | 5 ++--- source/sdk/ios/fundamentals/realms.txt | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/source/sdk/ios/data-types/supported-property-types.txt b/source/sdk/ios/data-types/supported-property-types.txt index f93cb55559..d5d1faf03e 100644 --- a/source/sdk/ios/data-types/supported-property-types.txt +++ b/source/sdk/ios/data-types/supported-property-types.txt @@ -146,6 +146,5 @@ store more than 16MB in a single property. To avoid size limitations and a performance impact, it is best not to store large blobs, such as image and video files, directly in a -{+realm+}. Instead, save the file to a file store (such as S3) and -keep only the location of the file and any relevant metadata in the -{+realm+}. +{+realm+}. Instead, save the file to a file store and keep only the +location of the file and any relevant metadata in the {+realm+}. diff --git a/source/sdk/ios/fundamentals/realms.txt b/source/sdk/ios/fundamentals/realms.txt index 33788a05f5..80a60be0a3 100644 --- a/source/sdk/ios/fundamentals/realms.txt +++ b/source/sdk/ios/fundamentals/realms.txt @@ -199,8 +199,7 @@ comparable SQLite database. Unexpected file growth may be related to the application would be allowed to map in iOS. This limit depends on the device and on how fragmented the memory space is at that point in time. If you need to store more data, you can map it over multiple - {+realm+} files. There is an open `Radar issue - `__. + {+realm+} files. Threading ~~~~~~~~~ From e5e1ef7e0ec3705523b9b7b7bd0e2d8e2cc1c1bb Mon Sep 17 00:00:00 2001 From: Chris Bush Date: Fri, 21 May 2021 15:02:05 -0400 Subject: [PATCH 3/4] Update source/includes/string-sort-and-query-limitations-note.rst Co-authored-by: Dachary --- source/includes/string-sort-and-query-limitations-note.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/string-sort-and-query-limitations-note.rst b/source/includes/string-sort-and-query-limitations-note.rst index bdb4378152..059c68b5b4 100644 --- a/source/includes/string-sort-and-query-limitations-note.rst +++ b/source/includes/string-sort-and-query-limitations-note.rst @@ -1,5 +1,5 @@ .. note:: - String sorting and case insensitive queries are only supported for + String sorting and case-insensitive queries are only supported for character sets in 'Latin Basic', 'Latin Supplement', 'Latin Extended A', and 'Latin Extended B' (UTF-8 range 0-591). From 609f1eff8918c568c0b99fe7989fee4137ee7cd7 Mon Sep 17 00:00:00 2001 From: Chris Bush Date: Wed, 2 Jun 2021 11:10:30 -0400 Subject: [PATCH 4/4] Address more comments --- source/sdk/ios/fundamentals/realms.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/sdk/ios/fundamentals/realms.txt b/source/sdk/ios/fundamentals/realms.txt index 80a60be0a3..510dd5318e 100644 --- a/source/sdk/ios/fundamentals/realms.txt +++ b/source/sdk/ios/fundamentals/realms.txt @@ -194,12 +194,12 @@ comparable SQLite database. Unexpected file growth may be related to the .. note:: - A large {+realm+} file can cause problems for your app. Any single - {+realm+} file cannot be larger than the amount of memory your - application would be allowed to map in iOS. This limit depends on the - device and on how fragmented the memory space is at that point in - time. If you need to store more data, you can map it over multiple - {+realm+} files. + A large {+realm+} file can impact the performance and reliability of + your app. Any single {+realm+} file cannot be larger than the amount + of memory your application would be allowed to map in iOS. This limit + depends on the device and on how fragmented the memory space is at + that point in time. If you need to store more data, you can map it + over multiple {+realm+} files. Threading ~~~~~~~~~