Home

keyrange

Keyrange is a term used in information systems to denote a contiguous interval in the key space that bounds a set of keys. It is commonly used to describe data partitions, range scans, or routing boundaries in distributed storage and databases. A keyrange is typically defined by a lower bound and an upper bound, with optional flags to indicate whether the endpoints are inclusive or exclusive. Depending on the system, keys may be numeric or lexicographically ordered strings, and the exact ordering rules determine how boundaries are interpreted.

In practice, keyranges enable partitioning and pruning: a shard, node, or region can be responsible for all

For example, in a system with keys 0 through 9999, a shard might handle the keyrange [0,

Implementation considerations include representing a KeyRange as a simple data structure or object with methods such

Related concepts include range partitioning, shard key, and range query. A keyrange is a descriptor of the

records
whose
keys
lie
within
its
keyrange,
allowing
queries
or
scans
to
skip
irrelevant
data.
They
also
support
data
migration
and
backup
by
range,
where
ranges
are
moved
or
backed
up
independently.
1999],
another
[2000,
4999],
and
so
on.
In
a
document
store
using
string
keys,
a
keyrange
could
be
["user:0000",
"user:0999"].
as
contains(key),
intersects(other),
and
isEmpty().
Care
is
needed
to
be
explicit
about
inclusive
versus
exclusive
bounds
and
key
encoding,
as
different
systems
use
different
conventions.
data
scope
used
by
queries
and
routing
decisions,
rather
than
a
query
itself.