<commit_before>---
layout: documentation
title: Limitations in RethinkDB
active: limitations
docs_active: limitations
permalink: limitations/
alias: docs/limitations/
---

RethinkDB has a few hard limitations, as well as some soft limitations that are dependent on your server configurations.

## Cluster/shard limits ##

* There is no hard limit on the number of databases that can be created. 

* There is no hard limit on the number of shards, but the web interface will only accept a number of 32 or less. (You can use the command-line interface to add more shards; see [Sharding and replication](/docs/sharding-and-replication/) for more information.)

## Table/document limits ##

* There is no hard limit on the number of tables per database or cluster. However, performance degrades based on the total number of shards across all tables on a cluster. The current recommendation is to keep this number below 300 (i.e., 300 tables with one shard each, or 50 tables with six shards each).

* Each table requires a minimum of approximately 10MB disk space on each server in a cluster. (A completely empty table takes up 4MB.)

* While there is no hard limit on the size of a single document, there is a recommended limit of 16MB for memory performance reasons.

* The maximum size of a JSON query is 64M.

## Key lengths ##

* Primary keys are limited to 127 characters.

* Secondary keys are indexed on their first 238&minus;*PK* bytes, where *PK* is the primary key length of that table. If a secondary index has keys whose first 238&minus;*PK* bytes are identical, performance using those keys will be degraded, as RethinkDB will fall back on a linear search.

* Secondary indexes do not store objects or `null` values. See [Using secondary indexes](/docs/secondary-indexes/) for more details.

## Other notes ##

By default, arrays on the RethinkDB server have a size limit of 100,000 elements. This can be changed on a per-query basis with the `arrayLimit` (or `array_limit`) option to [run](/api/javascript/run). 

Some file systems, typically compressed or encrypted ones, may require the `--no-direct-io` option (see [Create a cluster on system startup](/docs/cluster-on-startup/) for more information on RethinkDB options).

There are currently issues with `btrfs`. Follow [issue #2781](https://github.com/rethinkdb/rethinkdb/issues/2781) for more information.
<commit_msg>Add per-table RAM overhead note; closes #581<commit_after>---
layout: documentation
title: Limitations in RethinkDB
active: limitations
docs_active: limitations
permalink: limitations/
alias: docs/limitations/
---

RethinkDB has a few hard limitations, as well as some soft limitations that are dependent on your server configurations.

## Cluster/shard limits ##

* There is no hard limit on the number of databases that can be created. 

* There is no hard limit on the number of shards, but the web interface will only accept a number of 32 or less. (You can use the command-line interface to add more shards; see [Sharding and replication](/docs/sharding-and-replication/) for more information.)

## Table/document limits ##

* There is no hard limit on the number of tables per database or cluster. However, performance degrades based on the total number of shards across all tables on a cluster. The current recommendation is to keep this number below 300 (i.e., 300 tables with one shard each, or 50 tables with six shards each).

* Each table requires a minimum of approximately 10MB disk space on each server in a cluster. (A completely empty table takes up 4MB.)

* Each table has an overhead of 8MB RAM on each server it's replicated on.

* While there is no hard limit on the size of a single document, there is a recommended limit of 16MB for memory performance reasons.

* The maximum size of a JSON query is 64M.

## Key lengths ##

* Primary keys are limited to 127 characters.

* Secondary keys are indexed on their first 238&minus;*PK* bytes, where *PK* is the primary key length of that table. If a secondary index has keys whose first 238&minus;*PK* bytes are identical, performance using those keys will be degraded, as RethinkDB will fall back on a linear search.

* Secondary indexes do not store objects or `null` values. See [Using secondary indexes](/docs/secondary-indexes/) for more details.

## Other notes ##

By default, arrays on the RethinkDB server have a size limit of 100,000 elements. This can be changed on a per-query basis with the `arrayLimit` (or `array_limit`) option to [run](/api/javascript/run). 

Some file systems, typically compressed or encrypted ones, may require the `--no-direct-io` option (see [Create a cluster on system startup](/docs/cluster-on-startup/) for more information on RethinkDB options).

There are currently issues with `btrfs`. Follow [issue #2781](https://github.com/rethinkdb/rethinkdb/issues/2781) for more information.

{'fraction_non_alphanumeric': 0.06845665095306415, 'fraction_numerical': 0.01721664275466284, 'mean_word_length': 4.333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '905112', 'n_tokens_mistral': 1345, 'n_tokens_neox': 1241, 'n_words': 708}