Is it possible to use the “pre-calculated” map reduction index (à la RavenDB / CouchDB) for this type of algorithm?

I'm trying to figure out if a particular algorithm can be converted to the type of map reduction index used by RavenDB / CouchDB, i.e. a “pre-computed” snapshot of the map (which means that the indices are updated when inserted and updated, and not when the actual query is executed).

Let's say we have a typical online store with 50,000 products grouped by category. Each product has a collection of "Attribute Values", that is, something like "[Red, Round, Metal]".

Since there are so many products on our website and there may be many elements in each category, we want to give the user a different way to “filter” the products that he currently sees.

For example, if the category is "Less than $ 20," there are a ton of products in this category. But our user should only see products whose value is less than $ 20 and red. Unfortunately, in the Less Than $ 20 category, there is no Red subcategory.

Our algorithm will take the current list of products and generate a list of "interesting" attributes and attribute values, that is, given the list of products, it will produce something like:

Color
   Red (40)
   Blue (32)
   Yellow (17)
Material
   Metal (37)
   Plastic (36)
   Wood (23)
Shape
   Square (56)
   Round (17)
   Cylinder (12)

- RavenDB/CouchDB? , ( ), , ?

A Visual Studio Visual # 4.0, , - (, , ).

+3
2

. CouchDB, .

, , : 500 000 , 500 000 , , B- ( , , false, null).

CouchDB ( , N B- N 2). 2 250 000 ( ).

CouchDB , , [A], [A, B] [A, B, C] [A, B, C]. , 2 250 000 "" 2 249,999...

, , , . , N , sqrt(N/2) B-, , .

: , " A, B C", :

 AvgCategories * AvgAttr * 2 ^ (AvgAttr - 1) * 500,000

[Category,Attr,Attr,...] , +. 1 3 , 6 , .

+2

- CouchDB. , , , "1". , . , .

0

Source: https://habr.com/ru/post/1776945/


All Articles