Query Snapshots
Every aggregate keeps a snapshot of its latest state, and the snapshots are a read model you can query without writing a projection: filter by any field of the state, sort, page, count and aggregate. This page writes queries in Kotlin and over HTTP, and declares the indexes and masks they need. Query Language is the full grammar; Read State reads one aggregate by its id.
Write a query in Kotlin
The DSL of me.ahoo.wow.api.query.dsl (in wow-query-api) builds queries. With wow-query-api on the domain module's class path, the compiler generates <State>Properties beside each state: one QueryField constant per path a query can name, so a renamed field is a compile error, not a query that silently matches nothing. The catalog's storefront lists the published products of a category from five onwards, cheapest first:
val query = listQuery {
filter {
ProductStateProperties.STATE__CATEGORY_ID eq category
ProductStateProperties.STATE__STATUS eq ProductStatus.PUBLISHED
ProductStateProperties.STATE__PRICE gte BigDecimal("5.00")
}
sort { ProductStateProperties.STATE__PRICE.asc() }
}
// In process, typed: the node's own queries (NodeQueryApi), as trusted code.
val products = catalog.context.getBean(NodeQueryApi::class.java).trusted().snapshots<ProductState>()
val rows = runBlocking { products.list(query).toList() }
rows.map { it.ref.id }.assert().containsExactly(five, seven)
rows.map { it.state.price }.assert().containsExactly(BigDecimal("5.00"), BigDecimal("7.00"))- A
filter { }block's conditions combine withand;and { },or { },nor { }andnot { }nest. A value is compared as the JSON it writes as, so an enum matches its name. "state".path { }names its block's fields understate, the same way in afilter, asortand aprojection:sort { "state".path { "price".asc() } }. A field already under the path, such asProductStateProperties.STATE__PRICE, stays as it is.beforeNowandafterNowcompare a field with the server's clock plus akotlin.time.Duration:"state.createdAt".afterNow((-30).minutes)is within the last half hour.ProductStateProperties.STATE__PRICEisstate.price; the system fields (AGGREGATE_ID,OWNER_ID,VERSION,LAST_EVENT_TIME,ACCESS, …) come fromSnapshotProperties, andSnapshotProperties.access(name)is the access attributeaccess.<name>.snapshots<ProductState>()decodes each row as aSnapshot<ProductState>: itsref,version,scope,accessand typedstate. A query that projects fields cannot fill a typed row: run it throughdynamic<Map<String, Any?>>()instead.of(caller)runs the query as that caller sees the model;trusted()as trusted code (Read State).
The kinds of query
| Builder | Answers |
|---|---|
singleQuery { } | The first match, or null |
listQuery { } | Up to limit matches |
pagedQuery { } | One page (pagination { index(1); size(20) }), with a total as total(...) asks |
cursorQuery { } | A keyset page after a cursor, with the next cursor; needs a sort |
countQuery { } | How many match, with whether the count is exact |
aggregation { } | Groups and metrics: terms, histograms, dates; count, sum, average, … Experimental: opt in with @OptIn(ExperimentalWowApi::class) |
The DSL is how Kotlin builds a query; Java, which has no DSL, builds the same types with their factories, such as ListQuery.of(filter) and Sort.of(field, Sort.Direction.ASC). The query types are plain values: compare them, but build a changed one anew rather than copying it.
A list read whole is bounded by its limit. To read every row of a large result, stream it: stream(query) reads keyset chunks, each its own query, and gives each row a position from which the same query can go on, on this node or another.
Over HTTP
Each aggregate type serves its snapshot queries at POST /<context>/<aggregate>/snapshot/query. The body is the query in JSON, its operation in kind:
curl -X POST localhost:8081/eshop-catalog/product/snapshot/query \
-H 'Content-Type: application/json' \
-d '{"kind":"paged","filter":{"op":"eq","field":"state.status","value":"PUBLISHED"},
"sort":[{"field":"state.price","direction":"asc"}],"pagination":{"index":1,"size":20}}'GET on the same path answers the model's capability descriptor: its fields and their types, the operators each takes, and the limits; its version is its ETag. The service's read authorizers are asked first, as for a query: a caller they refuse is answered their refusal and sees nothing of the model. Clients and the view engine read it to offer only what the model can answer.
A list with Accept: text/event-stream streams its rows as server-sent events, one row per record, then an end:
val events = catalog.stream(PRODUCTS, """{"kind":"list","filter":${published(category)}}""", BUYER)
// One row per record, then the end of a resumable stream.
events.map { it.first }.assert().containsExactly("row", "row", "row", "end")
WowJson.mapper.readTree(events.last().second)["reason"].asString().assert().isEqualTo("complete")
val streamed = events.dropLast(1).map { (_, data) -> WowJson.mapper.readTree(data)["aggregateId"].asString() }
streamed.assert().containsExactlyInAnyOrderElementsOf(filed)Each row event's id is its position. A stream ends with {"reason":"complete","resumable":false}, or, after wow.query.stream.max-hold (30 s), with {"reason":"hold-expired","resumable":true}; the client resumes it by sending the last id as Last-Event-ID.
Who sees what
A query is admitted as its caller:
- The caller's tenant is added to every query, and so are its owner and space where it has them: the owner on an aggregate of
Ownership.OWNER, the space on every aggregate. A tenant-level caller, without an owner, sees every aggregate of its tenant within its space; an aggregate that belongs to its tenant (Ownership.TENANT) is seen by every caller of the tenant within its space, owner-level ones included (Who reads it). - An aggregate with an access policy, an
AccessPolicybean of the service's own, is read by what itsreadgrants the caller, in place of the owner and space: the predicate is a filter the store applies (Where a policy applies). - Before any of this, the service's read authorizers (
ReadAuthorizerbeans) may refuse the caller, by who it is, never by what it asks. That is how a service keeps an aggregate of its tenant to some roles (Authorize reads). - Deleted aggregates are left out unless the query names their deletion state,
deletion(DeletionState.ALL)ordeleted. - A query the read side refuses answers
400 wow.query.invalid, its violations naming each rule it broke; a caller a read authorizer refuses, or one that names aWow-Scopeit may not,403 wow.auth.forbidden; asinglethat matches nothing404 wow.query.not-found.
Bounds
Every query runs under a budget: wow.query.budgets.http.* for HTTP, wow.query.budgets.in-process.* in Kotlin. A list returns at most max-list-size (1,000), 100 when it names no limit; a page at most max-page-size (100) rows; a count stops at count-limit and says whether it is exact; a query runs at most timeout (30 s). A query over the bound is refused, not truncated without notice. A page is bounded the same way in process, trusted() included: a paged query of more than max-page-size rows fails with In-process page size[200] must be between 1 and 100., and a 9.x job that read "the first page of 200" fails on its first run. As any exception of a handler, it is retried within the handler's budget and then its entry is parked (Failures and Retries). Page by at most max-page-size, raise wow.query.budgets.in-process.max-page-size if the job's pages must be larger, or read with unbounded() or a stream. So is 9.x's limit(Int.MAX_VALUE): code that must read every match, a job or a migration step rather than a read for a caller, uses NodeQueryApi.trusted().unbounded(), which drops the in-process budget for its own timeout (wow.query.unbounded-timeout) and reads every tenant, or streams them. A query that runs out of time answers 504 wow.query.timeout: narrow it rather than run it again. A store that has as many queries running as it allows answers 429 wow.query.busy with Retry-After.
Declare indexes
A query that filters or sorts by a field without an index scans the store. @QueryIndex on a state field declares the index the backend builds at startup, as the ddl of its store says (wow.ddl by default; validate refuses to start while one is missing, or is not the index the backend plans: one of another definition, such as one built by an earlier release, which auto rebuilds once); with adds the fields that follow it, for the usual filter and sort together. The storefront filters products by category, brand and status, and sorts them by price:
@field:QueryIndex
var price: BigDecimal = BigDecimal.ZERO
private set
@field:QueryIndex(with = ["state.status", "state.price"])
var brandId: String? = null
private set
@field:QueryIndex(with = ["state.status", "state.price"])
var categoryId: String? = null
private set
@field:QueryIndex(with = ["state.price"])
var status: ProductStatus = ProductStatus.DRAFT
private setThe annotations go on the field (@field:), since the compiler reads them from the compiled state. A key is a field of the snapshot query model: a system field (tenantId, aggregateId, version, ownerId, spaceId, deleted, firstEventTime, lastEventTime, and the operators' operator.id, operator.tenantId, operator.actedElsewhere and the same of firstOperator), an access attribute the aggregate declares (access.<name>), or a state. path. The build refuses any other, naming the index and the key.
Sort direction
An index serves a sort by its keys in both directions: the store reads it forward or backward. So @QueryIndex has no direction, and a "latest first" list needs none:
- Latest first, over all of them: index the time alone. That is
@QueryIndex(on = "lastEventTime")on the state class for when a snapshot last changed, or@field:QueryIndexon a time field of the state held as epoch milliseconds (aLong), such ascreatedAt. A time held as a date string (anInstant,format: date-time) is refused at the start on PostgreSQL and MongoDB, which store it as text that neither ranges nor sorts; Elasticsearch indexes it. - Latest first within a status:
@field:QueryIndex(with = ["lastEventTime"])onstatus. A query equal on the leading key reads the next one in order, either way.
@QueryIndex(on = "lastEventTime")
data class OrderState(
@field:QueryIndex(with = ["lastEventTime"])
val status: OrderStatus,
)A direction would matter only for a sort that runs two keys in opposite directions, neither of them fixed by an equality: status ascending, then the newest first within each status. An index on those keys does not give that order: the store sorts the matches it reads, which costs more as they grow.
Describe what types cannot
A few more annotations of me.ahoo.wow.api.query.annotation tell the query model what a field's type alone does not:
| Annotation | Declares |
|---|---|
@QueryTemporal | An integer holding an epoch time in a unit, or a string formatted with a pattern. Such a string is ranged and sorted as its text, so only a pattern that writes its fields from the year down at fixed widths (yyyy-MM-dd HH:mm:ss) is; any other (dd/MM/yyyy, HH:mm) compares by equality only, as a Duration, Period or OffsetTime field does, since that text does not order as its values |
@QueryDecimal, @QueryMoney | A fixed-point decimal; an amount of money in a currency |
@QueryDuration | A length of time counted in a unit |
@QueryReference | The id of another aggregate |
@QueryAlias | Other paths a query may use for the field, such as its name before a rename; input only, as a response holds the field under its own path, so the rename itself still breaks the state's readers. An alias is a full path, so it names one field: the build refuses one on a class held at two places of a state or of an aggregate's events (two properties of one event, or two events under different names, whatever the alias's root), one below a map's values, one that is the path of a field (another one's, its own or a system field's), and one that is no query path, naming the places |
@QueryText | Prose a reader searches by words, such as a name or a description: a search may name it, and one that names no field reads it (on Elasticsearch) |
@Sensitive | A string masked in every result: DISPLAY may still be filtered and sorted, CONFIDENTIAL never is |
A level a later 10.x release adds protects no more than masking: a level that protects more than CONFIDENTIAL comes only with a major version, since every node would have to read it first. So a node that meets a level it does not know, in another service's catalog row say, treats it as CONFIDENTIAL, masked and never compared, and never protects it less than the level asks.
A masked field is masked for every caller, in queries, state reads, event queries and traces alike, in the warehouse's catalog, and in the state view cache. It is masked where Wow returns it as a read and where Wow publishes it to other contexts, not where Wow stores it: Where masking stops. A DISPLAY value has two exceptions, each said in so many words: the service's own read of it (below), and a published stream whose owner declares that it reveals it (Where masking stops). A schedule's command, which its event wow.schedule.ScheduleSet holds until the command is sent, is masked as a body of its command type is, by that command's schema, a peer's contract's for a command of another context (Scheduling).
A recursive type, such as a tree whose children are trees, holds no @Sensitive value, in a state, an event or a command. A value is masked by its path, and no path reaches one below the recursion, so the build refuses such a type, naming the payload, the cycle of types and the value. Hold the tree flat, its nodes in a list or a map keyed by id, each naming its parent, which a query can also filter and sort; or keep the sensitive value out of the recursive type.
What the node finds no schema for is answered masked whole, never as stored: an event its Manifest does not know, by its name, such as one no event class of the aggregate has, which an imported 9.x stream may hold, or at a revision newer than the Manifest's, such as one a newer node writes during a rolling update; and a scheduled command whose schema the node does not hold: of a type no Manifest names, or one a Manifest or a peer's contract lists without its definition, or one of Wow's own command types (wow.schedule.SetSchedule, wow.lifecycle.*), the command it holds with it. An event query answers its body, or the schedule's command, as null, its name and revision as stored. To keep reading such an event, keep it declared: an event class of the aggregate, or a former name of one (@Alias, Event Evolution). A retired event is left out of an event query, as before. A trace replays the events, so it refuses a commit the node cannot read rather than answer it, and a published stream does not write it: its sink retries the entry and parks the aggregate, as it does any entry it cannot read. Wow's own events (wow.lifecycle.*, wow.schedule.*) are known to every node. An event or a state of the node's own aggregates always has its schema: a node does not start on a Manifest fragment that names a schema it does not hold, or names one otherwise than #/$defs/<key> (Troubleshooting), as its build refuses such a fragment.
Read a DISPLAY value raw
The service's own code may need a DISPLAY value as it is: the phone number it sends a message to, or the e-mail address it writes to. It asks for it by name. revealed() gives queries that return every DISPLAY value raw:
trusted().revealed()on the node'sNodeQueryApi;context.queries.revealed()in a subscription handler, still pinned to the tenant of its commit.
val customer = queries.trusted().revealed().snapshots<CustomerState>().state(ref) ?: return
sms.send(customer.state.phone, text)- What is still masked.
- Every
CONFIDENTIALvalue. - A caller's queries,
of(caller), which have norevealed(), so a read for a user is never revealed, whoever relays it. - The queries a policy or a cache loader runs inside a query. The state view cache holds what a plain read returns (Share State through CoCache).
- Every
- It combines.
revealed().unbounded()andunbounded().revealed()are the same queries, and a handler'srevealed().trusted()reveals too. - Datasets too. A dataset's queries share the same masks, so a revealing read of a dataset returns its
DISPLAY-protected columns raw. - History too. A state of the aggregate's history (a state read at a version or a time) is masked as its latest state is for the same read, and so are a trace's states and its events' bodies: a read that reveals the latest state's
DISPLAYvalues reveals theirs. - No strategy. A custom
MaskStrategyis not called for a revealed value. - Peers. A handler's
revealed()queries ask a peer for itsDISPLAYvalues too (Wow-Reveal, on its internal port). The peer answers them raw unless it turnswow.query.sensitivity.display-sharedoff, and then refuses with 403 rather than answer masked; a peer reached in user mode reads for an end user and refuses. Wow does not authenticate services on the internal port, so whoever reaches it can ask the same (DISPLAYvalues on the internal port). - Audit. Each revealing read is recorded as one: its audit names the fields it returned raw (
revealedFields) apart from those it masked, from the schema that masked them: the type's snapshot queries', or the Manifest's for a type whose snapshots are not queried. A state read names its state's fields (state.<path>), a trace its states' and its events' bodies' (events.body.<path>, as the events model names them). An events query and a trace also name the fields of each scheduled command they return (events.body.command.<path>), from the schema of the command type its schedule names.
Masking a DISPLAY value is a display control, not secrecy: filters compare its raw value by default, and @Sensitive governs what queries and reads return, not what Wow stores (Where masking stops). Why the word must be said all the same: the result of a trusted read often goes straight into a response, so a read that revealed by default would leak a field the day it is marked DISPLAY. Never return revealed queries' results to a caller. Java code writes JavaQueryApi.of(nodeQueryApi).trusted().revealed().
A secret a service reads back
A CONFIDENTIAL value is masked for every reader, the service itself included: no read in process, of(caller), trusted() and its unbounded() or revealed(), a subscription handler's context.queries, and no setting lifts it. The raw value is only where Wow hands code the state itself, not a query of it: the state a decide function holds and the StateEvent a subscription handler receives.
So a secret the service must read back, such as the API key it presents to a third party, is not a @Sensitive field of a state. Keep a reference in the state, the name the secret is looked up under, and store the secret apart: in configuration or a secrets store the service reads, or as ciphertext in a field that is not @Sensitive, which the service decrypts. Wow keeps a state and its events as they were written and encrypts none of them, so a raw secret in a state is in the log and in every snapshot, whatever masks the queries put over it.
Where masking stops
@Sensitive decides what a read returns: a query, a state read, an event query, a trace, an entry of the state view cache. It also decides what a published stream carries. It does not change what Wow stores, and it is not encryption at rest. These hold each @Sensitive value as it was written, CONFIDENTIAL ones included:
| Where | What it holds | The boundary |
|---|---|---|
| The log and the snapshots | Each event and each state as written | The store's grants |
| The ClickHouse sink's tables | The states and events as written; a query of them masks what it returns | The database's grants |
| The Elasticsearch event sink's index | The events as written; the events queries mask what they return | The index's privileges |
The report of migrate-data compare | The values of the fields that differ, 9.x's and V10's | Who reads the report |
A service's dataset that states "lineage": "none" | Whatever its table holds: it masks only the fields it declares sensitive | Its author's assertion that the table holds no value a state marks @Sensitive |
| The node's log | A failure's full text, its message and stack trace, which may quote a value it failed on; a parked aggregate's reason holds none (Parked aggregates) | The log's access |
| The failure ledger, the park webhooks already sent, and the ops context's events and snapshots | Before 10.0.0-beta.16, a parked aggregate's reason was its failure's message as it was, which may quote a value; those reasons are kept as they were | The store's grants; the webhook's receiver; the ops context's store |
Whoever reads one of these directly, with SQL or a store's client, reads the raw values.
A mask reaches a value through the keys of its schema Wow walks: a $ref of #/$defs/<key>, properties and additionalProperties of an object, items and prefixItems of an array, and allOf, anyOf and oneOf as lists of schemas. A schema without type is of the kinds its keywords say, and of both when it holds both, as a value of either may be stored. A schema the module declares (wow { schemaOverrides }) may use any other key: a @Sensitive value below one (patternProperties, if/then, contentSchema, allOf written as an object, properties of a schema whose type names no object, a key of its own) is masked by no read, so the build refuses it, naming the payload, the path and the key. So is a reference Wow does not follow, wherever it sits: $dynamicRef, $recursiveRef, and a $ref that is not #/$defs/<key> of a definition the Manifest holds. A key that holds values and no schema (const, enum, default, examples, the x-wow-* keywords) holds what it likes; a property of such a name is a property all the same. A node takes a Manifest that holds either, from an older build or written by hand, and refuses it where it reads the payload: a read of the payload fails with wow.query.failed (500) from the first compile of its schema, a published stream fails the node's assembly when its state holds one and an event's first record when the event does, and a schedule of a command whose schema the node refuses so, its own or a peer's contract's, answers that command null, read and published, as one the node holds no schema of.
A read answers only what the node's schema declares. A property of a closed object, a class or an object schema that lists its properties (Manifest Format), that the node's schema does not declare is left out of a state read, a snapshot query's records, an event's body at a revision the node knows, and a scheduled command, wherever the value comes from: a snapshot a newer version of the service wrote during a rolling upgrade, say. A map's entries and a free object's properties are answered as stored. What it does not close: a field a newer version newly marks @Sensitive, which the older version's schema declares already, is answered by the older nodes as their schema says, raw if it says nothing, until they are gone. What Wow publishes is masked, not trimmed: an event's body goes out as stored, so a node publishes a newer node's event with the properties its own schema does not declare. A property the node's schema marks write-only is never answered and never published, @Sensitive or not, whatever a stored payload holds (The Manifest): every read leaves it out, and so do the records Wow publishes itself, the transport sink's and a CoCache view's; a Sink of a SinkProvider, ClickHouse's among them, receives records as committed, and ClickHouse's catalog marks the value confidential, so its datasets mask it. Nor is it a query field: a filter, a sort, a group or a cursor that names it is refused as an unknown field (unknown-field). The events model's body fields are one path for every event of the aggregate, so a name any of its events marks write-only is no field for any of them, even where another event declares it readable: give the readable value another name. A model that holds a write-only name admits no model-wide search (model-search-unsupported), as one with a value that must not be compared admits none: it matches the fields the store's own search covers, which no field of the model names (MongoDB's text index, whatever fields its operator indexed, a stored write-only value among them; Elasticsearch's search of the record's prose fields). Leaving it out is not the trimming a stream refuses, which would drop what a newer node's schema declares: nothing reads a write-only value back. During a rolling upgrade that marks a property write-only, a node of the older code still publishes the stored events that hold it until it is upgraded. The node's own reading of its log keeps the value: an aggregate is sourced, and a command decides, with it. A scheduled command is the exception: it goes out trimmed as a read trims it (Published Streams).
A published stream, wow.<context>.<aggregate>.state, is masked as it is written. Each @Sensitive value of the state and of every event's body is replaced by its mask, as a read masks it, so the topic does not hold it. That holds during a rolling upgrade too, while the nodes of the older code still write the stream, as long as no break of the Manifest's compatibility check was recorded for it: a @Sensitive value a newer version adds to an event comes with a new revision, which an older node does not publish (Event Evolution); one it adds to a scheduled command, which has no revision, is left out by an older node, which publishes a scheduled command with only what its own schema of the command type declares; and a field newly marked @Sensitive is a break of its own. The owner may declare that a stream reveals its DISPLAY values (@AggregateRoot(revealsDisplay = true)); its CONFIDENTIAL values stay masked. Such a stream differs from a revealing read in three ways:
- The owner says the word, not the reader. A record is written once, for every reader, so the owner decides in its contract. The Manifest's
publishedand the peer contract carry the declaration, so a consumer knows whether it receives the raw values. - It holds for every reader of the topic. Other contexts, other services and external consumers alike receive the raw values. The topic's ACL (Kafka) is the boundary, and no read of the topic is audited.
- A revealed value stays on the broker for the topic's retention.
The owner's wow.query.sensitivity.display-shared off masks a revealing stream's DISPLAY values all the same. Records published by 10.0.0-beta.14 or earlier keep every value as written until the topic's retention removes them (Upgrade a Deployment).
Annotations a property inherits
A property also reads these annotations from the members it overrides: the getters of the interfaces it implements and the properties of its superclasses, through any number of levels. So a read model interface can keep them on its getters (@get:Sensitive val accessKeySecret: String) and the state that overrides them carries them.
@Sensitiveholds when any overridden member declares it, and the overriding property cannot remove it. It may declare its own, to choose the mask or tighten the level (DISPLAYtoCONFIDENTIAL); declaring a looser level fails the build.- Every other annotation (
@QueryTemporal,@QueryDecimal,@QueryMoney,@QueryDuration,@QueryReference,@QueryAlias,@QueryText,@QueryIndex) is the property's own when it declares one, else the one the overridden members declare. When two overridden members declare different ones, the build fails and names both: declare it on the property to say which holds.
A sensitive value type
A value type that Wow's JSON writes as one string, a Kotlin value class or a class with a @JsonValue member (its own, a superclass's, or the getter of an interface it implements), carries @Sensitive once for every property declared with it: in a list or a set, as a map's values, in an Optional or a Sequence, through a type parameter (Page<PhoneNumber>), in a state, an event and a command alike. It is declared on the class (@Sensitive value class PhoneNumber(val value: String), or through an annotation class that carries @Sensitive) or on the member the type is written by: the value class's property (value class Card(@get:Sensitive(CONFIDENTIAL) val number: String)), the @JsonValue member, or a getter that member overrides. A value type whose member holds a sensitive one, itself or in a container (value class Codes(val items: List<Code>)), is sensitive too, at that level or at a stricter one it declares; a looser one fails the build. A class and its member that both declare it declare the same, or the build fails, naming both. The build also fails on a @Sensitive on another member of a value type, which Jackson does not write, and on a generic value type that holds a sensitive one through its type parameter (Wrapper<PhoneNumber> of value class Wrapper<T>(val value: T)), which the schema describes as any value. A class that merely implements Iterable is no container: Jackson writes it by its properties, which carry their own sensitivity. A property of the type may repeat or tighten its level, never loosen it, and the getter of a property of a value class's type is read as any other (@get:Sensitive val phone: PhoneNumber: its own, an interface's or a superclass's, also where it overrides a generic member).
A read masks a sensitive value as a string, so the build refuses, naming the payload and the path or the property, a sensitive value no read can mask: one written as no string (@Sensitive value class Pin(val value: Int)), a list of maps of sensitive values (List<Map<String, PhoneNumber>>), alternatives of one type (a sealed type's subtypes) that mask one path by two rules, and a sensitive value type as a map's key (Map<PhoneNumber, Long>), which is a name no mask reaches. Hold the value as a string, alone, in a list, as a map's values or in an Optional; let the alternatives agree on each path; key a map by a value that is not sensitive, or hold its entries as a list of objects.
On which stores
Snapshots are queried on PostgreSQL and MongoDB, in place, and on Elasticsearch when a type's snapshots are indexed there. On the memory backend they are queried from memory, for local runs and tests; wow.query.memory.enabled: false turns that off, and the snapshot routes then answer 404.