semiotic-ai / timeline-aggregation-protocol

A fast, efficient and trust-minimized unidirectional micro-payments system.
Apache License 2.0
14 stars 3 forks source link

Redesign 'is_unique' API #90

Closed ColePBryan closed 1 year ago

ColePBryan commented 1 year ago

The way is_unique() is currently implemented in the adapter may force a inefficient implementation (O(n)). It may be able to be refactored in a way to be used with "store_unique" functionality of some database, or done in a way to work better with hashset type data structure. This issue is to track that design.

aasseman commented 1 year ago

Except for the forced separation between checking uniqueness and storage, I don't think that at this point the user is forced to have an inefficient implementation. The implementation of the storage backend is completely open-ended, and so is_unique can leverage some specialized DB function for that, for example. @ColePBryan would you agree that therefore, we can close this issue?