Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better API for insertion of JSON into InfluxDB is not implemented yet #3174

Closed
shaileshswapnil opened this issue Jun 29, 2015 · 5 comments
Closed

Comments

@shaileshswapnil
Copy link

Hello,
I was trying to insert my JSON data into the InfluxDB using the HttpUrlConnection and Apache Client service available with java. I am bit surprised that none of the method is being supported to dump data directly into the db. The API which is available to perform this task in java "influxdb-java" also comes with so much of dependencies. I am bit amazed that there is no simple implementation of the API, which says specify the URL and specify the Data, and execute the method, which will send the data into the DB. Why there is so much of complexity just to do a simple task.

My apologies, if I am wrong or missed something while exploring the simplicity of InfluxDB.
Till now it was very simple and user friendly to me, until I came across this issue, which is like a show stopper for me.

InfluxDB version: Any
OS: Linux Shailesh 2.6.32-431.17.1.el6.x86_64 #1 SMP Wed May 7 23:32:49 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

@majst01
Copy link
Contributor

majst01 commented Jun 29, 2015

Hi,

im the author of influxdb-java. You probably missed that the json write API is deprecated and will be removed in one of the next influxdb releases. The json write api is replaced with the lineprotocol (https://github.com/influxdb/influxdb/blob/master/tsdb/README.md)

What is your exact problem of having some dependencies (it is retrofit and okhttp from square for runtime, all other for test) ? Can you please elaborate a bit on that ?

Other than that you can of course reuse/clone parts of my implementation of the lineprotocol ( https://github.com/influxdb/influxdb-java/blob/master/src/main/java/org/influxdb/dto/Point.java#L203 ) and write your own client based on that.

Greetings
Stefan

@tedyoung
Copy link

btw, I was confused by the API change as well, since I had been reading the 0.8 API spec. It was not easy to track down the major changes from 0.8 -> 0.9. Reading the changelog was not useful since it was too fine-grained. Is there a "here's the big picture of things that changed" document?

@shaileshswapnil
Copy link
Author

Moving from old to new is always good, but my point is, why not to take care of what is already discovered and implemented. Or else why can't the new implementation supports the older technique. People who has already implemented older version according to their need and choice, its like forcing them to shift to the new version and even change their architectural logic to be able to use this technology.

Yes my problem is the above mentioned dependencies. Why can't a single API which says dump JSON or data in a single go. That dependencies also upgrading and its bit difficult to look for proper version of dependencies as there is no proper documentation regarding.

So my suggestion is why can't we implement InfluxDB itself, to support multiple type of data insertion using any simple POST method, without the use of complex headers.

Or else we can implement a single JAVA API that provides this feature with ease.

Greetings
Swapnil

@majst01
Copy link
Contributor

majst01 commented Jun 30, 2015

@tedyoung : The Changes between 0.8 and 0.9 of influxdb are significant, therefore the API of influxdb-java changes as well a lot, to reflect the totally new Ideas of tags and so.

@majst01
Copy link
Contributor

majst01 commented Jun 30, 2015

@shaileshswapnil : The influxdb-java up to 1.6 only supports influxdb up to 0.8.8 and the influxdb-java version 2.0-SNAPSHOT only support influxdb 0.9 and newer. As the differences in API design of influxdb 0.9 to 0.8 are so big there is no way to keep the java client API the same.

Regarding dependencies: influxdb-java is a maven project and as long as you build your code with maven/gradle as well your resulting jar/war/ear whatever will contain the right versions of dependent libraries as well. The dependencies are documented in the pom.xml.
So no need to manually check which version is required.

If you want to implement a even simpler JAVA API to talk to influxdb it is up to you, if you feel that my implementation is not the right for your needs you can fork mine or start from scratch and implement your ideas. Or even better, come with pull requests which simplifies influxdb-java.

This is how Open Source development works.
Greetings
Stefan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants