Service - Variant Manager: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 8: | Line 8: | ||
https://bitbucket.org/izara-market-products/izara-market-products-variant-manager/src/master/ | https://bitbucket.org/izara-market-products/izara-market-products-variant-manager/src/master/ | ||
= Schemas = | |||
==ObjectSchemas== | |||
=== variant === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "variant", | |||
"canDelete": true, | |||
"belongTo": { | |||
"serviceTag": "UserAccount", | |||
"objectType": "user" | |||
}, | |||
"addOnDataStructure": [], | |||
"storageResources": { | |||
"dynamoDB": { | |||
"storageType": "dynamoDB", | |||
"tableName": "VariantRecord", | |||
"serviceTag": "VariantManager" | |||
}, | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"variantId": { | |||
"type": "string", | |||
"randomOnCreate": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9_-]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"dynamoDB", | |||
"graph" | |||
] | |||
}, | |||
"variantHandlerServiceNameTag": { | |||
"type": "string", | |||
"randomOnCreate": false, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": true, | |||
"canUpdate": false, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9_-]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"dynamoDB", | |||
"graph" | |||
] | |||
} | |||
}, | |||
"compositeKeyDeliminator": "_", | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "variantId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
=== variantAttributeLabel === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "variantAttributeLabel", | |||
"addOnDataStructure": [], | |||
"canDelete": true, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"variantAttributeLabelId": { | |||
"type": "string", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"randomOnCreate": true, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9-_]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "variantAttributeLabelId" | |||
} | |||
], | |||
"generatedBy": "userGenerated", | |||
"compositeKeyDeliminator": "_" | |||
} | |||
</syntaxhighlight> | |||
=== variantAttributeLink === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "variantAttributeLink", | |||
"addOnDataStructure": [], | |||
"canDelete": true, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"variantAttributeLinkId": { | |||
"type": "string", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"randomOnCreate": true, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9-_]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "variantAttributeLinkId" | |||
} | |||
], | |||
"generatedBy": "userGenerated", | |||
"compositeKeyDeliminator": "_" | |||
} | |||
</syntaxhighlight> | |||
=== variantAttributeValue === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "variantAttributeValue", | |||
"addOnDataStructure": [], | |||
"canDelete": true, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"variantAttributeValueId": { | |||
"type": "string", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"randomOnCreate": true, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9-_]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "variantAttributeValueId" | |||
} | |||
], | |||
"generatedBy": "userGenerated", | |||
"compositeKeyDeliminator": "_" | |||
} | |||
</syntaxhighlight> | |||
== RelationshipSchemas == | |||
=== isVariantAttribute === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "VariantManager", | |||
"fieldNames": { | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"graph" | |||
], | |||
"from": { | |||
"objType": { | |||
"objectType": "variantAttributeLink", | |||
"serviceTag": "VariantManager" | |||
}, | |||
"linkType": "many", | |||
"direction": "from", | |||
"requiredOnCreate": true, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"objectType": "variantAttributeValue", | |||
"serviceTag": "VariantManager" | |||
}, | |||
"linkType": "one", | |||
"direction": "to", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canMove": false | |||
} | |||
</syntaxhighlight> | |||
=== isVariantAttributeLabel === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "VariantManager", | |||
"fieldNames": { | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"graph" | |||
], | |||
"from": { | |||
"objType": { | |||
"objectType": "variantAttributeValue", | |||
"serviceTag": "VariantManager" | |||
}, | |||
"linkType": "many", | |||
"direction": "from", | |||
"requiredOnCreate": true, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"objectType": "variantAttributeLabel", | |||
"serviceTag": "VariantManager" | |||
}, | |||
"linkType": "one", | |||
"direction": "to", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canMove": false | |||
} | |||
</syntaxhighlight> | |||
=== hasVariantAttributeLink === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "VariantManager", | |||
"fieldNames": { | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"graph" | |||
], | |||
"from": { | |||
"objType": { | |||
"objectType": "variant", | |||
"serviceTag": "VariantManager" | |||
}, | |||
"linkType": "one", | |||
"direction": "from", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"objectType": "variantAttributeLink", | |||
"serviceTag": "VariantManager" | |||
}, | |||
"linkType": "many", | |||
"direction": "to", | |||
"requiredOnCreate": true, | |||
"handler": false | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canMove": false | |||
} | |||
</syntaxhighlight> | |||
=== disabledVariantAttributeLink === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "VariantManager", | |||
"fieldNames": { | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"graph" | |||
], | |||
"from": { | |||
"objType": { | |||
"objectType": "variant", | |||
"serviceTag": "VariantManager" | |||
}, | |||
"linkType": "one", | |||
"direction": "from", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"objectType": "variantAttributeLink", | |||
"serviceTag": "VariantManager" | |||
}, | |||
"linkType": "many", | |||
"direction": "to", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canMove": false | |||
} | |||
</syntaxhighlight> | |||
= DynamoDB tables = | = DynamoDB tables = | ||
Revision as of 07:22, 23 December 2025
Overview
Each product is handled by a Service - Variant (handlers) service.
The Variant Manager service handles shared orchestration of Variant Handler services.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-variant-manager/src/master/
Schemas
ObjectSchemas
variant
{
"objectType": "variant",
"canDelete": true,
"belongTo": {
"serviceTag": "UserAccount",
"objectType": "user"
},
"addOnDataStructure": [],
"storageResources": {
"dynamoDB": {
"storageType": "dynamoDB",
"tableName": "VariantRecord",
"serviceTag": "VariantManager"
},
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"variantId": {
"type": "string",
"randomOnCreate": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
"pattern": "^[a-zA-Z0-9_-]+$"
},
"storageResourceTags": [
"dynamoDB",
"graph"
]
},
"variantHandlerServiceNameTag": {
"type": "string",
"randomOnCreate": false,
"requiredOnCreate": false,
"optionalOnCreate": true,
"canUpdate": false,
"validation": {
"pattern": "^[a-zA-Z0-9_-]+$"
},
"storageResourceTags": [
"dynamoDB",
"graph"
]
}
},
"compositeKeyDeliminator": "_",
"identifiers": [
{
"type": "identifier",
"fieldName": "variantId"
}
],
"generatedBy": "userGenerated"
}
variantAttributeLabel
{
"objectType": "variantAttributeLabel",
"addOnDataStructure": [],
"canDelete": true,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"variantAttributeLabelId": {
"type": "string",
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"randomOnCreate": true,
"validation": {
"pattern": "^[a-zA-Z0-9-_]+$"
},
"storageResourceTags": [
"graph"
]
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "variantAttributeLabelId"
}
],
"generatedBy": "userGenerated",
"compositeKeyDeliminator": "_"
}
variantAttributeLink
{
"objectType": "variantAttributeLink",
"addOnDataStructure": [],
"canDelete": true,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"variantAttributeLinkId": {
"type": "string",
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"randomOnCreate": true,
"validation": {
"pattern": "^[a-zA-Z0-9-_]+$"
},
"storageResourceTags": [
"graph"
]
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "variantAttributeLinkId"
}
],
"generatedBy": "userGenerated",
"compositeKeyDeliminator": "_"
}
variantAttributeValue
{
"objectType": "variantAttributeValue",
"addOnDataStructure": [],
"canDelete": true,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"variantAttributeValueId": {
"type": "string",
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"randomOnCreate": true,
"validation": {
"pattern": "^[a-zA-Z0-9-_]+$"
},
"storageResourceTags": [
"graph"
]
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "variantAttributeValueId"
}
],
"generatedBy": "userGenerated",
"compositeKeyDeliminator": "_"
}
RelationshipSchemas
isVariantAttribute
{
"relationshipServiceTag": "VariantManager",
"fieldNames": {
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"graph"
],
"from": {
"objType": {
"objectType": "variantAttributeLink",
"serviceTag": "VariantManager"
},
"linkType": "many",
"direction": "from",
"requiredOnCreate": true,
"handler": false
},
"to": {
"objType": {
"objectType": "variantAttributeValue",
"serviceTag": "VariantManager"
},
"linkType": "one",
"direction": "to",
"requiredOnCreate": false,
"handler": false
},
"canDelete": false
}
],
"canMove": false
}
isVariantAttributeLabel
{
"relationshipServiceTag": "VariantManager",
"fieldNames": {
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"graph"
],
"from": {
"objType": {
"objectType": "variantAttributeValue",
"serviceTag": "VariantManager"
},
"linkType": "many",
"direction": "from",
"requiredOnCreate": true,
"handler": false
},
"to": {
"objType": {
"objectType": "variantAttributeLabel",
"serviceTag": "VariantManager"
},
"linkType": "one",
"direction": "to",
"requiredOnCreate": false,
"handler": false
},
"canDelete": false
}
],
"canMove": false
}
hasVariantAttributeLink
{
"relationshipServiceTag": "VariantManager",
"fieldNames": {
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"graph"
],
"from": {
"objType": {
"objectType": "variant",
"serviceTag": "VariantManager"
},
"linkType": "one",
"direction": "from",
"requiredOnCreate": false,
"handler": false
},
"to": {
"objType": {
"objectType": "variantAttributeLink",
"serviceTag": "VariantManager"
},
"linkType": "many",
"direction": "to",
"requiredOnCreate": true,
"handler": false
},
"canDelete": false
}
],
"canMove": false
}
disabledVariantAttributeLink
{
"relationshipServiceTag": "VariantManager",
"fieldNames": {
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"graph"
],
"from": {
"objType": {
"objectType": "variant",
"serviceTag": "VariantManager"
},
"linkType": "one",
"direction": "from",
"requiredOnCreate": false,
"handler": false
},
"to": {
"objType": {
"objectType": "variantAttributeLink",
"serviceTag": "VariantManager"
},
"linkType": "many",
"direction": "to",
"requiredOnCreate": false,
"handler": false
},
"canDelete": false
}
],
"canMove": false
}
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configKey: "ProductGraphServiceName"
configTag: "ProductGraphServiceName"
configValue: xxx // eg: "ProductGraph"
}
{
configKey: "VariantHandlerService"
configTag: xxx // variantHandlerServiceNameTag, eg: "VariantStandard", this is what is saved in each catalog record
configValue: {
serviceName: xxx // eg: "VariantStandard", this is the actual deployed service name}
}
}
{
configKey: "TranslateIdsType"
configTag: xxx // eg SellOffer > Product would be sellOffer_product
configValue: {
ttl: 64000 // number of seconds TranslateIdsCache records live for
}
}
VariantRecord
Records which Handler manages each variant
{
variantId
variantHandlerServiceNameTag
}
- partition key: variantId
- sort key: (none)
TranslateIdsCache
Stores a record for any unique translateId process
{
cacheId // fromType + "_" + fromDataId + "_" + toType
toDataId
expireTime
}
- partition key: cacheId
- sort key: toDataId
- expireTime is set as an automatic DynamoDB TTL attibute