-
Notifications
You must be signed in to change notification settings - Fork 478
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
Batching / Request Buffering feature review #148
Comments
I would propose to start with #144 so that processor can still send data to influx after some temporary failure and then go for buffering with limit discarding newest/oldest/throwing exception. |
I would opt for buffering, without it I would discard the whole library and just do a String concat myself. Losing data is a bad thing, as the data is often not easily or at all reproducible. My expectation would be that it should be able to survive at least an InfluxDB restart or a few network glitches. Initial step might be (don't know if that happens right now) is to retry a pending post a few times, as this would have minimal memory overhead as the request is already created. IIRC this is available in OkHttp? Next step would be to add buffering, up to a limit. Only after this is breached, it could discard entries according to a user specified strategy, e.g. oldest/newest/random/throw. Make it possible to extend the strategy to have a callback on discard, so if people want to add disk buffering or have a local disk dump as a last resort backup, they can. So in short, yes for buffering and 1. prevent OOM and 2. prevent loss of data at all cost, in that order. |
@mmatloka Any luck? |
Sad we still dont have buffering, losing data sucks. |
It has been ages since I posted this issue. We solved this in our application. I tend to think that there is not likely to be a simple way to solve all of these issues in the client library (as the solution usually depends on the use case). I am closing the issue. |
Hi all (sorry for the length),
I think there are some key features that need to be discussed before a few of the issues / PRs can be resolved. These are:
Issue #99 - OutOfMemoryError
Issue #107 - Data retention options
Issue #118 - BatchProcessor stop execution
Issue #126 - Allow to write lines directly (as strings) -> Related due to design implications
Issue #138 - Enable point batching by default
Issue #143 - Batch schedule stops working after connection issue (dup of #118)
PR #108 - Data retention enhancement (by @andrewdodd)
PR #119 - Batch processor keeps data points queued on failed write (by @PaulWeakley)
PR #137 - Allow to write lines directly to the database (by @slomek) -> Related due to design implications
PR #144 - BatchProcessor exception handling (by @mmatloka)
PR #146 - Add support for async requests (by @TopShelfSolutions) -> Related due to design implications
PR #147 - Put should always be async (by @jazdw) -> Related due to design implications
All of these issues are to do with (or impact the future of) the 'automatic collection & batch sending of points' feature.
My summary of the key issues:
For me, the questions that need to be resolved are:
Option 1 - Yes, it should allow buffering
Although it is not the most beautiful thing in the world, I believe that my PR #108 is the only solution here that allows the user to decide:
Unfortunately, it has the following issues:
Option 2 - No, let's forget this buffering thing
This could potentially make a lot of these issues go away. However, it would really just push this (very common) issue back onto the users of the library. This option means:
My opinion
I think the batch processor is a good feature. I believe this because the process of 'buffering and sending' to InfluxDB seems to be a pretty common usage pattern. The batch processor feature allows the 'write' operations in my applications to be simple (i.e. I can treat everything as a single write); but it allows the improved write performance of a batched write; and it guarantees my data won't be lost in an unexpected way (with PR #108).
I would love to hear what other people using this library have to say on the issue.
The text was updated successfully, but these errors were encountered: