﻿<?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>Just A Programmer &#187; SQL</title>
	<atom:link href="http://www.justaprogrammer.net/tag/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justaprogrammer.net</link>
	<description>We're Just Programmers...</description>
	<lastBuildDate>Tue, 10 Jan 2012 03:59:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>In the brave new world of MaybeSQL, we still need DBAs</title>
		<link>http://www.justaprogrammer.net/2010/12/09/in-the-brave-new-world-of-maybesql-we-still-need-dbas/</link>
		<comments>http://www.justaprogrammer.net/2010/12/09/in-the-brave-new-world-of-maybesql-we-still-need-dbas/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 14:34:17 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Just A Programmer]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.justaprogrammer.net/?p=336</guid>
		<description><![CDATA[Yesterday, Chuck Reeve&#8217;s tweeted an article from Daniel Lemire&#8217;s blog entitled Who will need database administrators in 2020?. The thesis is that with the advent of all these NoSQL technologies, the role of DBA will become unnecessary. I disagree with this for two reasons. First of all, NoSQL will not replace SQL. Secondly, your NoSQL data store [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.justaprogrammer.net%252F2010%252F12%252F09%252Fin-the-brave-new-world-of-maybesql-we-still-need-dbas%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22In%20the%20brave%20new%20world%20of%20MaybeSQL%2C%20we%20still%20need%20DBAs%22%20%7D);"></div>
<p>Yesterday, Chuck Reeve&#8217;s <a href="http://twitter.com/manchuck/status/12536051956449280">tweeted</a> an article from <a href="http://lemire.me/blog/">Daniel Lemire&#8217;s blog</a> entitled <a href="http://lemire.me/blog/archives/2010/12/07/who-will-need-database-administrators-in-2020/">Who will need database administrators in 2020?</a>. The thesis is that with the advent of all these NoSQL technologies, the role of DBA will become unnecessary. I disagree with this for two reasons. First of all, NoSQL will not replace SQL. Secondly, your NoSQL data store probably needs a DBA, even if he has a different title.</p>
<p>Just a quick note, I&#8217;ve worked with enough SQL databases to make broad generalizations about them. The only NoSQL database I have experience with is <a href="http://www.mongodb.org/">MongoDB</a>.</p>
<h2>NoSQL will not completely replace RDBMSes</h2>
<p>SQL databases are the primary practical implementation of the relational model. Most of the &#8220;trade school&#8221; explanations of the relational model and normal forms use SQL syntax as an example. Relational databases are great at storing data in an organized fashion. Through constraints you can enforce most business rules. Triggers will allow you to do the rest. Relational databases also usually have fine grained access control systems, and mechanisms for auditing changes. Finally, if you have to build a report from your data in a way you never did before or planned to, its usually nice to be able to start out with your data normalized.</p>
<p>Now there are a lot of things a NoSQL database like MongoDB does better than most RDBMSes. For example, MongoDB would be better suited for hosting a simple blog than MySQL. However, MongoDB has not been around all that long, and before MongoDB, relational databases did a good enough job. Now there are many things SQL is better at than MongoDB. For example, I would never use mongo for a complex inventory system. However, many technologists, like Daniel,  have been focused on thing that NoSQL is good at, like blogs and simple ecommerce sites. These technologists recognize NoSQL as disruptive technology in the data management field. However, they make the mistake of assuming NoSQL will usurp the role of relational databases completely.</p>
<p>To put it another way, in the brave new MaybeSQL future, we will use SQL for some things and NoSQL for others. The things we will use SQL for, like complex inventory systems, will have complex schemas and need specialists to manage all that data. We already call those specialists DBAs.</p>
<h2>Your NoSQL Database needs a DBA</h2>
<p>Ok I lied. Your NoSQL database might not need a DBA, just like your relational database might not need one. In relational database shops without formal DBA positions,  there are usually defacto DBAs, senior developers who&#8217;ve made it their business to manage the companies databases because management would not allocate a dedicated salary to that function. Currently, I am serving as a defacto DBA for some small databases.</p>
<p>Now I&#8217;ve also been playing with MongoDB a lot. I&#8217;ve contributed to mongo, spoke about mongo, and been to three mongo conferences. I&#8217;ve talked to a lot of people using mongo, and I&#8217;ve made a lot of observations. My primary observation is mongo tends to get used in startups. These startups don&#8217;t have dedicated DBAs. However, they do have well rounded senior developers that perform DBA and sysadmin functions. Many of these NoSQL programmers also know more about relational databases than I do, which is why they didn&#8217;t fight &#8220;the mongo way&#8221; tooth and nail before accepting it like I did. Now as is the nature of startups, most of the businesses these programmers work at will fail. However, a few will succeed and get big enough to have to hire technologists with more specialized roles. I expect to see a mongo specialists role thats part sysadmin and part programmer evolving at these companies. For companies that use a a combination of a relational databases and MongoDB, I expect a DBA to be hired, learn MongoDB, and take ownership of managing the data stored in that companies MongoDB instances.</p>
<h2>Conclusion</h2>
<p>NoSQL databases were designed for different problems than relational databases. Relational databases were not designed for things like blogs and massive sites lie facebook. They were used for this role because they were the best tool at the time for the job. MongoDB on the other hand was founded by a founder of doubleclick, who wanted to build a database that scaled the way a database for websites should scale. MongoDB is taking a piece of the pie from relational databases, but not all of it. Also, just like not all relational databases have a full time DBA to maintain them, not all NoSQL databases have a full time administrator. However, that does not mean that a role similar to DBA for NoSQL databases is unnecessary.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.justaprogrammer.net/2010/12/09/in-the-brave-new-world-of-maybesql-we-still-need-dbas/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>What three things got me here.</title>
		<link>http://www.justaprogrammer.net/2010/01/21/what-three-things-got-me-here/</link>
		<comments>http://www.justaprogrammer.net/2010/01/21/what-three-things-got-me-here/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 03:08:22 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Just A Programmer]]></category>
		<category><![CDATA[Paul Randall]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.justaprogrammer.net/?p=81</guid>
		<description><![CDATA[Paul Randal wrote a What three events brought you here article on his blog and asked some others in the SQL server community to do the same. I of course was not on that list. However, no one ever invited me to blog about anything before so why should I be shy now. I have [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.justaprogrammer.net%252F2010%252F01%252F21%252Fwhat-three-things-got-me-here%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2Fg0YX5B%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22What%20three%20things%20got%20me%20here.%22%20%7D);"></div>
<p><a href="http://www.sqlskills.com/blogs/paul/">Paul Randal</a> wrote a <a href="http://www.sqlskills.com/BLOGS/PAUL/post/What-three-events-brought-you-here.aspx">What three events brought you here</a> article on his blog and asked some others in the SQL server community to do the same. I of course was not on that list. However, no one ever invited me to blog about anything before so why should I be shy now.</p>
<p>I have decided to not tell this story in terms of professional accomplishments. For me, my hobbies have always led my career.<span id="more-81"></span></p>
<h1>Event 1: A trip to Borders</h1>
<p>The year was 1999. At 18 years old I spent my last summer before college doing contract work at <a href="http://en.wikipedia.org/wiki/590_Madison_Avenue">590 Madison Avenue</a>, a.k.a. <em>The IBM building</em>. Of course <a href="http://en.wikipedia.org/wiki/Louis_V._Gerstner,_Jr.">Lou Gerstner</a> had already sold the IBM building. I had heard of this linux thing. Deciding that I needed something better than Windows 95 (read: wanting to be more 1337), I bought myself a linux book and Mandrake Linux. I only had a 14.4k modem at home, and had no way of downloading an ISO easily.</p>
<p>Try as I might, I could not get linux working on that computer. Sure it installed, but no modem, no printer and no X11. That September I brought the machine to college and bough a NIC that proudly claimed to be linux compatible. Of course it required a special patched version of the <a href="http://sourceforge.net/projects/tulip/">tulip driver</a> that I could not get compiled against the kernel. Someone told me about the even more awesome FreeBSD which actually worked with my NIC. Eventually, a version of the 2.4 kernel was released that supported my NIC out of the box.</p>
<h2>Event 1 Epilogue</h2>
<p>In college I learned a lot more about linux than I did in the month previous. All I really managed to learn in the few weeks on my own in my parents basement was how to use vi, and what sort of hardware tended to not be compatible with linux (modems, printers and damn near everything). However, had I not struggled those weeks on my own, I would have never sought acceptance with the other unix geeks at college. That trip to borders changed the course of my time in college.</p>
<h1>Event 2: Learning SQL from Stan in a bowling alley.</h1>
<p>I would like to note that I never finished college. This part of the story takes place in the time period after I stopped going to school full time but while I was taking classes at what one would call a <a href="http://www.bcl.org/">junior college</a>.</p>
<p>So I am sitting one Saturday at my local bowling alley with and old Toshiba laptop. I believe it was a 133mhz pentium. This was probably 2002 so it was old at the time. At the time I knew half the employees and my brother was on a league there. So I spent Saturdays at the bowling alley, mostly because I could get free food.</p>
<p>I would hack at perl on the machine. It was running Wndows 95 with an <a href="http://www.activestate.com/activeperl/">ActiveState Perl</a> install. I don&#8217;t think any of my perl programs ever did anything useful, but I had fun writing them. For whatever reason, the founder of this blog Stan, who worked the cash register at the time,  decided to teach me SQL. It was relevant to whatever project I was working on at the time. I had recently finished a course in VB6 at this point in which a lesson at the end involved talking to an Access Database but no SQL was involved.</p>
<p>I ended up not using this knowledge until I began taking a SQL class that was taught with Microsoft Access. Because I had a basic understanding of SQL from Stan, and also had a clerical job at the time, I took to Access like a semi-employed, quasi-college dropout to free chicken fingers.</p>
<h2>Event 2 Epilogue</h2>
<p>Once again this was a catalyst event. Had I not learned SQL from Stan I might not have taken that MS Access course, and I might not have turned a clerical job into a development job.</p>
<h1>Event 3: My first LIPHP meeting</h1>
<p>March 2006 and I am back in a semi-employed state, this time by choice. I walked away from a great unix administration position to take a programming contract and try to start a website. I didn&#8217;t take much of a paycut, and the next full time job I got was a big raise. However, this is not about my professional accomplishments.</p>
<p>So there I was programming on the side for money and the rest of the time for room, board, and potential millions. Unfortunately I was the only programmer in this boiler room startup. I had no one to talk about computers with. I was programming PHP at the time and became aware of a PHP user group in Suffolk county. So I traveled one Monday night from my bedroom/office in Manhattan to an office in Suffolk county less than a mile from the job I walked away from.</p>
<p>I don&#8217;t remember the topic, but it was a good time with good people. It was a great first experience at <a href="http://www.liphp.org">LIPHP</a>, a group that I eventually became the organizer of. I had been to one user group before, a <a href="http://www.lilug.org">LILUG</a> meeting in 2001. However, it was not something I saw any value in at the time. I will note that I am an occasional LILUG attendee, these days and the meetings in recent years have been very good.</p>
<h2>Event 3 Epilogue</h2>
<p>Its not easy to qualify the impact of LIPHP. It never got me a job. It did get me jobs and contracting positions I turned down. However, it has lead me to more user groups, more mailing lists, and some networking. I learned many things from the group. I learned about giving presentations, running a user group. Most importantly I learned that its not that hard to get outside speakers to your user group.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.justaprogrammer.net/2010/01/21/what-three-things-got-me-here/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The importance of changing ones mind</title>
		<link>http://www.justaprogrammer.net/2008/01/16/the-importance-of-changing-ones-mind/</link>
		<comments>http://www.justaprogrammer.net/2008/01/16/the-importance-of-changing-ones-mind/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 00:08:41 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Just A Programmer]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.justaprogrammer.net/2008/01/16/the-importance-of-changing-ones-mind/</guid>
		<description><![CDATA[I do not consider myself an expert on Microsoft SQL server. I prefer Postgresql. However, I am a fan of referential integrity and seek to enforce it at the database level, regardless of the engine. I like my databases to reject invalid data like DMV clerks rejecting incorrectly filled out forms. When I work with [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.justaprogrammer.net%252F2008%252F01%252F16%252Fthe-importance-of-changing-ones-mind%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22The%20importance%20of%20changing%20ones%20mind%22%20%7D);"></div>
<p>I do not consider myself an expert on Microsoft SQL server. I prefer <a href="http://www.postgresql.org">Postgresql</a>. However, I am a fan of referential integrity and seek to enforce it at the database level, regardless of the engine. I like my databases to reject invalid data like DMV clerks rejecting incorrectly filled out forms.</p>
<p>When I work with Microsoft SQL server I struggle to enforce referential integrity in the same manner as I do with Postgres. Recently, I wanted to restrict the values that may be stored in a column in a table. A mapping table was not the answer in this case. I thought the answer was to user <a href="http://msdn2.microsoft.com/en-us/library/ms188064.aspx">T-SQL RULES</a>. I implemented a few and prepared to add them to my standard practices. However,  about a week later I discovered this nugget on the MSDN:</p>
<blockquote><p>CREATE RULE will be removed in a future version of Microsoft SQL Server. Avoid using CREATE RULE in new development work, and plan to modify applications that currently use it. We recommend that you use check constraints instead. Check constraints are created by using the CHECK keyword of CREATE TABLE or ALTER TABLE. For more information, see <a href="http://msdn2.microsoft.com/en-us/library/ms188258.aspx" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl01',this);" id="ctl00_rs1_mainContentContainer_ctl01">CHECK Constraints</a>.</p></blockquote>
<p>All of a sudden I needed to unlearn what I had learned. I do this on a regular basis. I consider myself quite stubborn. And I quite value this stubbornness. I will argue my position to the death if I believe it is right. I pride myself on caring about the things no one else cares about, and being able to explain why you should care, if necessary. However, I can be persuaded to change my mind. It&#8217;s not so much that I bend or break, it&#8217;s more like I recrystallize. Sometimes the transition is instantaneous. Sometime my faith in a concept is broken and I spend a while looking for a replacement. This transition was rather instantaneous as I was presented with a clear message: &#8220;What you are using is depreciated and doing it this other way will work better anyway.&#8221;</p>
<p>So what is the lesson here? The lesson is simple. Be unwavering in your beliefs, until you have a good reason to change them. Then be unwavering in the new beliefs until they are demonstratively proven inferior.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.justaprogrammer.net/2008/01/16/the-importance-of-changing-ones-mind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

