<div dir="ltr">Somehow I missed that thread.<div><br></div><div>Great news !</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 23, 2016 at 10:54 PM, Lukas Krejci <span dir="ltr">&lt;<a href="mailto:lkrejci@redhat.com" target="_blank">lkrejci@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Titan does not use the lightweight transactions of Cassandra, but<br>
instead uses a locking mechanism of its own making [1]. We use some of<br>
those mechanisms to ensure the consistency but frankly I&#39;ve not done too<br>
much research into all the failure scenarios that might happen (this is<br>
definitely something we&#39;d like to add to our perf tests, hint hint<br>
jkremser ;) ).<br>
<br>
IMHO the change in the performance I&#39;ve seen in the perf tests after the<br>
fixes in Inventory have more to do with caching of data that Titan does<br>
within a transaction boundary than some perf improvements gained from<br>
the backends.<br>
<br>
[1] <a href="http://s3.thinkaurelius.com/docs/titan/0.5.0/eventual-consistency.html" rel="noreferrer" target="_blank">http://s3.thinkaurelius.com/docs/titan/0.5.0/eventual-consistency.html</a><br>
<span class=""><br>
On 02/23/2016 08:53 PM, John Sanda wrote:<br>
&gt; Lukas do you have any insight into how Titan supports transactions with<br>
&gt; Cassandra? I know that Titan still uses the thrift API,which presumably<br>
&gt; rules out the light weight transactions introduced in C* 2.0. These are<br>
&gt; not to be confused with ACID transactions. It is more of an atomic<br>
&gt; update using a consensus protocol. Then you have atomic or logged<br>
&gt; batches which are atomic in the sense that either all of the statements<br>
&gt; will succeed or none will; however, they can succeed *eventually*. These<br>
&gt; have more overhead than unlogged batches because the mutations are first<br>
&gt; written to a batch log. Applying multiple mutations to the same<br>
&gt; partitions is an atomic operation. In other words, whether you update 1<br>
&gt; or 50 columns, if it is done within the same partition (and within the<br>
&gt; same operation), it is atomic.<br>
&gt;<br>
&gt; My point being that Cassandra is definitely not a transactional data<br>
&gt; store, so I am really curious about what Titan is doing.<br>
&gt;<br>
&gt;&gt; On Feb 23, 2016, at 1:48 PM, Lukas Krejci &lt;<a href="mailto:lkrejci@redhat.com">lkrejci@redhat.com</a><br>
</span><div><div class="h5">&gt;&gt; &lt;mailto:<a href="mailto:lkrejci@redhat.com">lkrejci@redhat.com</a>&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 02/23/2016 07:42 PM, Jay Shaughnessy wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Lukas,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; That&#39;s excellent news.  Multiple backends is not something we really<br>
&gt;&gt;&gt; want to deal with.  Also, it might be nice to see a short presentation<br>
&gt;&gt;&gt; on the &quot;best practices&quot; for Tx handling.  But then again, that Tx stuff<br>
&gt;&gt;&gt; is handled at the Gremlin level?  So, perhaps not relevant to direct C*<br>
&gt;&gt;&gt; consumers like Alerts.<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; You&#39;re right. Inventory uses Gremlin to handle transactions, so it<br>
&gt;&gt; doesn&#39;t directly &quot;see&quot; what is Titan doing behind the scenes.<br>
&gt;&gt;<br>
&gt;&gt;&gt; On 2/23/2016 12:43 PM, Lukas Krejci wrote:<br>
&gt;&gt;&gt;&gt; Hi all,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; lately I&#39;ve become really dissatisfied with how Inventory performed and<br>
&gt;&gt;&gt;&gt; semi-publicly blamed Titan for that (because that was what looked like<br>
&gt;&gt;&gt;&gt; the cause of all world&#39;s problems in my then uneducated eyes ;) ).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I decided to do some performance comparisons. Because we didn&#39;t want<br>
&gt;&gt;&gt;&gt; Hawkular to ship with 2 different NoSQL backends (C* for metrics and<br>
&gt;&gt;&gt;&gt; whatever else for Inventory), I chose an RDBMS as a good conservative<br>
&gt;&gt;&gt;&gt; alternative (because people, IMHO, are still more comfortable dealing<br>
&gt;&gt;&gt;&gt; with an RDBMS than with NoSQL databases).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Currently, inventory is written against the graph DSL called Gremlin<br>
&gt;&gt;&gt;&gt; (from Tinkerpop 2.6.0). Fortunately, there exists a &quot;toy&quot; SQL backend<br>
&gt;&gt;&gt;&gt; for Tinkerpop 2 that we could try and see if it performed any good<br>
&gt;&gt;&gt;&gt; (which would frankly be surprising, given the fact it stores the graph<br>
&gt;&gt;&gt;&gt; data rather naively). With some luck, no code would have to be changed<br>
&gt;&gt;&gt;&gt; on our side to see the results.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; We had no such luck.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Making the inventory run with the SQL backend was literally a day worth<br>
&gt;&gt;&gt;&gt; of work (if that) and the first preliminary tests showed that Inventory<br>
&gt;&gt;&gt;&gt; with Postgres backend performed much much better that Titan with<br>
&gt;&gt;&gt;&gt; embedded Cassandra. But the tests also uncovered some problems with the<br>
&gt;&gt;&gt;&gt; way Inventory code handled transactions.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Fast forward 3 weeks and see large parts of Hawkular inventory updated<br>
&gt;&gt;&gt;&gt; to correctly handle transactions. Now a single call to Inventory really<br>
&gt;&gt;&gt;&gt; results in at most 1 transaction in the backend.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; So, I went and re-ran the tests. Also, I refrained from using embedded<br>
&gt;&gt;&gt;&gt; Cassandra and instead use a locally running 2-node cluster.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The results caught me by surprise. Not so much that the naive SQL<br>
&gt;&gt;&gt;&gt; backend didn&#39;t perform particularly well, but the difference between the<br>
&gt;&gt;&gt;&gt; performance of Titan before and after the transaction handling fixes.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; To not keep you waiting any longer for the results: Titan + C* is the<br>
&gt;&gt;&gt;&gt; winner.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; For nice charts that include comparison to the old misbehaving impl,<br>
&gt;&gt;&gt;&gt; see:<br>
&gt;&gt;&gt;&gt; <a href="https://dashboards.ly/ua-tALzrY9rEoRBXvsLXbZJHT" rel="noreferrer" target="_blank">https://dashboards.ly/ua-tALzrY9rEoRBXvsLXbZJHT</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Cheers,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; hawkular-dev mailing list<br>
</div></div>&gt;&gt;&gt; <a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a>&gt;<br>
<span class="">&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Lukas Krejci<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; hawkular-dev mailing list<br>
</span>&gt;&gt; <a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a>&gt;<br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a><br>
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; hawkular-dev mailing list<br>
&gt; <a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a><br>
&gt;<br>
<br>
--<br>
Lukas Krejci<br>
_______________________________________________<br>
hawkular-dev mailing list<br>
<a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a><br>
<br>
<br>
</div></div></blockquote></div><br></div>