Skip to content

Commit

Permalink
feat: Split ResourceStore config into 2 parts
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimvh committed Jul 16, 2021
1 parent fdd6f85 commit ad7f4ed
Show file tree
Hide file tree
Showing 36 changed files with 153 additions and 220 deletions.
3 changes: 2 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"files-scs:config/ldp/metadata-parser/default.json",
"files-scs:config/ldp/metadata-writer/default.json",
"files-scs:config/ldp/permissions/acl.json",
"files-scs:config/storage/backend/memory.json",
"files-scs:config/storage/key-value/memory.json",
"files-scs:config/storage/resource-store/memory.json",
"files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/suffix.json",
"files-scs:config/util/index/default.json",
Expand Down
3 changes: 2 additions & 1 deletion config/dynamic.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"files-scs:config/ldp/metadata-parser/default.json",
"files-scs:config/ldp/metadata-writer/default.json",
"files-scs:config/ldp/permissions/acl.json",
"files-scs:config/storage/backend/dynamic.json",
"files-scs:config/storage/key-value/memory.json",
"files-scs:config/storage/resource-store/dynamic.json",
"files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/suffix.json",
"files-scs:config/util/index/default.json",
Expand Down
3 changes: 2 additions & 1 deletion config/example-https-file.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"files-scs:config/ldp/metadata-parser/default.json",
"files-scs:config/ldp/metadata-writer/default.json",
"files-scs:config/ldp/permissions/acl.json",
"files-scs:config/storage/backend/file.json",
"files-scs:config/storage/key-value/memory.json",
"files-scs:config/storage/resource-store/file.json",
"files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/suffix.json",
"files-scs:config/util/index/default.json",
Expand Down
3 changes: 2 additions & 1 deletion config/file.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"files-scs:config/ldp/metadata-parser/default.json",
"files-scs:config/ldp/metadata-writer/default.json",
"files-scs:config/ldp/permissions/acl.json",
"files-scs:config/storage/backend/file.json",
"files-scs:config/storage/key-value/memory.json",
"files-scs:config/storage/resource-store/file.json",
"files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/suffix.json",
"files-scs:config/util/index/default.json",
Expand Down
3 changes: 2 additions & 1 deletion config/memory-subdomains.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"files-scs:config/ldp/metadata-parser/default.json",
"files-scs:config/ldp/metadata-writer/default.json",
"files-scs:config/ldp/permissions/acl.json",
"files-scs:config/storage/backend/memory.json",
"files-scs:config/storage/key-value/memory.json",
"files-scs:config/storage/resource-store/memory.json",
"files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/subdomain.json",
"files-scs:config/util/index/default.json",
Expand Down
3 changes: 2 additions & 1 deletion config/path-routing.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"files-scs:config/ldp/metadata-parser/default.json",
"files-scs:config/ldp/metadata-writer/default.json",
"files-scs:config/ldp/permissions/acl.json",
"files-scs:config/storage/backend/regex.json",
"files-scs:config/storage/key-value/memory.json",
"files-scs:config/storage/resource-store/regex.json",
"files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/suffix.json",
"files-scs:config/util/index/default.json",
Expand Down
3 changes: 2 additions & 1 deletion config/sparql-endpoint.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"files-scs:config/ldp/metadata-parser/default.json",
"files-scs:config/ldp/metadata-writer/default.json",
"files-scs:config/ldp/permissions/acl.json",
"files-scs:config/storage/backend/sparql.json",
"files-scs:config/storage/key-value/memory.json",
"files-scs:config/storage/resource-store/sparql.json",
"files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/suffix.json",
"files-scs:config/util/index/default.json",
Expand Down
25 changes: 14 additions & 11 deletions config/storage/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Storage
Options related to how data and resources are stored.

## Key-Value
Used by certain classes for internal storage.
* *memory*: Store everything in memory.
* *resource-store*: Store everything in a specific container in the resource store.

## Resource-Store
The chain of ResourceStores that needs to be passed through before reaching the actual data.
There is much variety possible here so chances are higher that a custom solution is needed here.
Most configs here have the same default setup (Monitoring -> Locking -> Patching -> Converting)
and only differ at the tail.
* *dynamic*: The routing store used at the tail here is needed when using dynamic pod creation.
## Backend
The final part of the ResourceStore chain that handles data access.
* *dynamic*: The routing store used here is needed when using dynamic pod creation.
* *file*: Default setup with a file backend.
* *memory*: Default setup with a memory backend.
* *regex*: Uses a different backend based on the container that is being used.
* *sparql*: Default setup with a SPARQL endpoint backend.
Also updates the converting store so all incoming data is transformed into quads.

## Key-Value
Used by certain classes for internal storage.
* *memory*: Store everything in memory.
* *resource-store*: Store everything in a specific container in the resource store.

