<?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>thinking in geek &#187; databases</title>
	<atom:link href="http://joshrobb.com/blog/category/databases/feed/" rel="self" type="application/rss+xml" />
	<link>http://joshrobb.com/blog</link>
	<description>tagline's are so web2.0</description>
	<lastBuildDate>Fri, 11 Mar 2011 07:17:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>ERP, Financials and Large Databases</title>
		<link>http://joshrobb.com/blog/2007/08/23/erp-financials-and-large-databases/</link>
		<comments>http://joshrobb.com/blog/2007/08/23/erp-financials-and-large-databases/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 14:29:21 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2007/08/23/erp-financials-and-large-databases/</guid>
		<description><![CDATA[It seems like Workday is getting quite a bit of press about their vision for flexible, hosted (ala the Adam Bosworth funded Salesforce.com) ERP software. Looks like Xero might have a fight on it&#8217;s hands with SAP and Oracle both trying to enter the hosted mid size business market. Whats interesting to me about all [...]]]></description>
			<content:encoded><![CDATA[<p>It seems like <a href="http://www.workday.com/">Workday </a>is getting quite a bit of press about their vision for flexible, hosted (ala the <a href="http://en.wikipedia.org/wiki/Adam_Bosworth">Adam Bosworth</a> funded <a href="http://www.salesforce.com/">Salesforce.com</a>) ERP software. Looks like <a href="http://www.xero.com">Xero</a> might have a fight on it&#8217;s hands with SAP and Oracle both trying to enter the hosted mid size business market.</p>
<p>Whats interesting to me about all this is the description of Workdays application architecture:</p>
<blockquote><p>Workday runs on an in-memory database [...] it uses a relational database (mySQL) only for persistence [...]. This persistent database has exactly three tables, one for data, one for metadata, and one for instructions. Yes, that&#8217;s right. All data&#8211;the employees, the positions, the organizational structure, and even the layout of a screen&#8211;is stored in the same table. &#8211; From: <a href="http://blogs.zdnet.com/SAAS/?p=368">Workday: Forget ERP, start over</a></p></blockquote>
<p>I wonder how this compares to <a href="http://www.drury.net.nz/2006/11/22/research-development/">Xero&#8217;s architecture</a>.  Knowing Craig Walker &#8211; I&#8217;d be surprised to here there wasn&#8217;t at least some meta-modelling in Xero.<br />
It seems like the traditional relational/OLTP approach of having strictly defined, highly normalised schemas which you hydrate/dehydrate into runtime objects is losing currency. Pat Helland &#8211; Jim Gray&#8217;s protege &#8211; is back at Microsoft and preaching heresy about traditional views around OLTP. Here&#8217;s some of his recent stuff that&#8217;s got me thinking:</p>
<ul>
<li><a href="http://www-db.cs.wisc.edu/cidr/cidr2007/papers/cidr07p15.pdf">Life Beyond Distributed Transactions: an Apostate&#8217;s Opinion</a></li>
<li><a href="http://blogs.msdn.com/pathelland/archive/2007/06/14/accountants-don-t-use-erasers.aspx">Accountants Don&#8217;t Use Erasers</a></li>
<li><a href="http://blogs.msdn.com/pathelland/archive/2007/07/23/normalization-is-for-sissies.aspx">Normalization Is for Sissies</a></li>
</ul>
<p>It seems like the more I think about this &#8211; the more this seems like the future. Here&#8217;s some other stuff I&#8217;ve read recently along similar lines:</p>
<ul>
<li><a href="http://www.cs.brown.edu/%7Eugur/fits_all.pdf">One Size Fits All: An Idea whose Time has Come and Gone</a></li>
<li><a href="http://bitworking.org/news/158/ETech-07-Summary-Part-2-MegaData">Joe Gregorio&#8217;s Mega data post</a></li>
<li><a href="http://markmaunder.com/2007/scaling-from-0-to-40-hits-per-second-in-3-days/">Scaling from 0 to 40 hits per second in 3 days</a></li>
</ul>
<p>More Info at:</p>
<ul>
<li><a href="http://www.roughtype.com/archives/2007/08/the_end_of_erp.php">The end of ERP?</a></li>
<li><a href="http://blogs.zdnet.com/BTL/?p=5983">Workday unveils  Financials and Work Tags</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2007/08/23/erp-financials-and-large-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross Join</title>
		<link>http://joshrobb.com/blog/2007/01/31/cross-join/</link>
		<comments>http://joshrobb.com/blog/2007/01/31/cross-join/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 16:55:55 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[databases]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2007/01/31/cross-join/</guid>
		<description><![CDATA[I remember learning about cross joins (aka Cartesian products) in 1990/1 during my first database course. We were using some research project from Massey University which had produced a RDBMS which ran in DOS and supported SQL1. My question at the time was &#8211; what would be the use of a cross join in a [...]]]></description>
			<content:encoded><![CDATA[<p>I remember learning about cross joins (aka Cartesian products) in 1990/1 during my first database course. We were using some research project from Massey University which had produced a RDBMS which ran in DOS and supported SQL<sup><a href="http://joshrobb.com/blog/2007/01/31/cross-join/#footnote_0_7" id="identifier_0_7" class="footnote-link footnote-identifier-link" title="This was impressive on a number of levels &amp;#8211; state of the art for DOS was dbaseIII which didn&amp;#8217;t support SQL but had some twisted language all it&amp;#8217;s own.">1</a></sup>.</p>
<p>My question at the time was &#8211; what would be the use of a cross join in a practical system? In my time I&#8217;ve occasionally run a cross join by accident (forgetting a where clause or screwing up the join condition) &#8211; sometimes even on production systems with very large databases &#8211; whoops!</p>
<p>Today &#8211; I finally got to use one to solve a business problem! Here&#8217;s the scenario (bad are words censored):</p>
<pre>bad_words         comments</pre>
<pre>+---------------+ +-------+------------+------+
| word          | | id    | comments   | live |
+---------------+ +-------+------------+------+
| W*NK*RS       | |     1 | a comm...  |    1 |
| B*ST*RDS      | |     2 | another... |    1 |
| ARS*          | | 36000 | lots...    |    1 |
| M*TH*RF*CK*RS | +-------+------------+------+
| C*NTS         |    36,000 rows
| C*CKS         |
| etc.          |
+---------------+
  648 rows</pre>
<p>Two tables &#8211; one with a list of words which should not appear in the other table. The table to be scanned actually has three columns which need to be checked.</p>
<p>What I did was cross join both tables (resulting in 23,328,000 rows) and then use the where clause to filter the out the rows which don&#8217;t contain at least one bad word.</p>
<p><code>INSERT INTO bad<br />
SELECT DISTINCT c.id<br />
FROM comments c, bad_words w<br />
WHERE<br />
pros LIKE CONCAT('%',w.word,'%')<br />
OR cons LIKE CONCAT('%',w.word,'%')<br />
OR comments LIKE CONCAT('%',w.word,'%')</code></p>
<p>Note: It actually got more complicated than this &#8211; we needed to match on word boundaries &#8211; which meant using a regex &#8211; but the principle was the same.</p>
<ol class="footnotes"><li id="footnote_0_7" class="footnote">This was impressive on a number of levels &#8211; state of the art for DOS was <a href="http://en.wikipedia.org/wiki/DBASE">dbaseIII</a> which didn&#8217;t support SQL but had some twisted language all it&#8217;s own.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2007/01/31/cross-join/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

