I have 4 sources of IP addresses, I want to store them in SQL Server and allow ranges that can be classified by the source code of the country, which should be copied to the list of exceptions by country.
For this, I have 2 tables.
IPAddressRange CountryCode
What I need to know if this data was returned to the client and then cached for a quick request, which is the best way to store the returned data for a specific IP address within ranges. I want to know if the incoming IP address is included in the list.
The reason the list is in db is because of the simple storage.
The reason I want to cache, then use the data on the client, is because I heard that IP lookups are faster in the trie structure. So, I think I need to get the list from db, store in cache in a very fast structure.
Any help in A) An SQL structure for storing addresses and b) Code for finding IP addresses.
I know a solution for a code project that has a code algorithm for searching, not sure how to mix it with the storage aspect.
Ideally, without using a third-party library. The code must be on our own server.
source
share