Explore our IP Address Database Downloads for instant access to our IP address insights

Learn more
2 years ago by IPinfo Team 14 min read

Migrating from MaxMind to IPinfo

Migrating from MaxMind to IPinfo - IPinfo.io

When it comes to IP geolocation, privacy/VPN detection, IP to ASN, IP to Company or any kind of IP address information needs, IPinfo stands out from the rest of the IP data providers. In reliability, accuracy, ease of use and dedicated support, IPinfo is the shinning star of the IP information industry.

That is the reason why we receive an incredible amount of inquiries about how to migrate from <insert_data_provider_name> to our IPinfo databases and API services. Our data experts are happy to help new users adapt to our database products without any disruptions. IPinfo’s database in it’s simplicity are incredibly easy to adapt to an existing data pipeline without breaking anything.

ipinfo.io is our one-stop shop for IP intelligence. This facilitates our clients' technical programs from marketing to security. We rely on ipinfo.io's incredibly up-to-date and accurate information daily.

One of the most frequent requests is about migrating from MaxMind, one of the oldest IP geolocation service providers. MaxMind with its free and basic databases is often the starting point for many users, businesses, and developers.

As users grow and scale up, they often come to us for our premium databases products, but they still want to make sure their old data pipelines, IT infrastructure, or cybersecurity measures don’t break. So in this guide, we will go through the database differences between MaxMind and IPinfo and how to migrate from a MaxMind stack to an IPinfo stack.

Database Offering: IPinfo vs MaxMind

One of the main reasons why MaxMind is so popular is its free databases. But that comes at a price, of accuracy. From MaxMind’s website:

GeoLite2 databases are free IP geolocation databases comparable to, but less accurate than, MaxMind’s GeoIP2 databases (Premium database).

That is one of the main reasons, why we don’t provide a free full location database, as accuracy is always the number one priority for IPinfo. We enable users to learn and develop, with one of the most accurate IP geolocation API services, which is based on our incredibly accurate premium databases. With 50,000 requests per month, our free IP geolocation API service can be considered a better alternative to MaxMind’s database offering, but without compromising accuracy.

MaxMind Free Databases MaxMind Premium Databases IPinfo Database
GeoLite2 City GeoIP2 City Database IPinfo IP to Geolocation Database
GeoLite2 ASN - IPinfo ASN Database
GeoLite2 Country GeoIP2 Country Database -
- - IPinfo IP to Company Database
- GeoIP2 Anonymous IP Database IPinfo Privacy Detection Database
- GeoIP2 Domains Database IPinfo Hosted Domains Database
- - IPinfo Abuse Contact Database
- GeoIP2 ISP Database IPinfo IP to Mobile Carrier Database
- - IPinfo WHOIS Database

For database offerings, MaxMind offers CSV and MMDB file formats like IPinfo. But we also offer data in JSON (NDJSON) format to enable data streaming purposes. You can read more about our various file formats and use cases in this article.

Get accurate geolocation data

Enhance user experience and strengthen your security with rich geolocation data.

Learn More
Get accurate geolocation data

GeoLite2/GeoIP ⇒ IPinfo’s IP to location database

MaxMind’s GeoLite2 and GeoIP databases are their IP to geolocation database that provides geolocation insights from IP addresses. The question is how it differs from our IP to location database. An issue with MaxMind’s database offering is that their adherence to the nested data format, while IPinfo’s datasets are flat and tabular. Our flat/tabular structure makes data queries easier and more efficient, making data ingestion straightforward.

Comparing the CSV Database offering

Even though CSV datasets are flat tabular, MaxMind’s nested data structure philosophy still holds true. That is why their Geolite2/GeoIP CSV database comes with two databases:

  • A location database
  • IP geolocation database, divided into IPv4 and IPv6 addresses

Now by combining the two databases you get the full picture of IP geolocation information. Which involves first looking up the IP address on IPv4 and IPv6 databases. Taking that geoname_id column, then looking up that value on the location database.

MaxMind packages its location database in multiple translated versions. But IPinfo offers their database in English out of the box, however, we are open to custom and translated data offerings.

