<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Round Robin Data Storage in MySQL</title>
	<atom:link href="http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/</link>
	<description>it and development at europe's leading clubbing community</description>
	<lastBuildDate>Mon, 09 Aug 2010 07:13:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Martin</title>
		<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/comment-page-1/#comment-9876</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Mon, 18 Aug 2008 17:21:32 +0000</pubDate>
		<guid isPermaLink="false">http://techblog.tilllate.com/?p=343#comment-9876</guid>
		<description>Agree to Lucas... With REPLACE the DBMS has to check the keys and, if a matching value is found, it will execute a DELETE statement and then the according INSERT statement.</description>
		<content:encoded><![CDATA[<p>Agree to Lucas&#8230; With REPLACE the DBMS has to check the keys and, if a matching value is found, it will execute a DELETE statement and then the according INSERT statement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leo</title>
		<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/comment-page-1/#comment-7001</link>
		<dc:creator>leo</dc:creator>
		<pubDate>Sat, 19 Jul 2008 11:14:56 +0000</pubDate>
		<guid isPermaLink="false">http://techblog.tilllate.com/?p=343#comment-7001</guid>
		<description>Well it&#039;s mainly not about scaling. It&#039;s about storage. With this you reduce the amount of data, which will prevent you from scaling for some time. Sure on the same time you also lose data, so talking about data mining, you will not have data to digg anymore.

If you intrested in spliting databases with MySQL you might be interested in DB Slayer, MySQL Proxy or in MySQL&#039;s own Partitioning feature. Although if it comes to the mining itself you might still write your own code.</description>
		<content:encoded><![CDATA[<p>Well it&#8217;s mainly not about scaling. It&#8217;s about storage. With this you reduce the amount of data, which will prevent you from scaling for some time. Sure on the same time you also lose data, so talking about data mining, you will not have data to digg anymore.</p>
<p>If you intrested in spliting databases with MySQL you might be interested in DB Slayer, MySQL Proxy or in MySQL&#8217;s own Partitioning feature. Although if it comes to the mining itself you might still write your own code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/comment-page-1/#comment-6831</link>
		<dc:creator>James</dc:creator>
		<pubDate>Sun, 13 Jul 2008 12:23:09 +0000</pubDate>
		<guid isPermaLink="false">http://techblog.tilllate.com/?p=343#comment-6831</guid>
		<description>Doubtful this would scale well. Particularly for data mining queries later on.

I&#039;m looking into scaling strategies right now and the one I&#039;m thinking of is literally spitting data across dated databases or tables. Depending on your storage requirements having data split across multiple databases would allow for manageable clusters of servers each with dedicated processing power for data mining. The cost is typically financial (minimal with something like EC2) and code (locally working out which database (and possibly connection) and table to write to and later read back from.</description>
		<content:encoded><![CDATA[<p>Doubtful this would scale well. Particularly for data mining queries later on.</p>
<p>I&#8217;m looking into scaling strategies right now and the one I&#8217;m thinking of is literally spitting data across dated databases or tables. Depending on your storage requirements having data split across multiple databases would allow for manageable clusters of servers each with dedicated processing power for data mining. The cost is typically financial (minimal with something like EC2) and code (locally working out which database (and possibly connection) and table to write to and later read back from.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lathrop Preston</title>
		<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/comment-page-1/#comment-6450</link>
		<dc:creator>Lathrop Preston</dc:creator>
		<pubDate>Tue, 01 Jul 2008 15:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://techblog.tilllate.com/?p=343#comment-6450</guid>
		<description>I think in the application being discussed here for archive data all you really need would be maybe a weekly or monthly roll-up count. So that could still be done somehow.</description>
		<content:encoded><![CDATA[<p>I think in the application being discussed here for archive data all you really need would be maybe a weekly or monthly roll-up count. So that could still be done somehow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/comment-page-1/#comment-6282</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Mon, 23 Jun 2008 16:34:41 +0000</pubDate>
		<guid isPermaLink="false">http://techblog.tilllate.com/?p=343#comment-6282</guid>
		<description>You definately want to use INSERT ON DUPLICATE KEY UPDATE instead of REPLACE. With REPLACE you will dn an insert and then a delete is issued in case of a constraint violation. With on duplicate key update you will do the insert, it will detect the constraint violation and will do an update instead. Since the row size will remain the same, there is no need for any page shuffeling to be done. With the REPLACE you are poking wholes into your data pages, which will require frequent OPTIMIZE TABLES in order to ensure that you are getting as much data as possible in a single IO cycle.

I have an example of a fixed length queue implemented using on DUPLICATE KEY UPDATE in one of my recent talks:
http://pooteeweet.org/files/phpquebec08/sql_un_patterns.pdf</description>
		<content:encoded><![CDATA[<p>You definately want to use INSERT ON DUPLICATE KEY UPDATE instead of REPLACE. With REPLACE you will dn an insert and then a delete is issued in case of a constraint violation. With on duplicate key update you will do the insert, it will detect the constraint violation and will do an update instead. Since the row size will remain the same, there is no need for any page shuffeling to be done. With the REPLACE you are poking wholes into your data pages, which will require frequent OPTIMIZE TABLES in order to ensure that you are getting as much data as possible in a single IO cycle.</p>
<p>I have an example of a fixed length queue implemented using on DUPLICATE KEY UPDATE in one of my recent talks:<br />
<a href="http://pooteeweet.org/files/phpquebec08/sql_un_patterns.pdf" rel="nofollow">http://pooteeweet.org/files/phpquebec08/sql_un_patterns.pdf</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Round Robin Data Storage in MySQL - Tilllate Techblog - To take away</title>
		<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/comment-page-1/#comment-6277</link>
		<dc:creator>Round Robin Data Storage in MySQL - Tilllate Techblog - To take away</dc:creator>
		<pubDate>Mon, 23 Jun 2008 10:42:55 +0000</pubDate>
		<guid isPermaLink="false">http://techblog.tilllate.com/?p=343#comment-6277</guid>
		<description>[...] Robin Data Storage in MySQL - Tilllate Techblog  juin.23, 2008 in Actualités  via Planet PHP par (author [...]</description>
		<content:encoded><![CDATA[<p>[...] Robin Data Storage in MySQL &#8211; Tilllate Techblog  juin.23, 2008 in Actualités  via Planet PHP par (author [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leo</title>
		<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/comment-page-1/#comment-6275</link>
		<dc:creator>leo</dc:creator>
		<pubDate>Mon, 23 Jun 2008 07:20:33 +0000</pubDate>
		<guid isPermaLink="false">http://techblog.tilllate.com/?p=343#comment-6275</guid>
		<description>We also tried stuff with &quot;REPLACE INTO&quot;. At the begining the table is empty (or at least there&#039;s no record for a certain user). So the &quot;SELECT&quot; will not return a record and it does fail</description>
		<content:encoded><![CDATA[<p>We also tried stuff with &#8220;REPLACE INTO&#8221;. At the begining the table is empty (or at least there&#8217;s no record for a certain user). So the &#8220;SELECT&#8221; will not return a record and it does fail</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomatenschaf</title>
		<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/comment-page-1/#comment-6261</link>
		<dc:creator>tomatenschaf</dc:creator>
		<pubDate>Sun, 22 Jun 2008 22:21:54 +0000</pubDate>
		<guid isPermaLink="false">http://techblog.tilllate.com/?p=343#comment-6261</guid>
		<description>I think, the following should also work:

REPLACE INTO member_gold_visitor_rrd (uid, last_update, visitor_uid, sequence_id) SELECT 5, NOW(), 1400254, ((`sequence_id`+1) % 5))
 FROM member_gold_visitor_rrd
 WHERE uid=5
 ORDER BY last_update DESC
 LIMIT 1
 
 
or:
 
 REPLACE INTO member_gold_visitor_rrd (uid, last_update, visitor_uid, sequence_id) SELECT 5, NOW(), 1400254, ((max(`sequence_id`) % 5)+1)
 FROM member_gold_visitor_rrd
 WHERE uid=5

(not testet, but I would try these)</description>
		<content:encoded><![CDATA[<p>I think, the following should also work:</p>
<p>REPLACE INTO member_gold_visitor_rrd (uid, last_update, visitor_uid, sequence_id) SELECT 5, NOW(), 1400254, ((`sequence_id`+1) % 5))<br />
 FROM member_gold_visitor_rrd<br />
 WHERE uid=5<br />
 ORDER BY last_update DESC<br />
 LIMIT 1</p>
<p>or:</p>
<p> REPLACE INTO member_gold_visitor_rrd (uid, last_update, visitor_uid, sequence_id) SELECT 5, NOW(), 1400254, ((max(`sequence_id`) % 5)+1)<br />
 FROM member_gold_visitor_rrd<br />
 WHERE uid=5</p>
<p>(not testet, but I would try these)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eran Galperin</title>
		<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/comment-page-1/#comment-6259</link>
		<dc:creator>Eran Galperin</dc:creator>
		<pubDate>Sun, 22 Jun 2008 21:42:40 +0000</pubDate>
		<guid isPermaLink="false">http://techblog.tilllate.com/?p=343#comment-6259</guid>
		<description>The problem is that in most cases you&#039;d want to preserve historical data for statistical purposes. So I don&#039;t see a way to avoid a CRON</description>
		<content:encoded><![CDATA[<p>The problem is that in most cases you&#8217;d want to preserve historical data for statistical purposes. So I don&#8217;t see a way to avoid a CRON</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis J.</title>
		<link>http://techblog.tilllate.com/2008/06/22/round-robin-data-storage-in-mysql/comment-page-1/#comment-6257</link>
		<dc:creator>Dennis J.</dc:creator>
		<pubDate>Sun, 22 Jun 2008 20:57:24 +0000</pubDate>
		<guid isPermaLink="false">http://techblog.tilllate.com/?p=343#comment-6257</guid>
		<description>Forget that. I misinterpreted the ORDER BY.</description>
		<content:encoded><![CDATA[<p>Forget that. I misinterpreted the ORDER BY.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

