Skip to main content

Data tree

Keys

Keys are the path segments that identify children in the JSON tree.
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

Data types

Lark stores JSON. The supported value types are: 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:
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

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

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

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, since 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.

Summary

What’s next

Volatile paths

High-frequency data with no rate limits.