I need someone to write a simple code to load a GeoIP CSV database into Redis so I can do IP searches into Redis.
The script will have to connect to URL-1, this URL-1 will respond a simple JSON containing a URL-2 to download the CSV file.
Not all fields in CSV database is required, I only need to save into Redis the following fields: country, stateprov, city, latitude, longitude, isp_name and organization_name. The fields can be saved as a string (JSON encoded).
When loading the csv database into Redis we will have to use a temporary key. Only when the process successfully finishes, we will delete the production key and then rename the temporary key to the production key. This process is necessary to minimize the downtime during the load.
I would like to separate the ipv4 and ipv6 locations into different keys so we can gain some performance during the searches. You can use 'ipv6' and 'ipv4' as key name in Redis for production.
I wouldn't like to add any credentials to Redis database in the script file. I would like to use a ".env" file for this purpose. An URL for the credentials would be better because in some environments we use host/port and others socket connection.
I will run this script in terminal using a command line, so the expected result should be something like:
node [login to view URL] [login to view URL]
php -f [login to view URL] [login to view URL]
./[login to view URL] [login to view URL]
It is not necessary to separate the logic into different files, unless you find it necessary. A readable code is important :)
You can see a line sample of the CSV and a code example to import the database to MySQL written in PHP on DB-IP technical documentation page.
DB-IP IP to Location + ISP database: [login to view URL]
DB-IP technical documentation: [login to view URL]
There is a very good example written in python on the official Redis page: [login to view URL]
What you will have to delivery?
1 - The import code written in PHP 7, NodeJS 12 or Python 3. Just pick up the best one for you.
2 - As we have to convert the IP to a score, I will need this "ip_to_score" function written in PHP and NodeJS so I can do the searches. This function in python is not required.
I can install php libs in my end if it is necessary like bcmath or something else. Same for python or NodeJS if it is required or improves the loading performance.
17 freelancers are bidding on average $183 for this job
Greetings, I have extensive experience in integration projects and I can help you with this task. Please provide more details about the what to use as keys and why we need to use temp keys. Thanks,
## DEAR CUSTOMER, I'M FULLSTACK DEVELOPER. I WILL BUILD THIS IMPORT SCRIPT FOR YOU EITHER IN PHP 7 OR IN NODEJS LATEST RELEASE. PLEASE TAKE A LOOK AT MY PROFILE AND LET US DISCUSS. THANKS ##
I can load csv file. Also i am Expert in Web Designing and Development, I can Built or revamp your Website with all of Requirements. Ready to start Work with you! Inbox me and let's talk to get started!