QZDB IP Lookup: Installation, Data Model, and Trade-Offs
👑 qqzeng-ip/QZDB 极速IP解析引擎 | Next-gen High-Performance IP Lookup Engine (IPv4 & IPv6). Supports LPM, zero-allocation SDKs (C/Rust/Go/Java/C#/NodeJS/Python/PHP) & DBMS scripts.
At a glance
- What is it?
- QZDB is a binary IP geolocation engine with SDKs for eight languages and IPv4 and IPv6 lookup. It suits applications that need local, read-only network-range searches, but adoption depends on accepting its database distribution and packaging model.
- Who is it for?
- QZDB fits teams that need local IP geolocation with a native-style SDK and can manage its database files as application data. It is less suitable for teams that require database queries, a documented GitHub release history, or a fully self-contained open source lookup stack.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 4 days ago.
- What is it written in?
- Mainly C#, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.
Editorial analysis
QZDB's IP Geolocation Use Case and Audience
QZDB addresses the case where an application must map an IP address to geographic and network attributes without sending every request to a remote geolocation API. The repository describes QZDB as a binary search engine for IPv4 and IPv6, with fields for continent, country, province, city, latitude and longitude, time zone, and internet service provider. That makes it relevant to DNS routing, CDN selection, access-risk checks, regional content rules, and other services that need an IP-based routing decision.
The intended callers are software teams working in Rust, C or C++, Go, Java, C#, Node.js, PHP, and Python. Its read-only instance model is particularly relevant to long-running services that load data once and handle concurrent lookups. The repository also includes separate SDK directories for classic IP formats, phone-number location data, database scripts for MySQL, PostgreSQL, and SQL Server, and historical versions. That breadth can confuse the adoption boundary: QZDB itself is the current binary engine under `ip-qzdb-sdk/`, while the phone-number and SQL products solve related but different problems.
The database edition remains a material dependency. The repository contains demo data, including `demo/qqzeng-ip-ult.qzdb`, but the README does not define a command for downloading or refreshing every production dataset. A team can evaluate the engine without changing its surrounding architecture, yet it still needs a process for obtaining, versioning, validating, and replacing QZDB files.
How QZDB Traverses IPv4 and IPv6 Records
According to the architecture section referenced by the README, QZDB uses a two-stage Patricia trie structure and a jump table. Patricia tries represent network prefixes as paths, which makes prefix matching a natural operation for CIDR data. A conventional trie can waste space when addresses contain long shared or sparse prefix sequences. The README describes a prefix compaction method and attributes the resulting small file size to that design.
The binary file is not documented as a collection of text records that an application scans line by line. Instead, the reader loads the file and searches its internal structure. In the compiled SDKs, the documented implementation path is read-only memory mapping, or `mmap`. This avoids copying the whole database into managed heap memory and lets lookup code read mapped pages as needed. The README characterizes C, Rust, and Go lookup as zero heap allocation. It also describes concurrent access to a loaded instance as lock-free, although that statement does not establish the synchronization model for every language binding.
At the API level, the Python example exposes two related operations. `find_str` accepts an IP address and returns a pipe-delimited value such as `亚洲|CN|中国|江苏|南京|中国电信`. `find` returns a structured `GeoInfo` object with named attributes such as `country`, `province`, `city`, and `isp`. Applications that need fields rather than display text should prefer the structured operation. The exact serialization for other languages is not included in the README excerpt, so cross-language return types should not be assumed to be identical.
Installing QZDB for a First Python Lookup
The repository publishes a Python package named `qzdb` on PyPI. The documented installation does not require cloning the repository. Install it in the environment used by the application, then place a compatible `.qzdb` file where the process can read it. The repository's `demo/` directory contains `qqzeng-ip-ult.qzdb`, which is the example filename used by the README.
Install the Python package with:
pip install qzdbA minimal lookup can then follow the README's Python example. This code creates one reader, performs a text lookup, and accesses the structured result:
from qzdb import QzdbReader
searcher = QzdbReader("demo/qqzeng-ip-ult.qzdb")
print(searcher.find_str("114.114.114.114"))
loc = searcher.find("114.114.114.114")
if loc:
print(loc.country, loc.province, loc.city, loc.isp)The README example uses the filename `qqzeng_ip_ult_china.qzdb`, while the repository layout exposes `demo/qqzeng-ip-ult.qzdb`. The path above follows the repository entry, but a user must ensure that the selected file is compatible with the SDK and contains the records being queried. The expected text example is `亚洲|CN|中国|江苏|南京|中国电信`. If `find` returns `None`, the example checks that condition before reading object fields.
The README says the normal service pattern is one load followed by long-lived use and concurrent lookup. This is not a per-request constructor tutorial. Database replacement strategy is not documented in the README, so a production application must establish its own file lifecycle before adopting the example as an operational template.
QZDB Package Choices and Operational Constraints
QZDB distributes official packages through Maven Central, NuGet, PyPI, npm, crates.io, Packagist, and the Go Module directory. This gives teams a conventional installation route in most supported ecosystems. The C and C++ integration is different: the README directs users to download `qzdb_reader.c` and `qzdb_reader.h` and compile them together. That source-level integration may fit an existing native build, but it requires more attention to compilation and deployment than a package-manager dependency.
The primary language is C#, and the C# package identifier is `QQZeng.Qzdb`. Node.js uses the scoped package `@qqzengip/qzdb`, while PHP and Rust both use `qzdb` within their respective package ecosystems. These names are easy to conflate outside their native registries. Package publication is clearly documented, but the repository has no GitHub releases. That means a GitHub release page cannot be used as the upgrade baseline for this repository. Version selection must instead come from the relevant package registry and the repository's `CHANGELOG.md`.
The availability of MySQL, PostgreSQL, and SQL Server scripts does not mean QZDB lookup requires a relational database. The relationship between those scripts and the current engine deployment is not explained in the README. Teams wanting ad hoc CIDR filtering, joins, or conventional database administration may find the SQL scripts more natural, but they would be changing from a mapped binary lookup to a database-backed model rather than merely adding an install method to QZDB.
Performance Claims, Accuracy Scope, and Wrong-Tool Cases
The README publishes benchmark tables and states that a complete reproduction method is in `docs/PERFORMANCE.md`. Those figures are project claims, not independent measurements, and the page does not reproduce the environment or execution procedure. It reports different results for integer lookups and string lookups that include IP parsing. It also states that performance on x86 systems is usually lower than on the listed Apple M4 Max environment. Capacity planning should therefore avoid transferring the displayed throughput directly to a production server.
The accuracy statement is narrower than a general guarantee of global freshness. According to the README, boundaries and center addresses for `959,162` CIDR ranges were checked in `2,877,486` comparisons. That describes the repository's validation scope, but it does not identify the effective date, collection source, or update interval of every country dataset. IP allocation records change, and the README does not document how quickly a new allocation reaches a downloaded QZDB file.
QZDB is also the wrong tool when the primary requirement is transactionally editable relational data, arbitrary joins, or rollback of database rows. The separate SQL product line targets large-scale ingestion, but it is not described as a transparent administrative interface over the binary engine. It is similarly a poor fit for applications that need to accept arbitrary user-submitted geolocation corrections through normal database transactions. The engine is designed around read-only lookup, so its fit depends on accepting files as versioned datasets rather than rows edited during normal requests.
QZDB Maintenance Signals, License, and Upgrade Work
The repository is not archived, and its last push was on 2026-10-17. Those facts indicate recent repository activity at that date, but they do not prove that every packaged SDK or dataset is released with the same cadence. There are no GitHub releases, so changes may be distributed through package registries or committed directly to the repository without a corresponding GitHub release entry.
The project is licensed under MIT. That permits use, modification, distribution, and sublicensing subject to the license conditions, but the license does not describe the provenance, refresh date, or permitted redistribution terms of the QZDB data itself. An engineer should therefore distinguish between the repository and SDK code under `LICENSE` and the database file being deployed. The README does not provide a separate data license, so teams should obtain clear terms for their intended data edition before shipping it.
Upgrades can affect at least two version boundaries: the package version selected from the language registry and the QZDB binary format used by the reader. The README states that there are five version fields in the data specification and points to the `ip-qzdb-sdk/` tree, but the README excerpt does not document a compatibility matrix or in-place database migration procedure. An upgrade review should therefore compare package release notes and `CHANGELOG.md`, then validate the new reader against the exact data file already used by the service.
Editorial conclusion
QZDB fits teams that need local IP geolocation with a native-style SDK and can manage its database files as application data. It is less suitable for teams that require database queries, a documented GitHub release history, or a fully self-contained open source lookup stack. Before adoption, verify the accuracy and update cadence of the exact QZDB data edition for the required countries and fields, then confirm that the selected language package exposes the expected API.
Frequently asked questions
How do I install the QZDB Python package?
The README documents `pip install qzdb`. It then shows loading a `.qzdb` file with `QzdbReader`; the repository also contains `demo/qqzeng-ip-ult.qzdb`.
Does QZDB support IPv6 and structured geolocation results?
The project description says QZDB supports IPv4 and IPv6. The Python `find` method returns a structured result with named fields such as country, province, city, and ISP.
How are new versions of QZDB distributed?
The README lists packages on Maven Central, NuGet, PyPI, npm, crates.io, Packagist, and the Go Module directory. The repository has no GitHub releases, so package registries are the documented distribution points for those SDKs.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/zengzhan-qqzeng-ip)Was this useful?