Lark enforces the same limits as Firebase Realtime Database, with one exception: there are no rate limits on volatile writes or events.
Data tree
Keys
Keys are the path segments that identify children in the JSON tree.
| Constraint | Limit |
|---|
| Max length | 768 UTF-8 bytes |
| Forbidden characters | . $ # [ ] / newlines |
| Control characters | ASCII 0x00–0x1F and 0x7F are not allowed |
| Reserved prefix | Keys starting with . are reserved for internal use (.priority, .value, .sv) |
| Max depth | 32 levels — each path must be fewer than 32 levels deep |
Characters like . and $ are common in many systems (email addresses, MongoDB field names, template strings) but are forbidden in Lark keys. If you need to store an email as a key, encode it first — for example, replace . with , or use a hash.
Values
| Constraint | Limit |
|---|
| Max string size | 10 MB (UTF-8 encoded) |
Data types
Lark stores JSON. The supported value types are:
| Type | Example |
|---|
| String | "hello" |
| Number | 42, 3.14, -1 |
| Boolean | true, false |
| Object | { "key": "value" } |
| Null | null (deletes the node) |
Writing null to a path deletes it. There’s no separate “delete” wire operation — a null write and a remove are the same thing.
A note on arrays
Lark doesn’t have a native array type. If you write a JSON array, Lark converts it to an object with integer keys:
// You write this:
await db.ref('items').set(['apple', 'banana', 'cherry']);
// Lark stores this:
// { "0": "apple", "1": "banana", "2": "cherry" }
This works, but it’s fragile. If two clients modify the array at the same time, they’ll overwrite each other’s changes. For lists that multiple clients might modify, use push to generate unique keys instead.
Reads
| Constraint | Limit |
|---|
| Max single response size | 256 MB |
| Max nodes in a listened/queried path | 75 million (cumulative) |
| Max query duration | 15 minutes |
If you need to read data larger than 256 MB at a single location, paginate with a query or use shallow reads.
For paths with more than 75 million nodes, listen to or query more specific child paths instead of the entire subtree.
Writes
| Constraint | Limit |
|---|
| Write rate | 1,000 writes/second per database |
| Volatile write rate | No limit |
| Max write payload (SDK) | 16 MB (JSON-encoded) |
| Max write payload (REST API) | 256 MB |
| Bytes written | 64 MB/minute per database |
| Volatile write max size | 2 KB |
The write payload limit applies to the entire JSON body of a single write operation — including set, update, and push. Multi-path updates are subject to the same limit across all paths combined.
The 16 MB limit is on the JSON-encoded payload, not the in-memory size. JSON encoding adds overhead for keys, quotes, and structural characters, so the effective data limit is somewhat less than 16 MB.
Volatile exceptions
Volatile paths have no rate limit on writes per second or events per second. The 1,000 writes/second and 64 MB/minute limits apply only to regular (persisted) writes. The 2 KB per-write size limit still applies to volatile writes.
Connections
| Constraint | Limit |
|---|
| Simultaneous connections | 200,000 per database |
A simultaneous connection is one mobile device, browser tab, or server app connected to the database. This isn’t the same as your total user count — users don’t all connect at once. An app with millions of monthly users typically has far fewer simultaneous connections.
To scale beyond 200,000 connections, use multiple databases. See database routing for patterns on splitting data across databases.
Summary
| Category | Constraint | Limit |
|---|
| Keys | Max length | 768 UTF-8 bytes |
| Keys | Forbidden characters | . $ # [ ] / newlines, control chars |
| Keys | Max depth | 32 levels |
| Values | Max string size | 10 MB |
| Reads | Max response size | 256 MB |
| Reads | Max nodes in queried path | 75 million |
| Reads | Max query duration | 15 minutes |
| Writes | Write rate | 1,000/sec per database |
| Writes | Max payload (SDK) | 16 MB |
| Writes | Max payload (REST) | 256 MB |
| Writes | Bytes written | 64 MB/min per database |
| Writes | Volatile max size | 2 KB |
| Writes | Volatile rate limit | None |
| Connections | Simultaneous | 200,000 per database |
What’s next