<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Datablend &#187; similr</title>
	<atom:link href="https://datablend.be/?cat=40&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>https://datablend.be</link>
	<description>Big Data Simplified</description>
	<lastBuildDate>Mon, 07 Sep 2015 09:04:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6.1</generator>
		<item>
		<title>Counting triangles smarter (or how to beat Big Data vendors at their own game)</title>
		<link>https://datablend.be/?p=282</link>
		<comments>https://datablend.be/?p=282#comments</comments>
		<pubDate>Mon, 11 Feb 2013 10:02:00 +0000</pubDate>
		<dc:creator>Davy Suvee</dc:creator>
				<category><![CDATA[exadata]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[similr]]></category>
		<category><![CDATA[vertica]]></category>

		<guid isPermaLink="false">http://datablend22.lin3.nucleus.be/?p=282</guid>
		<description><![CDATA[A few months ago, I discovered Vertica&#8217;s &#8220;Counting Triangles&#8221;-article through Prismatic. The blog post describes a number of benchmarks on counting triangles in large networks. A triangle is detected whenever a vertex has two adjacent vertices that are also adjacent to each other. Imagine your social network; if two of your friends are also friends<p><a href="https://datablend.be/?p=282">Continue Reading →</a></p>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">A few months ago, I discovered Vertica&#8217;s <a href="http://www.vertica.com/2011/09/21/counting-triangles">&#8220;Counting Triangles&#8221;-article</a> through <a href="http://getprismatic.com/news/home">Prismatic</a>. The blog post describes a number of benchmarks on counting triangles in large networks. A <span class="highlight"><em>triangle</em></span> is detected whenever a vertex has two adjacent vertices that are also adjacent to each other. Imagine your social network; if two of your friends are also friends with each other, the three of you define a <span class="highlight"><em>friendship triangle</em></span>. Counting all triangles within a large network is a rather <span class="highlight"><em>compute-intensive task</em></span>. In its most naive form, an algorithm iterates through all vertices in the network, retrieving the adjacent vertices of their adjacent vertices. If one of the vertices adjacent to the latter vertices is identical to the origin vertex, we identified a triangle.</p>
<p style="text-align: justify;">The Vertica article illustrates how to execute an optimised implementation of the above algorithm through <span class="highlight"><em>Hadoop</em></span> and their own <span class="highlight"><em>Massive Parallel Processing (MPP) Database</em></span> product (both being run on a 4-node cluster). The dataset involves the <a href="http://snap.stanford.edu/data/soc-LiveJournal1.html">LiveJournal social network graph</a>, containing around <em>86 million relationships</em>, resulting in around <em>285 million identified triangles</em>.  As can be expected, the Vertica solution shines in all respects (counting all triangles in <span class="highlight"><em>97 seconds</em></span>), beating the Hadoop solution by a factor of <em>40</em>. A few weeks later, the Oracle guys published a similar <a href="http://structureddata.org/2011/10/17/counting-triangles-faster">blog post</a>, using their <span class="highlight"><em>ExaData</em></span> platform, beating Vertica&#8217;s results by a factor of <em>7</em>, clocking in at <span class="highlight"><em>14 seconds</em></span>.</p>
<p style="text-align: justify;">Although Vertica and Oracle&#8217;s results are impressive, they require a significant hardware setup of 4 nodes, each containing 96GB of RAM and 12 cores. My challenge: beating the Big Data vendors at their own game by calculating triangles  through a <span class="highlight"><em>smarter algorithm</em></span> that is able to deliver similar performance on <span class="highlight"><em>commodity hardware</em></span> (i.e. my MacBook Pro Retina).</p>
<p>&nbsp;</p>
<h3>1. Doing it the smart way</h3>
</p>
<p style="text-align: justify;">The <a href="http://snap.stanford.edu/data/soc-LiveJournal1.html">LiveJournal social network graph</a>, about 1.3GB in raw size, contains around 86 million relationships. Each line in this file declares a relationship between a <span class="highlight"><em>source</em></span> and <span class="highlight"><em>target vertex</em></span> (where each vertex is identified by an unique id). Relationships are assumed to be <span class="highlight"><em>bi-directional</em></span>: if person 1 knows person 2, person 2 also knows person 1.</p>
<script src="https://gist.github.com/4737460.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">Let&#8217;s start by creating a <span class="highlight"><em>row-like</em></span> data structure for storing these relationships. The <em>key</em> of each row is the <em>id of the source vertex</em>. The row <em>values</em> are the id&#8217;s of all <em>target vertices</em> associated with the particular source vertex.</p>
<script src="https://gist.github.com/4737525.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">With this structure in place, one can execute the naive algorithm as described above. Unfortunately, iterating four levels deep will result in mediocre performance. Let&#8217;s improve our data structure by <span class="highlight"><em>indexing</em></span> each relationship through its <span class="highlight"><em>lowest key</em></span>. So, even though the LiveJournal file declares the relationship as being &#8220;<em>2 0</em>&#8220;, we persist the relationship by assigning the <em>2</em>-value to the <em>0</em>-row. (Order doesn&#8217;t matter as relationships are bi-directional anyway.)</p>
<script src="https://gist.github.com/4737638.js"></script>
<p>&nbsp;</p>
<p style="text-align: justify;">Calculating triangles becomes a lot easier (and faster) now. If the key of a row is part of a <span class="highlight"><em>triangle</em></span>, its two <span class="highlight"><em>adjacent vertices</em></span> should be in its list of values (as by definition, the row key is the smallest vertex id of the three of them). Hence, we  need to check whether we can <span class="highlight"><em>find edges amongst the vertices</em></span> contained within each row. So, for each row, we iterate through its list of values. For each of these values, we retrieve the associated row and verify whether one of its values is part of the original <em>source</em>-values. By doing so, we get rid of one expensive <em>for</em>-loop. Nevertheless, the amount of calculations that need to be executed is still close to <span class="highlight"><em>2 billion</em></span>! </p>
<script src="https://gist.github.com/4737835.js"></script>
<p>&nbsp;</p>
<h3>2. Persisting the relationships</h3>
<p style="text-align: justify;">The data structure as described above is persisted in a <span class="highlight"><em>custom datastore</em></span> that we developed at Datablend for powering the <a href="http://www.similr.li">similr</a>-engine (a chemical structure search engine). The datastore is <span class="highlight"><em>fully persistent</em></span> and optimised for quickly performing <span class="highlight"><em>set-based operations</em></span> (intersections, differences, unions, &#8230; ). Parsing the 86 million relationships and creating the appropriate in-memory data structure takes around <em>20 seconds</em> on my MacBook Pro. An additional <em>4 seconds</em> is required for persisting the entire data structure to the datastore itself. So around <span class="highlight"><em>25 seconds</em></span> in total for effectively storing all 86 million relationships. Vertica nor Oracle mention the time it takes to persist the Livejournal dataset within their respective databases. However, I assume it also requires them a few seconds to execute this load-operation.</p>
<p style="text-align: justify;">What about <span class="highlight"><em>disk usage</em></span>? The custom Datablend datastore takes the <span class="highlight"><em>second place</em></span>, requiring only 37 Mb more compared to Oracle’s Hybrid Columnar Compression version.</p>
<script src="https://gist.github.com/4739843.js"></script>
<p>&nbsp;</p>
<h3>3. Calculating the triangles</h3>
<p style="text-align: justify;">The Oracle setup (on a cluster of 4 nodes, each with 96GB of RAM and 12 cores) is able to calculate the 265 million triangles in 14 seconds. The optimised algorithm described above, running on the custom Datablend datastore, takes the first place, clocking in at <span class="highlight"><em>9 seconds</em></span>! The calculation runs fully pararellized on my MacBook Pro Retina and has a peak use of only 2.11 GB of RAM!<br />
<script src="https://gist.github.com/4740331.js"></script>
<p>&nbsp;</p>
<h3>4. Conclusion</h3>
<p style="text-align: justify;">Datablend&#8217;s custom datastore is a very specific solution that targets a <span class="highlight"><em>particular range of Big Data computations</em></span>. It is in no means as generic and versatile as the MPP database solutions offered by both Vertica and Oracle. Nevertheless, the article tries to illustrate that one does not require a large computing cluster to execute particular Big Data computations. Just use the most appropriate/smart solution to solve the problem in an elegant and fast way. Don&#8217;t hesitate to <a href="http://datablend.be/?page_id=37">contact us</a> if you have any questions related to <a href="http://www.similr.li">similr</a> and/or Datablend.</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>https://datablend.be/?feed=rss2&#038;p=282</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Similr: blazingly fast chemical similarity searches</title>
		<link>https://datablend.be/?p=280</link>
		<comments>https://datablend.be/?p=280#comments</comments>
		<pubDate>Mon, 04 Feb 2013 10:00:38 +0000</pubDate>
		<dc:creator>Davy Suvee</dc:creator>
				<category><![CDATA[chemoinformatics]]></category>
		<category><![CDATA[compound comparison]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[similr]]></category>

		<guid isPermaLink="false">http://datablend22.lin3.nucleus.be/?p=280</guid>
		<description><![CDATA[Today, Datablend announces Similr to be available for beta sign-up. Similr allows scientist (both from academics and enterprise) to quickly search for compounds that exhibit a particular chemical structure. It employs a wide range of fingerprinting algorithms, which combined, allow to identify matching compounds in millisecond time. Similr&#8217;s functionalities are available through a flexible and<p><a href="https://datablend.be/?p=280">Continue Reading →</a></p>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Today, Datablend announces <a href="http://similr.li">Similr</a> to be available for <a href="http://similr.li">beta sign-up</a>. Similr allows scientist (both from academics and enterprise) to quickly search for compounds that exhibit a particular <span class="highlight"><em>chemical structure</em></span>. It employs a wide range of <span class="highlight"><em>fingerprinting algorithms</em></span>, which combined, allow to identify matching compounds in <em>millisecond</em> time. Similr&#8217;s functionalities are available through a flexible and expressive REST API and allows to scan more than 30 million compounds that have been made publicly available through <a href="http://pubchem.ncbi.nlm.nih.gov">PubChem</a>.</p>
<p style="text-align: justify;">Similr will provide <span class="highlight"><em>unlimited</em></span> API-access to academics. Free commercial access,  limited to a 1000 API-calls a month, will be available. Higher up, customers can choose between a <span class="highlight"><em>pay-as-you-go subscription</em></span> or opt-in for a dedicated installation that allows for the import of (private) compounds.</p>
<p style="text-align: justify;">Similr is being developed by Datablend, a Big Data consultancy company. Datablend&#8217;s expertise in Pharma, combined with proficient knowledge of NoSQL technologies, allowed for the development of a <span class="highlight"><em>highly optimised chemical similarity search algorithm</em></span> that is able to scan millions of compounds at blazing speeds. Don&#8217;t hesitate to <a href="http://datablend.be/?page_id=37">contact us</a> if you have any questions related to Similr and/or Datablend.</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>https://datablend.be/?feed=rss2&#038;p=280</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
