Closed TanmoySG closed 1 year ago
v2/{entity}/{action}
. Example
v2/cluster/create
, v2/cluster/delete
. v2/data/add
, v2/data/delete
etc.POST v2/data/
to add data , PATCH v2/data/
to update data, and more.Currently the schemas are defined as fieldName : description
and doesn't handle data-type, constraints. In v2,
JSONSchema
. Each Data block will have to be complaint with the schema and must strictly follow the schema defined. Any data that isn't in accordance to the JSONSchema will be considered "illegal" and will not be inserted into the Collection._id
auto-generated ID field used as identifier in v1
_id
as primary identifier.marker : "key : value"
that fails if there is even one extra gap before or after the :
, the new Marker definition will use marker : {Key : <field-name> , Value : <Value of Field>}
Sample Directory Structure
api/cluster/create
or POST api/cluster
maps to api/common
with payload of either the Query or JSON Object with specification of the action.In program Data Structure (with sample data JSON), derived from this Directory tree.
{
"namespaces": {
"gns": {
"alias": "",
"id": "",
"path": "",
"databases": {
"db-one": {
"name": "db1",
"collection": {
"coll-one": {
"name": "",
"path": "",
"data": {
"data": {
"field-1": "true"
},
"path": ""
},
"metadata": {
"metadata": null,
"schema": null,
"path": ""
}
}
},
"metadata": {
"metadata": null,
"schema": null,
"path": ""
},
"path": ""
}
}
}
},
"users": {}
}
Go Model on which this is based
package model
type FilePath string
type Identifier string
type User map[string]interface{}
type WDBFileSystem struct {
Namespaces map[Identifier]Namespace `json:"namespaces"`
Users map[Identifier]User `json:"users"`
}
type Namespace struct {
NamespaceAlias string `json:"alias"`
NamespaceID Identifier `json:"id"`
NamespacePath FilePath `json:"path"`
Databases map[Identifier]Database `json:"databases"`
}
type Database struct {
DatabaseName Identifier `json:"name"`
Collections map[Identifier]Collection `json:"collection"`
Metadata Metadata `json:"metadata"`
DatabasePath FilePath `json:"path"`
}
type Collection struct {
CollectionName Identifier `json:"name"`
CollectionPath FilePath `json:"path"`
Data Datum `json:"data"`
Metadata Metadata `json:"metadata"`
}
type Datum struct {
Data map[Identifier]interface{} `json:"data"`
DataPath FilePath `json:"path"`
}
type Metadata struct {
Metadata map[string]interface{} `json:"metadata"`
Schema map[string]interface{} `json:"schema"`
MetadataPath FilePath `json:"path"`
}
A minified JSON File is stored JSON Data without indentation. This results in a lesser sized data file. Here is a comparison.
So the release build of WDB should use minified JSON to persist data after shutdown.
/healthz
endpoint for exposing performance stats.type Filter struct {
Key string `json:"key"`
Value interface{} `json:"value"`
// Filter operator - < / greater , > / lesser , = / equal , != / unequal
// Operator string `json:"operator"` // Future scope
}
WDB-Archipelago
WunderDB v2.0, named "Archipelago", aims at making wdb code more maintainable and mature. This Proposal Issue will act as a place to put ideas for the v2.0. The main goal of v2.0 proposal should primarily encompass, but not limited to
[x] Code Maturity
[x] Usage Maturity
[x] Granular Storage