From 109814c85aa93ca735c63e62f55cd825b75808ac Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Tue, 5 Oct 2021 14:10:11 -0700 Subject: [PATCH] Clarify decision record for ADR-065. (#7062) While discussing a question about the indexing interface (#7044), we found some confusion about the intent of the design decisions in ADR 065. Based on discussion with the original authors of the ADR, this commit adds some language to the Decisions section to spell out the intentions more clearly, and to call out future work that this ADR did not explicitly decide about. --- .../adr-065-custom-event-indexing.md | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/docs/architecture/adr-065-custom-event-indexing.md b/docs/architecture/adr-065-custom-event-indexing.md index b5c86ecfa..83a96de48 100644 --- a/docs/architecture/adr-065-custom-event-indexing.md +++ b/docs/architecture/adr-065-custom-event-indexing.md @@ -25,6 +25,7 @@ - April 28, 2021: Specify search capabilities are only supported through the KV indexer (@marbar3778) - May 19, 2021: Update the SQL schema and the eventsink interface (@jayt106) - Aug 30, 2021: Update the SQL schema and the psql implementation (@creachadair) +- Oct 5, 2021: Clarify goals and implementation changes (@creachadair) ## Status @@ -73,19 +74,38 @@ the database used. We will adopt a similar approach to that of the Cosmos SDK's `KVStore` state listening described in [ADR-038](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-038-state-listening.md). -Namely, we will perform the following: +We will implement the following changes: - Introduce a new interface, `EventSink`, that all data sinks must implement. - Augment the existing `tx_index.indexer` configuration to now accept a series - of one or more indexer types, i.e sinks. + of one or more indexer types, i.e., sinks. - Combine the current `TxIndexer` and `BlockIndexer` into a single `KVEventSink` that implements the `EventSink` interface. -- Introduce an additional `EventSink` that is backed by [PostgreSQL](https://www.postgresql.org/). - - Implement the necessary schemas to support both block and transaction event - indexing. +- Introduce an additional `EventSink` implementation that is backed by + [PostgreSQL](https://www.postgresql.org/). + - Implement the necessary schemas to support both block and transaction event indexing. - Update `IndexerService` to use a series of `EventSinks`. -- Proxy queries to the relevant sink's native query layer. -- Update all relevant RPC methods. + +In addition: + +- The Postgres indexer implementation will _not_ implement the proprietary `kv` + query language. Users wishing to write queries against the Postgres indexer + will connect to the underlying DBMS directly and use SQL queries based on the + indexing schema. + + Future custom indexer implementations will not be required to support the + proprietary query language either. + +- For now, the existing `kv` indexer will be left in place with its current + query support, but will be marked as deprecated in a subsequent release, and + the documentation will be updated to encourage users who need to query the + event index to migrate to the Postgres indexer. + +- In the future we may remove the `kv` indexer entirely, or replace it with a + different implementation; that decision is deferred as future work. + +- In the future, we may remove the index query endpoints from the RPC service + entirely; that decision is deferred as future work, but recommended. ## Detailed Design