# What's the reasonable array list limit for MongoDB?

**URL:** <https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518>\
**Category:** Uncategorized\
**Tags:** mongodb\
**Created:** [July 7, 2020, 11:25am UTC](https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518 "2020-07-07T11:25:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![uzaysan](https://community.parseplatform.org/user_avatar/community.parseplatform.org/uzaysan/32/59_2.png) [@uzaysan](https://community.parseplatform.org/u/uzaysan)\
**Post date:** [July 7, 2020, 11:25am UTC](https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518/1 "2020-07-07T11:25:12Z")

</div>

I’m adding every word of text or hashtags to array list. What’s the logical limit for mongo arrays? How many objects should i add max?

My array is indexed. And only have one array field per object.

---

<div class="post-metadata">

**Author:** ![Manuel](https://community.parseplatform.org/user_avatar/community.parseplatform.org/manuel/32/186_2.png) [@Manuel](https://community.parseplatform.org/u/Manuel)\
**Post date:** [July 7, 2020, 2:30pm UTC](https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518/2 "2020-07-07T14:30:39Z")

</div>

~~From the [docs](https://docs.parseplatform.org/js/guide/#limits-and-other-considerations):~~

> ~~Parse Objects are limited in size to 128 KB.~~

In addition, the general limits of [MongoDB BSON documents](https://docs.mongodb.com/manual/reference/limits/#data) apply.

_Edit: The object size limitation has been removed in Parse open source._

---

<div class="post-metadata">

**Author:** ![uzaysan](https://community.parseplatform.org/user_avatar/community.parseplatform.org/uzaysan/32/59_2.png) [@uzaysan](https://community.parseplatform.org/u/uzaysan)\
**Post date:** [July 7, 2020, 8:01pm UTC](https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518/3 "2020-07-07T20:01:19Z")

</div>

Hi @Manuel. Thank you. But Can bigger array list decrease performance? I mean 10 object array and 1000 object array. does query performance is same? when they are indexed?

---

<div class="post-metadata">

**Author:** ![Manuel](https://community.parseplatform.org/user_avatar/community.parseplatform.org/manuel/32/186_2.png) [@Manuel](https://community.parseplatform.org/u/Manuel)\
**Post date:** [July 7, 2020, 8:20pm UTC](https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518/4 "2020-07-07T20:20:42Z")

</div>

It depends on which performance you look at, object size always have some kind of performance implication, just to mention a few:

- Your MongoDB collection will grow, which is likely to increase your working set size, which will make your DB use more RAM, unless you go deep into MongoDB and use smart indexing and queries to counter that.
- Network traffic will increase which can be a significant cost factor, unless you can often exclude the keys you don’t need from the query, see the `select` command in the Parse SDKs.
- In Parse Server, the de-/serialization from JSON to Parse objects take longer for large objects, this process is known to already have a significant performance impact, see [this](https://github.com/parse-community/parse-server/issues/6543), so a larger object size is likely to increase that, but I don’t know if the increase is O(N) or more.
- If you send the whole object to the client, there is obviously another performance implication on the client side, including the data traffic for the user which can be an issue in developing countries where network data is still costly.

---

<div class="post-metadata">

**Author:** ![uzaysan](https://community.parseplatform.org/user_avatar/community.parseplatform.org/uzaysan/32/59_2.png) [@uzaysan](https://community.parseplatform.org/u/uzaysan)\
**Post date:** [July 8, 2020, 5:42am UTC](https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518/5 "2020-07-08T05:42:21Z")

</div>

My objects are generally smaller than 2KB. Is this ok?

---

<div class="post-metadata">

**Author:** ![Moumouls](https://community.parseplatform.org/user_avatar/community.parseplatform.org/moumouls/32/332_2.png) [@Moumouls](https://community.parseplatform.org/u/Moumouls)\
**Post date:** [July 10, 2020, 11:30pm UTC](https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518/6 "2020-07-10T23:30:42Z")

</div>

@Manuel in open source version of parse, the limit of 128KB on Parse Object no longer exists. But I totally agree with you, having big objects will lead to massive issue on query/network performance.

@uzaysan, if you array will contain 1 to X objects depending of a user input in 99% of the time you should switch it to a Relation style.

An exception could be to use an hidden array ( never retreived to final user via exclude option ) for some smart meta searching engine needs ( I already used this type of array with 100 elements into the array for powerful text searching on a Parse Object )

---

<div class="post-metadata">

**Author:** ![Moumouls](https://community.parseplatform.org/user_avatar/community.parseplatform.org/moumouls/32/332_2.png) [@Moumouls](https://community.parseplatform.org/u/Moumouls)\
**Post date:** [July 10, 2020, 11:34pm UTC](https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518/7 "2020-07-10T23:34:46Z")

</div>

To minimize bandwidth exchange on both user and backend size, using the GraphQL API is a good option since GraphQL optimize and only retrieve needed fields. We also added on the backend implementation some optimization to only extract from the database needed fields for the query response: so a win for your users and a a win for you ( performance and less network traffic )

---

<div class="post-metadata">

**Author:** ![Manuel](https://community.parseplatform.org/user_avatar/community.parseplatform.org/manuel/32/186_2.png) [@Manuel](https://community.parseplatform.org/u/Manuel)\
**Post date:** [July 11, 2020, 1:34am UTC](https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518/8 "2020-07-11T01:34:59Z")

</div>

> [@Moumouls](#):
>
> @mtrezza in open source version of parse, the limit of 128KB on Parse Object no longer exists.

Uh, that totally missed my radar, but thanks for correcting, it’s still all over the [docs](https://docs.parseplatform.org/js/guide/#limits-and-other-considerations), I will open a PR.

---

<div class="post-metadata">

**Author:** ![uzaysan](https://community.parseplatform.org/user_avatar/community.parseplatform.org/uzaysan/32/59_2.png) [@uzaysan](https://community.parseplatform.org/u/uzaysan)\
**Post date:** [July 11, 2020, 5:30am UTC](https://community.parseplatform.org/t/whats-the-reasonable-array-list-limit-for-mongodb/518/9 "2020-07-11T05:30:41Z")

</div>

> [@Moumouls](#):
>
> An exception could be to use an hidden array ( never retreived to final user via exclude option ) for some smart meta searching engine needs ( I already used this type of array with 100 elements into the array for powerful text searching on a Parse Object )

Omg. That’s what I’m doing right now. Except i didn’t use exclude option but i will use it from now. Glad to hear that I’m in the right path.
