Meta tags:
description= Oxia: Scalable Metadata and Index storage;
Headings (most frequently used words):
records, client, node, js, sdk, deleting, and, installing, api, initializing, the, writing, reading, range, of, listing, keys, scanning, sessions, ephemerals, notifications, sequence, updates,
Text of the page (most frequently used words):
client (47), the (40), key (26), await (21), const (19), for (18), oxia (17), and (16), records (15), keys (14), partitionkey (10), value (10), users (10), node (10), see (9), #sequence (9), delete (9), notifications (8), put (8), version (8), reference (7), shard (7), ephemerals (7), secondary (7), record (7), tsdoc (6), log (6), console (6), with (6), ephemeral (6), list (6), get (6), from (6), oxiaclient (6), architecture (6), updates (5), namespace (5), are (5), session (5), sdk (5), useindex (5), options (5), write (5), connect (5), api (5), use (4), events (4), versionid (4), when (4), index (4), range (4), via (4), deleting (4), expectedversionid (4), metadata (4), comparisontype (4), partition (4), number (4), documentation (4), protocol (4), python (3), java (3), new (3), specific (3), close (3), type (3), both (3), streams (3), sessions (3), first (3), rangescan (3), server (3), single (3), max (3), all (3), operation (3), available (3), method (3), conditional (3), only (3), full (3), default (3), floor (3), description (3), option (3), import (3), reading (3), indexes (3), expected_record_does_not_exist (3), grpc (3), 30000 (3), sessiontimeoutms (3), operations (3), sdks (3), 2026 (2), policies (2), https (2), latestkey (2), change (2), call (2), true (2), email (2), xff (2), decode (2), decoder (2), textdecoder (2), scan (2), values (2), out (2), asynciterable (2), scanning (2), without (2), min (2), listing (2), every (2), pass (2), route (2), set (2), read (2), false (2), includevalue (2), equal (2), returns (2), secondaryindexes (2), monotonic (2), sequencekeysdeltas (2), expectation (2), that (2), not (2), writing (2), attached (2), authentication (2), timeout (2), identity (2), string (2), clientidentifier (2), localhost (2), 6648 (2), initializing (2), github (2), npm (2), installing (2), this (2), page (2), light (2), storage (2), replication (2), coordinator (2), consensus (2), maelstrom (2), tla (2), safety (2), correctness (2), physical (2), logical (2), design (2), goals (2), metrics (2), configuration (2), schema (2), cli (2), admin (2), security (2), bare (2), metal (2), resources (2), helm (2), kubernetes (2), deployment (2), versioning (2), sorting (2), namespaces (2), consistency (2), model (2), features (2), migrating (2), etcd (2), getting (2), started (2), what (2), blog (2), ctrl (2), copyright, 2023, series, projects, llc, website, terms, trademark, policy, other, project, please, lfprojects, org, last, updated, july, complete, semantics, getsequenceupdates, prefix, shouldstop, getnotifications, feed, exposed, iterate, you, done, end, subscription, closeableasynciterable, managed, transparently, creates, per, heartbeats, cleaned, closes, expires, lifecycle, details, accept, returning, result, stream, they, arrive, break, loop, cancel, underlying, byemail, scoped, narrow, query, fetching, fans, scope, deleterange, whose, fall, within, succeed, matches, unconditional, supports, deletes, using, based, expectations, look, named, non, modes, shards, unless, higher, lower, ceiling, style, closest, lookup, meta, skips, payload, indexname, secondarykey, assigned, suffixes, bind, assert, absence, locate, related, offset, 12345, attach, entry, time, event, data, atomic, appends, suffix, requires, host, port, workers, worker, deleted, automatically, ends, second, previous, there, was, any, will, fail, has, changed, since, does, already, exist, specified, parameter, undefined, credentials, tokenauthentication, initial, assignment, fetch, inittimeoutms, deadline, each, unary, rpc, long, lived, unbounded, requesttimeoutms, random, uuid, stable, 2000ms, heartbeat, cadence, must, heartbeatintervalms, milliseconds, creating, possible, several, create, instance, once, created, can, used, multiple, async, contexts, until, called, fully, asynchronous, streaming, return, targets, ships, typescript, definitions, promise, package, published, install, scroll, top, edit, question, give, feedback, store, coordination, system, skip, content,
Text of the page (random words):
node js client sdk oxia skip to content oxia metadata store and coordination system documentation blog ctrl k ctrl k documentation what is oxia getting started migrating from zk etcd features consistency model ephemerals namespaces notifications key sorting partition keys secondary indexes sequence keys versioning client sdks go java node js python deployment kubernetes helm resources bare metal security admin operations reference cli configuration schema grpc api metrics architecture design goals logical architecture physical architecture correctness protocol safety tla maelstrom consensus coordinator oxia replication protocol storage blog light what is oxia getting started migrating from zk etcd features consistency model ephemerals namespaces notifications key sorting partition keys secondary indexes sequence keys versioning client sdks go java node js python deployment kubernetes helm resources bare metal security admin operations reference cli configuration schema grpc api metrics architecture design goals logical architecture physical architecture correctness protocol safety tla maelstrom consensus coordinator oxia replication protocol storage light on this page installing node js client sdk client api initializing the client writing records reading records deleting records deleting a range of records listing keys scanning records sessions and ephemerals notifications and sequence updates question give us feedback edit this page on github scroll to top documentation client sdks node js node js client sdk installing node js client sdk npm install oxia db client the package is published on npm as oxia db client tsdoc reference documentation is available at https oxia db github io oxia client node api client api the node js client is fully asynchronous every operation returns a promise and streaming operations return an asynciterable it targets node js 18 and ships with typescript type definitions initializing the client to use the oxia client create an instance via oxiaclient connect once created a client can be used from multiple async contexts until close is called import oxiaclient from oxia db client const client await oxiaclient connect localhost 6648 when creating the client it is possible to pass several options const client await oxiaclient connect localhost 6648 namespace my namespace clientidentifier my client identity available oxiaclient connect options option type description default namespace string oxia namespace to use default sessiontimeoutms number session timeout for ephemeral records in milliseconds 30000 heartbeatintervalms number heartbeat cadence must be sessiontimeoutms max sessiontimeoutms 10 2000ms clientidentifier string stable client identity attached to ephemeral records random uuid requesttimeoutms number deadline for each unary rpc long lived streams are unbounded 30000 inittimeoutms number timeout for the initial shard assignment fetch 30000 authentication authentication credentials attached as grpc metadata see tokenauthentication undefined for the full parameter list see the oxiaclient connect tsdoc writing records import expected_record_does_not_exist from oxia db client write a record to oxia with the specified key and value and with the expectation that the record does not already exist const first await client put my key value 1 expectedversionid expected_record_does_not_exist write a record with the expectation that it has not changed since the previous write if there was any change the operation will fail const second await client put my key value 2 expectedversionid first version versionid ephemeral record deleted automatically when the client session ends await client put workers worker 1 host port ephemeral true atomic sequence key server appends a monotonic suffix requires a partition key const key await client put events event data sequencekeysdeltas 1 partitionkey events attach a secondary index entry at write time await client put offset 12345 secondaryindexes partition p 17 put options option description partitionkey route to a specific shard co locate related keys expectedversionid conditional write use expected_record_does_not_exist to assert absence ephemeral bind the record to the client session see ephemerals sequencekeysdeltas server assigned monotonic suffixes see sequence keys secondaryindexes indexname secondarykey see secondary indexes full reference put method tsdoc reading records reading the value of a record import comparisontype from oxia db client const key value version await client get my key console log new textdecoder decode value metadata only read skips the value payload const meta await client get my key includevalue false range style get returns the closest key the lookup key const floor await client get users 50 comparisontype comparisontype floor get options option description comparisontype equal default floor ceiling lower higher non equal modes scan all shards unless partitionkey is set includevalue set to false for a metadata only read partitionkey route to a specific shard useindex look up via a named secondary index full reference get method tsdoc deleting records delete a single record by key supports conditional deletes using version based expectations unconditional delete await client delete my key conditional delete only succeed if the version matches await client delete my key expectedversionid version versionid all the options for the delete operation are available in the delete method tsdoc deleting a range of records delete all records whose keys fall within min max await client deleterange users users without partitionkey the call fans out to every shard pass partitionkey to scope the delete to a single shard listing keys list keys in min max without fetching values const keys await client list users users for const key of keys console log key narrow to a single shard via partitionkey or query a secondary index via useindex const scoped await client list users users partitionkey users const byemail await client list xff useindex email scanning records scan records in a key range returning both keys and values the result is an asynciterable so records stream as they arrive break out of the loop to cancel the underlying server streams const decoder new textdecoder for await const key value version of client rangescan users users console log key key value decoder decode value version version versionid with a secondary index for await const key of client rangescan xff useindex email console log key list and rangescan both accept partitionkey and useindex sessions and ephemerals sessions are managed transparently the first put ephemeral true creates a per shard session the client sdk heartbeats it and ephemerals are cleaned up when the client closes or the session expires see ephemerals for the lifecycle details notifications and sequence updates both streams are exposed as closeableasynciterable t iterate with for await and call close when you re done to end the subscription change feed for the namespace const notifications client getnotifications for await const n of notifications console log n type n key n versionid if shouldstop notifications close updates for a specific sequence prefix const updates client getsequenceupdates events partitionkey events for await const latestkey of updates console log new sequence key latestkey see notifications and sequence keys for semantics for the complete reference see the tsdoc reference last updated on july 9 2026 java python copyright 2023 2026 oxia a series of lf projects llc for website terms of use trademark policy and other project policies please see https lfprojects org policies
|