https://github.com/i-e-b/kvk
Experiments in relational document datastores. Key-Value-Key.
https://github.com/i-e-b/kvk
Last synced: 10 months ago
JSON representation
Experiments in relational document datastores. Key-Value-Key.
- Host: GitHub
- URL: https://github.com/i-e-b/kvk
- Owner: i-e-b
- Created: 2012-12-14T09:35:08.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-02-28T13:36:10.000Z (over 13 years ago)
- Last Synced: 2025-03-22T12:30:31.669Z (over 1 year ago)
- Language: C#
- Size: 1.09 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
KVK
===
Experiments in relational document datastores. Key-Value-Key: Reinventing the wheel
Todo
----
* Use JSON as the interface, decompose arrays directly.
* Re-compose to JSON
* Improve the pointerless Ternary Search Tree to cope with arbitrary depth
* Try mem-mapping pTST to files
Schema-free data store as a set of Key-Value stores
===================================================
Documents are composed of a hierarchy of keys and values. Each document has a single unique key.
Each key in the document can be expressed as a key path -- so in the document:
```
id1 = {
Group : {
Item : {
Upc : "29875897587365"
}
}
}
```
The `Upc` key has a key path of `Group.Item.Upc`.
Principles
----------
* Every key-path is a separate store
* Each __key__ in each store is the _value_ in the document
* Each __value__ in each store is a list of documents that have the key-path _and_ value
So for documents:
```
x = {
Uri : "http://example.com",
Owner : {
Name : "me"
}
}
y = {
Uri : "http://nist.gov",
Owner : {
Name : "government"
}
}
z = {
Uri : "http://snippetsfor.net",
Owner : {
Name : "me"
}
}
```
* `"Uri" --> ["http://example.com" : [x]]; ["http://nist.gov": [y]]; ["http://snippetsfor.net":[z]]`
* `"Owner.Name" --> ["me" : [x, z]]; ["government":[y]]`
With pattern `"store name" --> ["value" : [set of containing documents]]`
The keys in each store could be Tries where each node has a (potentially empty) list of matching documents.
Notes
-----
* For scaling, can list hosts rather than documents, then go to host for definitive answer.
* Key-value existence checking v. easy.
* All documents are 'joined' by key equality by default.
Multi-keys
----------
It should be acceptable to define a key-path more than once per document. It then becomes
available by any of those keys:
```
x = {
Picture : "http://example.com/us.jpg",
Tags : {
Name : "John",
Name : "Sue",
Name : "Phil"
}
}
```
* `"Tags.Name" --> ["John" : [x]]; ["Sue":[x]]; ["Phil":[x]]`