-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtual collections: range queries, sort options, indices #2004
Comments
@FUDCo and I were talking about the MongoDB API and how it might apply to this. Their database is a collection of "documents" (JSON blobs), and the query language is a matching-predicate / sorting-comparison function encoded into a JSON-shaped object. There is some correspondence between the property hierarchy of the match/sort object and the properties being matched on the document, and the values in the match/sort object can express various equality/inequality requirements and ordering. Encoding this in an object limits the scope of the language compared to SQL (or CouchDB, which lets you write arbitrarily-complex map/reduce programs in a confined form of JS), which probably reduces the burdens on the backend. |
I would like to understand that as a limited language. Do you have a link? |
I'm not clear what @warner means by this. However, aside from going into the full exercise of trying to understand/explain all of MongoDB, I think a relevant starting point might be https://docs.mongodb.com/manual/tutorial/query-documents/ |
That looks like a good document.. I see an example of: const cursor = db.collection('inventory').find({
$or: [{ status: 'A' }, { qty: { $lt: 30 } }]
}); where they're using properties with special names ( Hm, now I wonder what it would look like if we just dropped in a special pseudo-vat that ran MongoDB, with a serialization mechanism that allowed kernel object references in the values, and had the client vats access it through regular messages. |
Added another use case to the issue description. issuer.js had used a Set to protect against the same payment being included twice: agoric-sdk/packages/ERTP/src/issuer.js Lines 163 to 170 in 55bdaf7
|
As implementation has progressed, it has reached the point where it's possible to construct a rough road map (and one that should become increasingly credible under maintenance as we go) from the present state of the code to something able to satisfy our MVP requirements (which are basically (1) support for high-cardinality collections (i.e., collections too big to fit in RAM) with sufficient query facilities to satisfy the needs of the AMM and treasury and (2) externalized data storage that can survive having its vat terminated and then resurrected with new code, to support contract code upgrade and data schema evolution). Here is my crude plan as it currently stands:
(warner): We'll push these two out to a later ticket:
|
Let's limit this ticket to getting the virtual/durable collection API landed. I've added #4325 to cover the "baggage" mechanism, and we have #3062 for the Kind-reassociation API. Before we close this ticket, make (and link to) a new one for the last two bullet points: "possible optimizations" and "support for composite keys". |
@warner Given that the various subtasks we were tracking here have been closed (aside from a couple that explicitly flagged as for future issues to be filed), can we mark this as closed? |
Closing, as the sub-tasks are basically all done. |
What is the Problem Being Solved?
In #1831 (comment) we made a plan to implement "range queries" and other collection-oriented things around virtual objects.
Description of the Design
Security Considerations
Test Plan
Potential Use Cases
ERTP proper
issuer.js had used a Set to protected against aliased payments being combined. A WeakStore with values
undefined
can be used instead, but a Set that understands virtual objects would be ideal.Auction contract
In the Second Price Auction contract, we store the seats of the all the bidders until the end of the contract, at which time we find the highest and second highest bidder.
Barter Exchange
In the Barter Exchange contract, we store unmatched seats until there is a matching seat to trade with.
Simple Exchange
In the Simple Exchange contract, we store the unmatched seats as buyOrders or sellOrders until there is a matching seat to trade with
The text was updated successfully, but these errors were encountered: