<div dir="ltr">On Thu, Dec 15, 2016 at 9:54 AM, Emmanuel Bernard <span dir="ltr">&lt;<a href="mailto:emmanuel@hibernate.org" target="_blank">emmanuel@hibernate.org</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The goal is as followed: allow to collect all changes to push them to Debezium and thus Kafka.<br>
<br>
This need does not require to remember all changes since the beginning of time in Infinispan. Just enough to:<br>
- let Kafka catchup assuming it is the bottleneck<br>
- let us not lose a change in Kafka when it happened in Infinispan (coordinator, owner, replicas dying)<br>
<br>
The ability to read back history would then be handled by the Debezium / Kafka tail, not infinispan itself.<br>
<br></blockquote><div><br></div><div>Having an embedded Debezium connector pushing everything to Kafka sounds cool, but what impact would it bring to the other stream consumers:<br><br>* Remote listeners, which is supported in several clients apart from Java<br></div><div>* Continuous Queries (the same)<br></div><div>* Spark Stream<br></div><div>* Other eventual 3rd party stream processors: Apache Flick, Storm, etc.<br><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Check my email on this tread from Dec 9th.<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
&gt; On 12 Dec 2016, at 16:13, Sanne Grinovero &lt;<a href="mailto:sanne@infinispan.org">sanne@infinispan.org</a>&gt; wrote:<br>
&gt;<br>
&gt; I&#39;m reading many clever suggestions for various aspects of such a<br>
&gt; system, but I fail to see a clear definition of the goal.<br>
&gt;<br>
&gt;&gt; From Randall&#39;s opening email I understand how MySQL does this, but<br>
&gt; it&#39;s an example and I&#39;m not sure which aspects are implementation<br>
&gt; details of how MySQL happens to accomplish this, and which aspects are<br>
&gt; requirements for the Infinispan enhancement proposals.<br>
&gt;<br>
&gt; I remember a meeting with Manik Surtani, Jonathan Halliday and Mark<br>
&gt; Little, whose outcome was a general agreement that Infinispan would<br>
&gt; eventually need both tombstones and versioned entries, not just for<br>
&gt; change data capture but to improve several other aspects;<br>
&gt; unfortunately that was in December 2010 and never became a priority,<br>
&gt; but the benefits are clear.<br>
&gt; The complexities which have put off such plans lie in the &quot;garbage<br>
&gt; collection&quot;, aka the need to not grow the history without bounds, and<br>
&gt; have to drop or compact history.<br>
&gt;<br>
&gt; So I&#39;m definitely sold on the need to add a certain amount of history,<br>
&gt; but we need to define how much of this history is expected to be held.<br>
&gt;<br>
&gt; In short, what&#39;s the ultimate goal? I see two main but different<br>
&gt; options intertwined:<br>
&gt; - allow to synchronize the *final state* of a replica<br>
&gt; - inspect specific changes<br>
&gt;<br>
&gt; For the first case, it would be enough for us to be able to provide a<br>
&gt; &quot;squashed history&quot; (as in Git squash), but we&#39;d need to keep versioned<br>
&gt; shapshots around and someone needs to tell you which ones can be<br>
&gt; garbage collected.<br>
&gt; For example when a key is: written, updated, updated, deleted since<br>
&gt; the snapshot, we&#39;ll send only &quot;deleted&quot; as the intermediary states are<br>
&gt; irrelevant.<br>
&gt; For the second case, say the goal is to inspect fluctuations of price<br>
&gt; variations of some item, then the intermediary states are not<br>
&gt; irrelevant.<br>
&gt;<br>
&gt; Which one will we want to solve? Both?<br>
&gt; Personally the attempt of solving the second one seems like a huge<br>
&gt; pivot of the project, the current data-structures and storage are not<br>
&gt; designed for this. I see the value of such benefits, but maybe<br>
&gt; Infinispan is not the right tool for such a problem.<br>
&gt;<br>
&gt; I&#39;d prefer to focus on the benefits of the squashed history, and have<br>
&gt; versioned entries soon, but even in that case we need to define which<br>
&gt; versions need to be kept around, and how garbage collection /<br>
&gt; vacuuming is handled.<br>
&gt; This can be designed to be transparent to the client: handled as an<br>
&gt; internal implementation detail which we use to improve performance of<br>
&gt; Infinispan itself, or it can be exposed to clients to implement change<br>
&gt; data capture, but in this case we need to track which clients are<br>
&gt; still going to need an older snapshot; this has an impact as clients<br>
&gt; would need to be registered, and has a significant impact on the<br>
&gt; storage strategies.<br>
&gt;<br>
&gt; Within Kafka the log compaction strategies are configurable; I have no<br>
&gt; experience with Kafka but the docs seem to suggest that it&#39;s most<br>
&gt; often used to provide the last known value of each key. That would be<br>
&gt; doable for us, but Kafka also does allow optionally for wider scope<br>
&gt; retention strategies: can we agree that that would not be an option<br>
&gt; with Infinispan? If not, these goals need to be clarified.<br>
&gt;<br>
&gt; My main concern is that if we don&#39;t limit the scope of which<br>
&gt; capabilities we want Infinispan to provide, it risks to become the<br>
&gt; same thing as Kafka, rather than integrating with it. I don&#39;t think we<br>
&gt; want to pivot all our storage design into efficiently treating large<br>
&gt; scale logs.<br>
&gt;<br>
&gt; In short, I&#39;d like to see an agreement that analyzing e.g.<br>
&gt; fluctuations in stock prices would be a non-goal, if these are stored<br>
&gt; as {&quot;stock name&quot;, value} key/value pairs. One could still implement<br>
&gt; such a thing by using a more sophisticated model, just don&#39;t expect to<br>
&gt; be able to see all intermediary values each entry has ever had since<br>
&gt; the key was first used.<br>
&gt;<br>
&gt; # Commenting on specific proposals<br>
&gt;<br>
&gt; On ID generation: I&#39;d definitely go with IDs per segment rather than<br>
&gt; IDs per key for the purpose of change data capture. If you go with<br>
&gt; independent IDs per key, the client would need to keep track of each<br>
&gt; version of each entry, which has an high overhead and degree of<br>
&gt; complexity for the clients.<br>
&gt; On the other hand, we already guarantee that each segment is managed<br>
&gt; by a single primary owner, so attaching the &quot;segment transaction id&quot;<br>
&gt; to each internal entry being changed can be implemented efficiently by<br>
&gt; Infinispan.<br>
&gt; Segment ownership handoff needs to be highly consistent during cluster<br>
&gt; topology changes, but that requirement already exists; we&#39;d just need<br>
&gt; to make sure that this monotonic counter is included during the<br>
&gt; handoff of the responsibility as primary owner of a segment.<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Sanne<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On 12 December 2016 at 13:58, Gustavo Fernandes &lt;<a href="mailto:gustavo@infinispan.org">gustavo@infinispan.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Fri, Dec 9, 2016 at 9:13 AM, Radim Vansa &lt;<a href="mailto:rvansa@redhat.com">rvansa@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; But introducing globally monotonous counter means that<br>
&gt;&gt;&gt; there will be a single contention point.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; I wonder if the trade-off of Flake Ids [1] could be acceptable for this use<br>
&gt;&gt; case.<br>
&gt;&gt;<br>
&gt;&gt; [1] <a href="http://yellerapp.com/posts/2015-02-09-flake-ids.html" rel="noreferrer" target="_blank">http://yellerapp.com/posts/<wbr>2015-02-09-flake-ids.html</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/infinispan-<wbr>dev</a><br>
&gt; ______________________________<wbr>_________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/infinispan-<wbr>dev</a><br>
<br>
<br>
______________________________<wbr>_________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/infinispan-<wbr>dev</a><br>
</div></div></blockquote></div><br></div></div>