FgForrest / evitaDB

evitaDB is a specialized database with an easy-to-use API for e-commerce systems. It is a low-latency NoSQL in-memory engine that handles all the complex tasks that e-commerce systems have to deal with on a daily basis. evitaDB is expected to act as a fast secondary lookup/search index used by front stores.
https://evitadb.io
Other
62 stars 7 forks source link

Entity archiving (soft-delete support) #677

Open novoj opened 1 month ago

novoj commented 1 month ago

Some e-commerce implementations provide access to products long after they are no longer offered and manufactured. These products are usually used as a source of technical information or simply for SEO purposes and linking to orders or customer history. It doesn't make sense to keep these products in active indexes in RAM, and it's usually not wanted. These products are likely to be searched only by their primary key or URL and nothing else. Some clients solve this problem by introducing a separate entity collection - something like ObsoleteProduct, but this solution complicates the result schema because all relations to the old products (like related products or category products) need to be duplicated and rewired to a new entity type.

To simplify this common scenario, let's introduce entity archiving. This state will behave like "soft delete" - i.e. the data will remain in place, but will be flagged as archived and excluded from search indexes (and there from occupying RAM). They'll only remain in indexes explicitly marked as valid, even for archived entities.

A new archivedEntities requirement will also be added, which will cause the client issuing the query to expect archived entities to be returned along with the active ones. Of course, the query must filter the entities by indexes/primary keys that are also available for archived entities in order to find them.

lukashornych commented 5 days ago

Added breaking change tag, because there will be breaking changes in GQL and REST API input mutation objects as well as response schema API objects due to the scopes API.