Answer the question
In order to leave comments, you need to log in
What database can be used to store the set?
I am confused in the wording of the set itself, so the question is somewhat vague. I ask for help in choosing a DBMS for such a task. I worked exclusively with MySQL, but relational databases are not suitable in this context.
A set is represented by "ordered" records, possibly stored in a nested set analogy, a "pseudo" tree structure. For example:
1. We recorded several records consecutively. Now they are, at a minimum, ordered by the primary key and the date the record was added. All the salt comes up on the second, third... (N) round.
2. It is necessary to add an entry after any previously added one (for example, but not the last one). And so an unlimited number of times.
In the storage system, the question arises with the principle of ordering multiple records. I've found at least two solutions so far. The most optimal, nested set: add to each record the ID information of the previous and subsequent record. On the set at the second stage of the selection, you can build a sequence:
- select all the records of the set [stage 1], cycle through the received data for sorting (getting a sequence) and query the database for the necessary records by ID(where `id` IN(..sequence. .)). Then, each time a new record is added, it is necessary to make a complete selection of the set, and cache the resulting sequence. With each insert, the cache is completely overwritten. The complexity of saving grows linearly, the sample is optimal.
- Or make the number of queries to the database a multiple of the required number of records. "Find me record number 1" - the received data will contain information about the next record (for example, 55), we make the following request "Find me record number 55" and so on according to the required number. The complexity of saving is optimal, the complexity of the sample grows linearly with the number of records in the sample.
The solution is extremely non-optimal, since it is based on relational DBMS, which are not designed to store such sets.
Can you please tell me what DBMS can be used to store and retrieve a sequence of such records?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question