Answer the question
In order to leave comments, you need to log in
What is the most optimal/reliable option for data storage?
Greetings,
Looking for an optimal / secure / fast way to store data.
I work with a bash script that, after processing, must record the "website domain" somewhere and then check whether it has already been processed.
At the moment, about 1.5 million domains have already accumulated (domain type: yandex.ru, google.com, toster.ru, etc.).
I did not think that there would be such a volume of data, so I did not immediately think about scalability.
Considering that this is only "for me", I implemented it stupidly and in haste - I create folders with domain names in the sites / folder and then just search to see if the directory exists :) Everything works pretty fast.
Code example:
if [ -d "$systemdir/$downloadfolder" ]
then
echo "nothing to do" # папка существует
else
mkdir -p $systemdir/$downloadfolder
fi
Answer the question
In order to leave comments, you need to log in
Take redis and tweak disk sync depending on your server's paranoia and performance.
The fact is that the table hash is the ideal data structure for your task.
And so I thought about changing the principle of work.
1. You can store everything in a text file and record / search on it - a file of about 130 mb - it seems to work quickly.
Directories nafig are not needed, because only an extra load on the file system when searching for an existing one.
Instead, use Redis with its SADD, SISMEMBER.
I'm more looking for the best and easiest way to work/deploy from backups.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question