Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
docs: Storage compatibility matrix
Browse files Browse the repository at this point in the history
Added a document that lists what storage providers we have implemented and what functionality is implemented. Also made some small additions to the storage interface documentation.

Signed-off-by: Derek Trider <Derek.Trider@securekey.com>
  • Loading branch information
Derek Trider committed Apr 6, 2022
1 parent 07042d7 commit 8260dea
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
68 changes: 68 additions & 0 deletions docs/storage_compatibility_matrix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Storage Compatibility Matrix

Aries-Framework-Go (this repo) and [Aries-Framework-Go-Ext](https://github.com/hyperledger/aries-framework-go-ext) have a number of storage providers that implement the [Aries storage interfaces](../spi/storage/storage.go).

This document lists the storage provider implementations we have and what functionality is currently implemented/supported.

The functions defined in the interfaces can be categorized as either "core" or "extended" functionality.

✓ = Implemented

X = Not implemented (but could be)

Unsupported = Not implemented (and not currently supported by the underlying database/technology/spec)

## Core Functionality

These are the functions that the Aries agent currently uses. For a storage provider implementation to work in an Aries agent, it needs to support the functions below.

| | MongoDB | CouchDB | EDV | MySQL | IndexedDB | LevelDB | In-Memory | PostgreSQL |
|---------------------------|---------|---------|-----|-------|-----------|---------|-----------|------------|
| Provider - OpenStore |||||||||
| Provider - SetStoreConfig |||* |** |*** |||**** |
| Provider - Close |||||||||
| Store - Put ||||** |*** |||**** |
| Store - Get |||||||||
| Store - Query Using 1 Tag ||||** |*** ||| X***** |
| Store - Delete |||||||||
| Store - Close |||||||||
| Iterator - Next |||||||||
| Iterator - Key |||||||||
| Iterator - Value |||||||||
| Iterator - Close |||||||||

\* This method is more or less a no-op since EDV doesn't need this. Store config is just stored in-memory for now - see [here](https://github.com/hyperledger/aries-framework-go-ext/issues/2492) for more info. Since the Aries agent doesn't currently use GetStoreConfig, this isn't an issue for Aries usages.

\*\* Current tagging/querying mechanism is unoptimized and not recommended for production use as-is. See [here](https://github.com/hyperledger/aries-framework-go-ext/issues/67) for more info.

\*\*\* Current tagging/querying mechanism is unoptimized and not recommended for production use as-is. See [here](https://github.com/hyperledger/aries-framework-go-ext/issues/2540) for more info.

\*\*\*\* There are some limitations with the current implementation of these methods. See [here](https://github.com/hyperledger/aries-framework-go-ext/issues/229) for more info.

\*\*\*\*\* Tag name only queries have been implemented, but not tag name + value queries. Both types of queries are used by an Aries agent. See [here](https://github.com/hyperledger/aries-framework-go-ext/issues/229) for more info.

## Extended Functionality

The Aries agent does not currently make use of these functions, but they may be useful in building your own application.

| | MongoDB | CouchDB | EDV | MySQL | IndexedDB | LevelDB | In-Memory | PostgreSQL |
|---------------------------------------|---------|---------|-------------|-------|-----------|---------|-----------|------------|
| Provider - GetStoreConfig |||* |** |*** |*** || X |
| Provider - GetOpenStores |||| X | X ||| X |
| Store - GetTags |||||||| X |
| Store - GetBulk |||| X | X |**** || X |
| Store - Query Using Multiple Tags || X | X | X | X | X | X | X |
| Store - Query Using Custom Pagination ||| Unsupported | X | X | X | X | X |
| Store - Query Using Custom Sorting ||| Unsupported | X | X | X | X | X |
| Store - Batch ||||||**** || X |
| Store - Flush |||||||||
| Iterator - Tags |||||||| X |
| Iterator - TotalItems |||||||| X |

\* Only returns store config if it's still in memory. Can't be used to report whether the underlying database exists.

\*\* Doesn't currently check the underlying data for existence (looks at in-memory stores instead). See [here](https://github.com/hyperledger/aries-framework-go-ext/issues/167) for more info.

\*\*\* Doesn't currently check the underlying data for existence (looks at in-memory stores instead). See [here](https://github.com/hyperledger/aries-framework-go/issues/2948) for more info.

\*\*\*\* Unoptimized implementation. See [here](https://github.com/hyperledger/aries-framework-go/issues/2605) for more info.
2 changes: 2 additions & 0 deletions spi/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ type Store interface {
// GetTags fetches all tags associated with the given key.
// If key cannot be found, then an error wrapping ErrDataNotFound will be returned.
// If key is empty, then an error will be returned.
// As of writing, aries-framework-go code does not use this, but it may be useful for custom solutions.
GetTags(key string) ([]Tag, error)

// GetBulk fetches the values associated with the given keys.
Expand Down Expand Up @@ -225,6 +226,7 @@ type Store interface {
// enabled and a key is used that already exists in the database.
// Depending on the implementation, this method may be faster than repeated Put and/or Delete calls.
// If any of the given keys are empty, or the operations slice is empty or nil, then an error will be returned.
// As of writing, aries-framework-go code does not use this, but it may be useful for custom solutions.
Batch(operations []Operation) error

// Flush forces any queued up Put and/or Delete operations to execute.
Expand Down

0 comments on commit 8260dea

Please sign in to comment.