Answer the question
In order to leave comments, you need to log in
Which DB is best for storing relevance?
Which of the databases is best suited for storing the degree of correspondence between products? Roughly speaking, it is planned to store the id in the database, what products it is associated with and how high the degree of correspondence with this or that product is. The number of links is not limited. The read speed is more important than the write speed, but the write will also go constantly.
Answer the question
In order to leave comments, you need to log in
In principle, in your case, most likely any nosql database will do, you can easily store an object with an array of related products for each product + each array will be an object with fields about the degree of correspondence.
The thing is, how will you choose them, one at a time, or by the condition of the connection? If by connection, then this is, in principle, a resource-intensive operation, then it is better to choose a relational database, there will be a label id, link_id, level
. In this case, you can safely choose by the level of connection, for example.
It’s better to choose a database not by “how best to store”, but by “how easier it is to choose”, and here the question already arises, by what criteria will you choose?
Judging by the data model, the selection will be from the product to its analogues, sorted by the strength of the relationship in descending order. Accordingly, with the correct model and indexes, the answer will be almost instantaneous on the SQL server. If the load grows, divide the read-write databases through replication.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question