S
S
sergeevpetro2016-04-05 10:54:55
Database
sergeevpetro, 2016-04-05 10:54:55

Quick search in the database. What to choose?

Hello dear!
It is necessary to develop a program to work with a constantly growing database. The algorithm of the program is very simple: if the string does not exist in the database, then add it to the database.
The question is that the database is planned to be very large, about a million records and constantly accessing it to check the existence of a particular line. The base does not exist yet, but it is planned that it will be simple in structure, approximately "key-value" ...
I will write in C#.
It would be interesting to know in what format it is best to store the database (XML, JSON, etc. except SQL) and what search algorithm to use so that this business works quickly.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Arseniy Efremov, 2016-04-05
@sergeevpetro

Don't like SQL - use NoSQL like MongoDB . There, at the same time, indexes are supported and all that. You can organize a tree. Or you can use a metric space for custom hashes of strings. It's as you wish.

X
xmoonlight, 2016-04-05
@xmoonlight

Look towards the organization of the tree.
Each tree node is a letter in a string.
The best way to store a tree is binary sequences.

D
Dmitry Eremin, 2016-04-05
@EreminD

A large (really) amount of structured data -> DB
Well, there are already indexes, HP and other performance improvement stories

S
Stanislav Makarov, 2016-04-05
@Nipheris

other than SQL

Well, if not SQL (what are the objective reasons?), then take any key-value base and write to it. Will the search go by the key in whole or in part?
You have now described a standard task for any normal database. Those. the one with the indexes. Reasoning only makes sense if you specify how often rows will be inserted, and what exactly the samples will be.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question