Comments (9)
I have consider this in the past, but I am not sure we want to expose all of the metadata as much of it is internal information about the structure of the database. From your description, I assume you are primarily interested in the build date. Is this correct?
from geoip2-java.
Correct - the build date and the major binary version (to make sure that the db format was not changed in a way that it will become unreadable to the current code version).
From what I see in the metadata structure these three are definitely important:
"binary_format_major_version"
"binary_format_minor_version"
"build_epoch"
And this is nice to have as a general info:
"node_count"
Not sure if these contain any valuable info:
"database_type"
"languages"
"description"
"ip_version" (IPv4/IPv6)
Internal, not much business value:
"record_size"
from geoip2-java.
The problem is that the code has currently no way of figuring out if the geoIp DB is out of date and if it is binary compatible or not.
Sure, if the time stamp of the file is more than a month old we should probably go and download the latest one. But file timestamp alone is not a very reliable indicator - for example, a build or deployment process can copy a geo IP file somewhere and update the timestamp in the process.
This is why it is important to have an API to get some metadata out of the file.
Having direct access to the metadata would decrease the number of download requests to the site so it would be beneficial to MaxMind as well.
from geoip2-java.
I agree. We will need to refactor the metadata class before exposing it, but I think that at least some of the information in there is valuable to the users of the database.
from geoip2-java.
Is there any progress in providing the Maxmind database version via API? I think its very usefull for both sides!
Furthermore is there any more specific plan when the Java API will leave the Beta-version state?
from geoip2-java.
We are in the process of exposing the metadata. We expect to remove the beta label in early October.
from geoip2-java.
Great, thanks Greg!
Once the version is exposed via the API it would be nice to expose an endpoint on MaxMind's website to be able to get the version of the latest DB available for download. This way the code running on the client side can figure out if it makes sense to make the expensive (for both the client and MaxMind) call to download the latest DB.
For example, the latest GeoLite2-City.mmdb.gz file can be downloaded from /download/geoip/database/, it would be nice to have another URL that when called would return the version of the file(s) available for download in some common format (JSON, XML, etc.). It could be a single URL for all available files for download or a URL per file (could be a unique path or the same path, diff. URL query params). This way the client code can check the version of the currently downloaded DB, then call this URL and see what the version of the DB available for download is and if the two match - do nothing. If the one available at the MaxMind's site is newer - only then proceed with the download.
from geoip2-java.
Good idea. I'll pass it on.
There is now a getMetadata()
method in the DatabaseReader
class. This exposes most of the metadata.
from geoip2-java.
Thanks a lot for the fast reply. The getMetadata() method works great!
from geoip2-java.
Related Issues (20)
- Why is the Chinese name parsed by Taiwan's IP as the Republic of China?, I strongly protest this, please change it to China! HOT 1
- java.lang.NoSuchMethodError: No virtual method getParameterCount() HOT 4
- Documentation: Does the client support updategeodb? HOT 1
- connection reset exception raised when requesting the country of an IP HOT 2
- Java library crashes on presence of location fields: average_income and population_density HOT 10
- ERROR: java.lang.ClassCastException: Cannot cast java.lang.String to com.maxmind.geoip2.model.AsnResponse. HOT 2
- WebServiceClient crash on Android platform HOT 1
- java.lang.OutOfMemoryError: Java heap space HOT 5
- in android 6.0 HOT 4
- Some IP addresses return IllegalArgument Exception from DatabaseReader HOT 12
- legacy to now HOT 2
- Add equals and hashCode to the classes HOT 3
- JPMS support HOT 2
- New release for security vulnerability HOT 1
- We need Address (or city,country and zip code) to Longitude and Latitude and we have maxmind data HOT 1
- Version 4.0.0 and 4.0.1 cannot access com.maxmind.db.CHMCache HOT 2
- GraalVM Support HOT 3
- What happen using reader.asn(ipAddress) when the ipaddress has many network prefix in the mmdb file HOT 3
- Wrong comment about locales HOT 1
- GeoIp2Provider doesn't define insights methods HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geoip2-java.