## Middleware
The chain of utility ResourceStores that needs to be passed through before reaching the backend stores.
The final store in this chain takes the store from the stores/backend config as source.
* *default*: Chains all the utility stores:
Monitoring -> IndexRepresentation -> Locking -> Patching -> Converting
25 changes: 25 additions & 0 deletions config/storage/backend/dynamic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/storage/backend/data-accessors/file.json"
],
"@graph": [
{
"comment": "Setup when using dynamic pods. A router rule will be defined when activating dynamic pods.",
"@id": "urn:solid-server:default:ResourceStore_Backend",
"@type": "RoutingResourceStore",
"rule": { "@id": "urn:solid-server:default:RouterRule" }
},
{
"comment": "Which store to use for requests that do not match any pod, e.g. for storage.",
"@id": "urn:solid-server:default:RouterRule",
"BaseUrlRouterRule:_baseStore": {
"@id": "urn:solid-server:default:ResourceStore_DataAccessor",
"@type": "DataAccessorBasedStore",
"identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" },
"auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" },
"accessor": { "@id": "urn:solid-server:default:FileDataAccessor" }
}
}
]
}
16 changes: 16 additions & 0 deletions config/storage/backend/file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/storage/backend/data-accessors/file.json"
],
"@graph": [
{
"comment": "A default store setup with a file system backend.",
"@id": "urn:solid-server:default:ResourceStore_Backend",
"@type": "DataAccessorBasedStore",
"identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" },
"auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" },
"accessor": { "@id": "urn:solid-server:default:FileDataAccessor" }
}
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/storage/backend/data-accessors/memory.json"
],
"@graph": [
{
"comment": "Supports default Solid behaviour on any kind of data accessor.",
"@id": "urn:solid-server:default:ResourceStore_DataAccessor",
"comment": "A default store setup with a memory backend.",
"@id": "urn:solid-server:default:ResourceStore_Backend",
"@type": "DataAccessorBasedStore",
"identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" },
"auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" }
"auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" },
"accessor": { "@id": "urn:solid-server:default:MemoryDataAccessor" }
}
]
}
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/storage/resource-store/data-accessors/file.json",
"files-scs:config/storage/resource-store/data-accessors/memory.json",
"files-scs:config/storage/resource-store/data-accessors/sparql-endpoint.json",
"files-scs:config/storage/resource-store/stores/converting.json",
"files-scs:config/storage/resource-store/stores/locking.json",
"files-scs:config/storage/resource-store/stores/patching.json",
"files-scs:config/storage/resource-store/stores/routing.json"
"files-scs:config/storage/backend/data-accessors/file.json",
"files-scs:config/storage/backend/data-accessors/memory.json",
"files-scs:config/storage/backend/data-accessors/sparql-endpoint.json"
],
"@graph": [
{
"comment": "A more complex example with 3 different stores being routed to.",
"@id": "urn:solid-server:default:ResourceStore",
"@type": "MonitoringStore",
"MonitoringStore:_source": {
"@id": "urn:solid-server:default:ResourceStore_Index",
"IndexRepresentationStore:_source": {
"@id": "urn:solid-server:default:ResourceStore_Locking",
"LockingResourceStore:_source": {
"@id": "urn:solid-server:default:ResourceStore_Patching",
"PatchingStore:_source": {
"@id": "urn:solid-server:default:ResourceStore_Converting",
"RepresentationConvertingStore:_source": {
"@id": "urn:solid-server:default:ResourceStore_Routing"
}
}
}
}
}
"@id": "urn:solid-server:default:ResourceStore_Backend",
"@type": "RoutingResourceStore",
"rule": { "@id": "urn:solid-server:default:RouterRule" }
},

{
Expand Down
22 changes: 22 additions & 0 deletions config/storage/backend/sparql.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/storage/backend/data-accessors/sparql-endpoint.json"
],
"@graph": [
{
"comment": "A default store setup with a memory backend.",
"@id": "urn:solid-server:default:ResourceStore_Backend",
"@type": "DataAccessorBasedStore",
"identifierStrategy": { "@id": "urn:solid-server:default:IdentifierStrategy" },
"auxiliaryStrategy": { "@id": "urn:solid-server:default:AuxiliaryStrategy" },
"accessor": { "@id": "urn:solid-server:default:SparqlDataAccessor" }
},
{
"comment": "This makes it so all incoming data is converted to quad objects.",
"@id": "urn:solid-server:default:ResourceStore_Converting",
"RepresentationConvertingStore:_options_inConverter": { "@id": "urn:solid-server:default:RepresentationConverter" },
"RepresentationConvertingStore:_options_inType": "internal/quads"
}
]
}
32 changes: 32 additions & 0 deletions config/storage/middleware/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/storage/middleware/stores/converting.json",
"files-scs:config/storage/middleware/stores/locking.json",
"files-scs:config/storage/middleware/stores/patching.json"
],
"@graph": [
{
"comment": "Sets up a stack of utility stores used by most instances.",
"@id": "urn:solid-server:default:ResourceStore",
"@type": "MonitoringStore",
"MonitoringStore:_source": { "@id": "urn:solid-server:default:ResourceStore_Index" }
},
{
"@id": "urn:solid-server:default:ResourceStore_Index",
"IndexRepresentationStore:_source": { "@id": "urn:solid-server:default:ResourceStore_Locking" }
},
{
"@id": "urn:solid-server:default:ResourceStore_Locking",
"LockingResourceStore:_source": { "@id": "urn:solid-server:default:ResourceStore_Patching" }
},
{
"@id": "urn:solid-server:default:ResourceStore_Patching",
"PatchingStore:_source": { "@id": "urn:solid-server:default:ResourceStore_Converting" }
},
{
"@id": "urn:solid-server:default:ResourceStore_Converting",
"RepresentationConvertingStore:_source": { "@id": "urn:solid-server:default:ResourceStore_Backend" }
}
]
}
42 changes: 0 additions & 42 deletions config/storage/resource-store/dynamic.json

This file was deleted.

35 changes: 0 additions & 35 deletions config/storage/resource-store/file.json

This file was deleted.

36 changes: 0 additions & 36 deletions config/storage/resource-store/memory.json

This file was deleted.

Loading

0 comments on commit ad7f4ed

Please sign in to comment.