Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Client Tools

Nervix ships two interactive clients, and both speak the same language to the same place: they open a session against the cluster’s session API and submit NSPL to the leader. Almost every statement in this book can be typed into either one, and neither is required — a Nervix cluster is administered entirely through NSPL, whatever submits it.

Choosing A Client

ClientWhere it runsUse it for
Command Line Clientyour terminal, installed separatelyinteractive work, scripting, shell completions, streaming a relay to stdout, node administration
Web Consoleyour browser, served by every nodereading a running graph, exploring an unfamiliar domain, guided subscriptions, uploading resources, taking and restoring backups
Rust Client Libraryyour own programembedding Nervix control and subscriptions in a Rust application

One further tool is not a client at all: nervix-nspl-format formats saved .nspl files and checks that they are formatted. It never opens a session.

The console is the better tool for understanding a graph you did not write, because it draws one. The command line client is the better tool for repeating yourself, because it can be scripted.

Only a few things differ. Uploading a resource version, and restoring a backup archive, name a local path in the command line client and use a file picker in the console; a backup’s archive is written to a local file by the command line client and saved as a browser download by the console, and only the command line client reads an archive with DESCRIBE BACKUP; the command line client follows a domain clock from its domain-clock subcommand or with ATTACH DOMAIN CLOCK, while the console follows the clock of the domain it has selected and shows it in its clock panel; the console additionally offers guided actions — clicking a graph item or an entity — that simply type NSPL for you.

What Every Client Shares

  • The same statement surface. Domains, schemas, codecs, relays, clients, runtime nodes, and emitters are all declared in NSPL (NSPL Overview).
  • Session and transaction statements. USE, LIST DOMAINS, UPLOAD RESOURCE, CREATE SUBSCRIPTION, DELETE SUBSCRIPTION, ATTACH DOMAIN CLOCK, and DETACH DOMAIN CLOCK are session/client operations. BEGIN, COMMIT, and REVERT operate on a leader-owned, replicated transaction.
  • Server-driven completion. Suggestions come from the cluster, not from a local copy of the grammar, so they include the identifiers that actually exist in the active domain. Inside a transaction they also include the identifiers its queued statements define.
  • HTTP Basic authentication against a registry user.
  • Automatic leader redirects. A session opened against a follower is redirected to the current leader; you do not need to know which node leads.
  • Automatic transaction attach. Both interactive clients retain the transaction id and attach it before replaying a command after reconnect or leader failover, and do not repeat an operation whose replicated progress already advanced.

Sessions, subscriptions, sampling, backpressure, and domain clock attachment are described in Sessions.

To get a cluster running first, see Installation and Running Nervix.