With IPinfo’s IP to Geolocation database, we provide a simple experience with the optimum mix of essential data. Instead of maintaining two different databases, IPinfo provides all the essential location information in one database.

But one of the additional features of IPinfo is that we listen to our customers and we offer customized versions of our database. If your data or security solution relies heavily on the MaxMind location database or geonames.org’s data, let us know. We offer a custom database that includes geoname_id and network (we call it range) columns, but while still keeping the optimized data selection as our out-of-the-box database.

IPinfo IP to Geolocation IPinfo IP to Geolocation (Standard)
Network
  • start_ip
  • end_ip
  • join_key
  • range
    Location Data
    • city
    • region
    • country
    • latitude
    • longitude
    • postal_code
    • timezone
    • city
    • region
    • country
    • lat
    • lng
    • postal_code
    • region_code
    • timezone
    Additional Data
    • geoname_id

    Rather than providing all the information possible in one package and creating a bloated database, we offer the best value possible in one single database and provide guidance in creating data solutions that cater to the individualized needs of individual customers.

    Comparing the MMDB Database offering

    MMDB database format is designed with the purpose of extremely fast IP address information lookups. MMDB file lookups employ Binary Search Tree (BST) algorithm which enables users to look up IP addresses and relevant information at blazingly fast speed. The limitation is that MMDB files are designed only for IP address lookups.

    In the following video, we experiment with looking up the same IP address (8.8.8.8) 10,000 times in both MaxMind’s Geolite2 database and IPinfo’s IP to Geolocation database. What we find is that Maxmind’s MMDB database lookups are almost 2.5 times slower compared to IPinfo IP to Geolocation database lookups.

    Even if we run this experiment with a larger random IP address pool over numerous iterations, MaxMind’s MMDB lookup speed will consistently fall behind IPinfo’s. The reason behind that is, MaxMind tends to pack its individual data rows with various translations, each row of data tends to be larger.

    Compared to MaxMind’s data output, IPinfo provides a flat and simple output. We focus on the accuracy and usefulness of the data. From our core response, customers can develop their own solution that caters specifically to their needs.

    GeoLite2 ASN ⇒ IPinfo’s ASN database

    ASN databases can provide valuable insights into understanding which entities control which blocks of IP addresses. IP addresses to ASN databases are effective for cybersecurity, system administration, and IT purposes.

    MaxMind provides a free ASN database under their GeoLite2 umbrella of products. Here is what a single column looks like:

    Unlink the GeoLite2 City database this database comes with a single database. So, there is no location or additional context to the database.

    On the other hand, IPinfo’s ASN database comes with a whole host of useful information, such as:

    • ASN
    • Domain name
    • Name of the AS
    • ASN Type (ISP, Business, Education, Hosting)

    Comparing both database columns:

    Data Available IPinfo ASN Database MaxMind GeoLite2 ASN Database
    start_ip
    end_ip
    join_key
    network/range Can be easily created
    asn
    domain
    name
    type
    country

    GeoIP2 Anonymous IP ⇒ IPinfo Privacy Detection Database

    Anonymous IP or IP to Privacy databases provide valuable insights into understanding which IP addresses may be using privacy cloaking services such as VPN (Virtual Private Network), Proxies, TOR browser, Hosting, or Apple Relay services.

    The privacy detection database is especially useful to ensure cybersecurity measures, digital rights management through geofencing/geo-restrictions, fraud prevention, curbing unfair advantages, etc.

    When switching from MaxMind’s GeoIP2 Anonymous IP database, you get the extra Apple Relay detection service with us. One thing to note about the structure is that MaxMind uses 1 or blank to flag the identification of services, whereas we use true or blank.

    Data Provided MaxMind IPinfo Description
    VPN Both services can detect Virtual Private Networks (VPN)
    Hosting Both services can detect hosting provider services
    Proxy Both services can detect proxy services.
    Tor Both services can detect TOR exit nodes
    Apple Relay IPinfo can identify Apple Relay and other CDN-based relay services.
    Name of the service provider IPinfo can provide the name of the anonymous IP service provider.

    MaxMind provides a residential proxy field, but we have seen that residential proxies often lead to false positives. Moreover, MaxMind does not cover the peer-to-peer variant of residential proxy services. With the possibility of false positive flagging of normal IP addresses as residential proxy IP addresses, it creates friction in the user experience. The reliability and accuracy of residential proxy detection are often doubtful. Considering that, we choose not to provide this field with our database.

    GeoIP2 Domains Database ⇒ IPinfo Hosted Domains Database

    A domain database contains the name(s) of the domains hosted on a single IP address range or an IP address. Compared to MaxMind, the benefit of IPinfo’s Hosted Domains database is quite significant.

    MaxMind’s provides one domain per IP range. This is known as to us as IP to rDNS (Reverse DNS Resolution) Database. We have an online tool freely available for this information: https://ipinfo.io/tools/reverse-dns-lookup

    We do have IP to rDNS database available as a custom request database, but our core product, IPinfo Hosted Domains Database provides much more detailed and in-depth information. With MaxMind’s domain data, you get an IP range and a single domain. The two issues with that, are:

    • Domains are hosted on individual IP addresses, and IP ranges contain multiple IP addresses.
    • There is often more than one domain per IP page.

    For example, 54.241.64.0/20 contains 4096 IP addresses. Now, from MaxMind’s domains database, you get an incomplete picture of the domains hosted on the IP address. But looking into this IP range and going through each IP address we see:

    Number of Domains Number of IP Addresses
    1 69
    2 13
    3 5
    4 4
    61,401 1

    As you can see, the MaxMind domains database provides quite an incomplete picture of domains hosted on an IP address or domains associated with an IP address range.

    GeoIP2 ISP Database ⇒ IPinfo IP to Carrier Database

    GeoIP2 ISP Database provides carrier and ISP information. The alternative to the MaxMind database is our IPinfo IP to Mobile Carrier Database.

    The GeoIP2 ISP database provides the organization name, ASN, Mobile Country Code (if available), and Mobile Network Code (if available).

    IPinfo IP to Mobile Carrier database provides all the exact information and provides the country field as an additional field, however, the database does not provide the ASN information. But ASN information can be easily gathered by joining the IP to Mobile Carrier database to the IPinfo ASN Database.

    Migrating from MaxMind to IPinfo

    Now that we know the core differences between IPinfo and MaxMind let’s dive into some tips to migrate from MaxMind to IPinfo.

    MMDB: Nested data structure ⇒ Flat data structure

    As we have seen, MaxMind prefers a nested data structure for its IP geolocation database, which includes translations and location data. When choosing to migrate to IPinfo you should remember to switch the dictionary key and index sequences for looking up values.

    For example, let’s look up the IP address 190.15.222.234 using the Python MMDB reader library to get city, region, country.

    MaxMind Code:

    city = maxmind_data['city']['names']['en']
    # Output: Mendoza
    country = maxmind_data['country']['iso_code']
    # Output: AR
    region = maxmind_data['subdivisions'][0]['names']['en']
    # Output: Mendoza
    latitude = maxmind_data['location']['latitude']
    # Output: -32.8817
    longitude = maxmind_data['location']['longitude']
    # Output: -68.8125
    

    Now, let’s compare it IPinfo:

    city = ipinfo_data['city']
    # Output: Mendoza
    country = ipinfo_data['country']
    # Output: AR
    region = ipinfo_data['region']
    # Output: Mendoza
    latitude = ipinfo_data['latitude']
    # Output: -32.9778
    longitude = ipinfo_data['longitude']
    # Output: -68.8667
    

    With IPinfo your important data is present immediately, with no need to go through multiple nested indexing.

    Looking up the values of 190.15.222.234 and 8.8.8.8 on MaxMind’s Database.

    Another problem is that with these nested structures, what happens if the data is simply not present? Well, in that case, you get a KeyError . In IPinfo we provide consistent and structured data but in some instances, MaxMind might exclude entire sections like subdivisions, is_in_european_union. So you have to add “key check statements” prior to looking up specific values.

    >>> maxmind_data = maxmind_reader.get("84.62.185.236") # German IP address
    >>> maxmind_data['country']['is_in_european_union']
    
    ⇒ True
    
    >>> maxmind_data = maxmind_reader.get("163.48.137.181") # Japanese IP address
    >>> maxmind_data['country']['is_in_european_union']
    
    ⇒ KeyError: 'is_in_european_union'
    

    However, the argument can be made that:

    1. MaxMind provides additional data such as continent code, European union check, etc.
    2. MaxMind packages translation of different country names

    A. MaxMind provides additional data such as continent code, European Union check, etc.

    At IPinfo we believe in simplicity and efficiency. We provide continent code, European code and more data attributes with our official SDKs and Libraries for our API service: https://github.com/ipinfo

    However, for our database product, we think that these additional attributes are not difficult to code up by the customers themselves. For example, if a user to wants to see if an IP address belongs in the European Union domain, they can create a set of country codes and see if the IP country belongs there.

    >>> eu_countries = {'AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','HU','IE','IT','LT','LU','LV','MT','NL','PL','PT','RO','SE','SI','SK'}
    >>> ipinfo_data = ipinfo_reader.get("84.62.185.236") # German IP address
    >>> ipinfo_data["country"] in eu_countries
    
    ⇒ True
    
    >>> ipinfo_data = ipinfo_reader.get("163.48.137.181")  # Japanese IP address
    >>> ipinfo_data["country"] in eu_countries
    
    ⇒ False
    

    This simplicity allows you to do more. Do you want to include only European Union countries, what about Outermost Regions (OMR), Overseas Countries and Territories (OCT), Switzerland or the United Kingdom, etc? In this case, the user has the flexibility to construct their own data attributes.

    By constructing data dictionaries you included more data attributes such as continent, organization membership, economic data, demographic data, currency, capitals, etc.

    B. MaxMind packages translation of different country names

    Translation to different languages can be helpful in enabling users to understand the data. From our point of view, not all users require a translated database. Because we want to provide a universally beneficial database we have chosen to stick with one language for our standard database. But we do offer translated database option as well. In that case, please request a customized database from our sales team.

    Aside from that, we provide the geoname_id field with our IP information lookup which enables users to use a translated location database of their choice as well.

    CSV: No need for complimentary databases

    With MaxMind’s GeoIP/GeoLite2 IP location CSV databases you get mainly two types of databases: IP ranges blocks database and location database. The primary key for the IP ranges blocks database is the network and the foreign key is the geoname_id value. The primary key in the location database is the geoname_id

    The structure of MaxMind IP geolocation databases isn’t streamlined for its namesake, IP geolocation. To get city, region, country, and geolocation data you have to run two queries. The IP location comes in two different CSV files for IPv4 and IPv6 IP addresses.

    With database ingestion, this 2 database structure becomes complicated and cumbersome to maintain in an ETL pipeline or cybersecurity audit processes.

    To eliminate this friction IPinfo provides one database with all the useful data.

    If you are migrating from MaxMind you can use the IPinfo Standard database which includes the network range column which is similar to MaxMind’s IP geolocation database structure. The network range column enables users to use PostgreSQL’s CIDR data type like so:

    select '91.189.188.0/23'::cidr >> '91.189.188.0'; -- true
    select '91.189.188.0/23'::cidr >> '90.189.188.0'; -- false
    

    But if you want more flexibility with database ingestion you should use the IPinfo IP to Geolocation database with start_ip and end_ip which enables you to use BETWEEN function to run query lookups.

    Hosted Domains Database comes with a full domain list

    MaxMind’s domains database contains one domain per IP address range. On the other hand, we provide a database of IP addresses and domains hosted on each IP address. The domains field contains a list of domains each separated by a comma ,. Some DBMS like Postgres and Snowflake support array variables that you can use to process the domains field.

    MaxMind’s MMDB reader libraries work with IPinfo

    All of MaxMind’s MMDB reader libraries can read, IPinfo’s MMDB database as well. The MMDB reader libraries are:

    Additionally, if any other library/SDK supports reading MMDB files, those libraries can also read IPinfo’s MMDB database. In the IPinfo migration process, users just need to be aware of the difference in data structures between the two databases.

    // comparing the ASN MMDB databases
    import maxmind from 'maxmind';
    const maxmind_lookup = await maxmind.open('mmdb_databases/maxmind_geolite2_asn.mmdb');
    const ipinfo_lookup = await maxmind.open('mmdb_databases/ipinfo_asn.mmdb');
    
    console.log(maxmind_lookup.get('184.109.44.141'))
    console.log(ipinfo_lookup.get('184.109.44.141'))
    

    Result:

    // MaxMind ASN Database
    {
      autonomous_system_number: 7922,
      autonomous_system_organization: 'COMCAST-7922'
    }
    
    // IPinfo ASN MMDB Database
    {
      asn: 'AS7922',
      domain: 'comcast.com',
      name: 'Comcast Cable Communications, LLC',
      route: '184.108.0.0/14',
      type: 'isp'
    }
    

    Harnessing the power of IPinfo’s CLI and mmdbctl

    At IPinfo we believe in enabling users to get up and running with our data products with as little friction as possible. That is why we have built open-source tools such as — ipinfo/cli and mmdbctl, which ease many operations of our customers.

    IPinfo CLI Tool

    🔗 https://github.com/ipinfo/cli

    The IPinfo CLI comes with many features and options but the majority of them focus on our API product. But we have included a few features that address some common needs with our database product. Such as:

    • ipinfo grepip : Extract/grep IP addresses (IPv4/IPv6) from plaintext
    • ipinfo prips : Print all the IP addresses in CIDR (1.1.1.0/30) or IP address range (8.8.8.0-8.8.8.255)
    • ipinfo cidr2range : Convert CIDR or Network blocks (1.1.1.0/30) to IP ranges (8.8.8.0-8.8.8.255)
    • ipinfo cidr2ip : Extract individual IP addresses from CIDR
    • ipinfo range2cidr : Convert IP address ranges to CIDR value
    • ipinfo range2ip : Extract individual IP addresses from an IP range
    • ipinfo randip : Get random IP addresses for testing
    • ipinfo splitcidr : Split a larger CIDR to smaller CIDR blocks

    Some of the commands can be applied to the database as well.

    mmdbctl

    🔗 https://github.com/ipinfo/mmdbctl

    mmdbctl is a versatile CLI tool designed for working with IPinfo’s MMDB files.

    With the mmdbctl tool:

    • you can look up IP addresses from your terminal of choice
    • you can output the results in JSON, CSV, or TSV format
    • you can convert MMDB files to CSV files
    • you can convert CSV files to MMDB files
    • you can extract metadata from MMDB files
    mmdbctl demo on IPinfo databases

    The mmdbctl tool is especially useful if you want to create custom MMDB files. MMDB files are binary, which means they can’t be edited easily. The advantage of them is that they are incredibly fast at IP address lookups. With the help of mmdbctl, you can customize an IPinfo CSV database and then convert it to an MMDB file.

    For example, let’s say you want to create a United States-only IP address database. So, start with the IP to Geolocation CSV database, then:

    Step 1. Filter your CSV database with the command:

    (head -1 location.csv;grep ",US," location.csv) > location_us.csv
    

    Step 2. Then you can convert the location_us.csv file to an MMDB database:

    mmdbctl import --in location_us.csv --out location_us.mmdb
    

    And voila, you have a custom MMDB database containing only US IP address locations.

    Attempting to do this type of operation using MaxMind’s databases is quite difficult. Operational ease is definitely one of the perks of switching to IPinfo.


    Compared to MaxMind’s offering, IPinfo provides a more user-friendly database product that facilitates faster lookups, reliable data, and an expert team at your disposal. If you need any assistance or have any questions about switching data providers and adopting our database products connect with one of our data experts today.

    About the author

    IPinfo Team

    IPinfo Team

    Internet Data Expert