<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0IFRn86eip7ImA9WhBaEkk.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747</id><updated>2013-05-22T17:51:57.112+01:00</updated><category term="sqlsoton" /><category term="DevBA" /><category term="Twitter" /><category term="optimisation" /><category term="MongoUK" /><category term="MVC" /><category term="CDATA" /><category term="sqldataadapter" /><category term="cache" /><category term="Ordnance Survey" /><category term="profiler" /><category term="development" /><category term="geographic" /><category term="community" /><category term="DataTable" /><category term="SET FMTONLY" /><category term="conference" /><category term="syntax" /><category term="Azure" /><category term="validation" /><category term="SSMS" /><category term="MongoDB" /><category term="stackoverflow" /><category term="sql server 2008" /><category term="performance selenium browsermob .NET" /><category term="best practice" /><category term="QCon" /><category term="nosql" /><category term="developer" /><category term="performance" /><category term="table valued parameter" /><category term="LINQ" /><category term="cassandra" /><category term="masterclass" /><category term="DevDays" /><category term="ElasticSearch" /><category term="primary key" /><category term="scalability" /><category term="personal" /><category term="Riak" /><category term="usergroup" /><category term="XML" /><category term="SQLBits" /><category term="CSV" /><category term="sql server" /><category term="TSQL" /><category term="C#" /><category term="constraints" /><category term="geospatial" /><category term="devconnections" /><category term="southampton" /><category term="sql" /><category term="spatial" /><category term="Microsoft Community Contributor Award" /><category term="index" /><category term="asp.net" /><category term="add-in" /><category term="DBA" /><category term="career" /><category term="SQLBulkCopy" /><category term="architecture" /><category term="SET NOEXEC" /><category term="blogging" /><category term="bulk load" /><category term="replication" /><category term=".NET" /><title>AdaTheDev</title><subtitle type="html">C# &amp;amp; SQL Server Developer with a dash of NoSQL, StackOverflow&amp;#39;er, Blogger</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.adathedev.co.uk/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>75</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Adathedev" /><feedburner:info uri="adathedev" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;A0EHSXw7eSp7ImA9WhBQGEg.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-4679486476138465805</id><published>2013-03-21T09:53:00.001Z</published><updated>2013-03-21T09:53:58.201Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-21T09:53:58.201Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><title>.NET Project File Analyser</title><content type="html">&lt;div class="post"&gt;
I've started knocking together a little app to automate the process of trawling through a folder structure and checking .NET project files (C# .csproj currently) to extract some info out of them. The &lt;a href="https://github.com/AdaTheDev/DotNetProjectFileAnalyser" target="_new"&gt;DotNetProjectFileAnalyser repo&lt;/a&gt; is up on GitHub. I've been working against Visual Studio 2010 project files, but could well work for other versions assuming the project file structure is the same for the elements it currently looks at -  I just haven't tried as yet.
&lt;br/&gt;
Currently, it will generate an output file detailing for each .csproj file it finds:
&lt;ul&gt;
  &lt;li&gt;Build output directory (relative and absolute) for the configuration/platform specified (e.g. Debug AnyCpu).
   Useful if you want find which projects you need to change to build to a central/common build directory.&lt;/li&gt;
  &lt;li&gt;List of all Project Reference dependencies (as opposed to assembly references). 
   Useful if you want to find the projects that have Project References so you can switch them to assembly references&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;b&gt;Usage&lt;/b&gt;
&lt;pre class="code"&gt;
DotNetProjectFileAnalyser.exe {RootDirectory} {Configuration} {Path}

{RootDirectory} = start directory to trawl for .csproj files (including subdirectories)
{Configuration} = as defined in VS, e.g. Debug, Release
{Platform} = as defined in VS, e.g. AnyCpu
&lt;/pre&gt;

Example:
&lt;pre class="code"&gt;
DotNetProjectFileAnalyser.exe "C:\src\" "Debug" "AnyCpu"
&lt;/pre&gt;
&lt;/p&gt;
More stuff will go in over time, with ability to automatically update csproj files as well to save a lot of manual effort.
&lt;/div&gt;

&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=P9_rwJKmJP8:o565Wut1oDc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=P9_rwJKmJP8:o565Wut1oDc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=P9_rwJKmJP8:o565Wut1oDc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=P9_rwJKmJP8:o565Wut1oDc:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=P9_rwJKmJP8:o565Wut1oDc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=P9_rwJKmJP8:o565Wut1oDc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=P9_rwJKmJP8:o565Wut1oDc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/P9_rwJKmJP8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/4679486476138465805/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2013/03/net-project-file-analyser.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/4679486476138465805?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/4679486476138465805?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/P9_rwJKmJP8/net-project-file-analyser.html" title=".NET Project File Analyser" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2013/03/net-project-file-analyser.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYMSX45eyp7ImA9WhBQEkw.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-530097632131188604</id><published>2013-03-13T23:09:00.001Z</published><updated>2013-03-13T23:09:48.023Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-13T23:09:48.023Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Ordnance Survey" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="sql server" /><category scheme="http://www.blogger.com/atom/ns#" term="geospatial" /><title>GB Post Code Importer Conversion Accuracy Fix</title><content type="html">&lt;div class="post"&gt;
In a post last year (&lt;a href="http://www.adathedev.co.uk/2012/03/ordnance-survey-data-importer.html" target="_new"&gt;Ordnance Survey Data Importer Coordinate Conversion Accuracy&lt;/a&gt;) I looked into an accuracy issue with the conversion process within the GeoCoordConversion DLL that I use in this &lt;a href="https://github.com/AdaTheDev/Ordnance-Survey-Code-Point-Data-Importer" target="_new"&gt;project&lt;/a&gt; (&lt;a href="http://www.adathedev.co.uk/2011/01/gb-post-code-geographic-data-load-to.html" target="_new"&gt;blog post&lt;/a&gt;). Bottom line, was that it was a minor with an average inaccuracy of around 2.5 metres and a max of ~130 metres by my reckoning. I've since had a few requests asking if I can supply an updated GeoCoordConversion DLL with fixes to the calculations.
&lt;p&gt;
After getting in contact with the owner of the &lt;a href="http://code.google.com/p/geocoordconversion/" target="_new"&gt;GeoCoordConversion project&lt;/a&gt;, they've kindly added me as a committer. I've now pushed the fixes up to it, rebuilt the DLL (now v1.0.1.0) and pushed up the latest DLL to the Ordnance Survey Importer project on GitHub.
&lt;/p&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=34DTkSj5vwU:HoeiyCQmGnU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=34DTkSj5vwU:HoeiyCQmGnU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=34DTkSj5vwU:HoeiyCQmGnU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=34DTkSj5vwU:HoeiyCQmGnU:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=34DTkSj5vwU:HoeiyCQmGnU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=34DTkSj5vwU:HoeiyCQmGnU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=34DTkSj5vwU:HoeiyCQmGnU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/34DTkSj5vwU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/530097632131188604/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2013/03/gb-post-code-importer-conversion.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/530097632131188604?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/530097632131188604?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/34DTkSj5vwU/gb-post-code-importer-conversion.html" title="GB Post Code Importer Conversion Accuracy Fix" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2013/03/gb-post-code-importer-conversion.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkEEQHwzeSp7ImA9WhBRF0g.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-8504014739209633179</id><published>2013-03-08T13:11:00.001Z</published><updated>2013-03-08T13:50:01.281Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-08T13:50:01.281Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sql server" /><title>SQL Server Table Designer Bug With Filtered Unique Index</title><content type="html">&lt;div class="post"&gt;
A colleague was getting a duplicate key error when trying to add a new column to a table via the Table Designer in SQL Server Management Studio (2008R2 - not tested on other versions), despite there being no violating data in the table. After a bit of digging around, I tracked the problem down to what appears to be a bug in Table Designer when there is a unique, filtered index in place on the table and the table is being recreated (i.e. you're adding a new column, but not at the end after all the existing columns).

&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;Steps to reproduce&lt;/b&gt;
&lt;ol&gt;
&lt;li&gt;In SSMS in Tools -&gt; Options -&gt; Designers -&gt; Table and Database Designers, uncheck the "Prevent saving changes that require table re-creation" option
&lt;/li&gt;
&lt;li&gt;
Create table:
&lt;pre class="code"&gt;
CREATE TABLE [dbo].[Test]
(
Column1 INTEGER NOT NULL,
Column2 INTEGER NOT NULL,
Column3 INTEGER NULL
);
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
Create dummy data:
&lt;pre class="code"&gt;
INSERT dbo.Test(Column1, Column2, Column3) VALUES (1, 1, 1);
INSERT dbo.Test(Column1, Column2, Column3) VALUES (1, 1, NULL); -- OK as Column3 is NULL
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
Now run the following, duplicate key error is correctly thrown:
&lt;pre class="code"&gt;
-- Errors, Duplicate Key exception as expected
INSERT dbo.Test(Column1, Column2, Column3) VALUES (1, 1, 2); 
&lt;/pre&gt;
So at this point we have 2 rows in the table, no violations of the unique filtered index.
&lt;/li&gt;
&lt;li&gt;
Right click the table in SSMS -&gt; Design
&lt;/li&gt;
&lt;li&gt;
Insert a new column "Column4" before Column3 and the press Save.
&lt;/li&gt;
&lt;/ol&gt;
The error that occurs is:
&lt;pre&gt;
'Test' table
- Unable to create index 'IX_Test_Column1_Column2'.  
The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.Test' and the index name 'IX_Test_Column1_Column2'. The duplicate key value is (1, 1).
The statement has been terminated.
&lt;/pre&gt;

&lt;p&gt;
So what it appears to be doing, is losing the WHERE filter on the index. This can be confirmed by clicking "Generate change script" in the Table Designer instead of Save - at the end of the generated script:
&lt;pre class="code"&gt;
CREATE UNIQUE NONCLUSTERED INDEX IX_Test_Column1_Column2 ON dbo.Test
 (
 Column1,
 Column2
 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
&lt;/pre&gt;
Now, if there was no data in the table, or there were no rows with the same Column1 and Column2 value combination when you go into Table Designer, then you can save the table change and be blissfully unaware that the filter has been lost from the index. i.e. repeat the repro steps again, but this time move step 3 and 4 (insert dummy data) to the end of the process. The previously OK 2nd data row will now error upon insert.
&lt;/p&gt;
&lt;p&gt;
Personally, I almost never use the Table Designer and as a safeguard, will be recommending to the rest of the team that the "Prevent saving changes that require table re-creation" option is checked as a basic guard.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Update:&lt;/b&gt;
The following Connect items relating to this issue:&lt;br/&gt;
&lt;a href="http://connect.microsoft.com/SQLServer/feedback/details/462053/the-filter-expression-of-a-filtered-index-is-lost-when-a-table-is-modified-by-the-table-designer#details" target="_new"&gt;The filter expression of a filtered index is lost when a table is modified by the table designer&lt;/a&gt;&lt;br/&gt;
&lt;a href="https://connect.microsoft.com/SQLServer/feedback/details/362699/2008-rtm-ssms-engine-table-designer-doesnt-script-where-clause-in-filtered-indexes" target="_new"&gt;2008 RTM, SSMS/Engine: Table designer doesn't script WHERE clause in filtered indexes&lt;/a&gt;
&lt;br/&gt;
Referring to comments in that 2nd item, my "Script for server version" setting was set to "SQL Server 2008 R2".
&lt;br/&gt;&lt;br/&gt;
Sounds like this may have been addressed in SQL 2012, but still a problem in 2008/2008R2.
&lt;/p&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=oxbpsM_y_OA:cOydQFu9P6U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=oxbpsM_y_OA:cOydQFu9P6U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=oxbpsM_y_OA:cOydQFu9P6U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=oxbpsM_y_OA:cOydQFu9P6U:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=oxbpsM_y_OA:cOydQFu9P6U:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=oxbpsM_y_OA:cOydQFu9P6U:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=oxbpsM_y_OA:cOydQFu9P6U:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/oxbpsM_y_OA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/8504014739209633179/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2013/03/sql-server-table-designer-bug-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/8504014739209633179?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/8504014739209633179?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/oxbpsM_y_OA/sql-server-table-designer-bug-with.html" title="SQL Server Table Designer Bug With Filtered Unique Index" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2013/03/sql-server-table-designer-bug-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQHR3o4fSp7ImA9WhBRE0k.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-4840750543755934222</id><published>2013-03-03T22:05:00.000Z</published><updated>2013-03-03T22:05:36.435Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-03T22:05:36.435Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><title>MongoDB ASP.NET Session Store Provider v1.1.0</title><content type="html">&lt;div class="post"&gt;
Since I created the &lt;a href="http://www.adathedev.co.uk/2011/05/mongodb-aspnet-session-state-store.html" target="_new"&gt;MongoDB ASP.NET Session State Store Provider&lt;/a&gt; (v1.0.0), a few things have moved on in the MongoDB C# Driver. I've pushed a number of changes up to the project on GitHub (which I've incremented to v1.1.0), so it now uses v1.7.0.4714 of the driver. There is no change to way it is configured in web.config, so if you are using v1.0.0 of my provider it should be painless. Of course, I'd recommend thorough testing first :)
&lt;p&gt;
The changes relate to:
&lt;ul&gt;
&lt;li&gt;SafeMode is obsolete. I've replaced with WriteConcern.&lt;br/&gt;
&lt;a href="https://jira.mongodb.org/browse/CSHARP-615" target="_new"&gt;C# Driver Jira case&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://docs.mongodb.org/manual/core/write-operations/#write-concern" target="_new"&gt;WriteConcern C# Driver reference&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
MongoServer.Create  is obsolete. I've replaced with MongoClient.GetServer.&lt;br/&gt;
&lt;a href="https://wiki.10gen.com/display/DOCS/CSharp+Driver+Tutorial#CSharpDriverTutorial-MongoClientclass" target="_new"&gt;MongoClient C# Driver reference&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;QueryComplete is obsolete.&lt;/li&gt;
&lt;/ul&gt;

&lt;br/&gt;
&lt;b&gt;web.config recap&lt;/b&gt;&lt;br/&gt;
These web.config settings have not changed, so should continue working as before.
&lt;pre class="code"&gt;
&amp;lt;configuration&amp;gt;
  &amp;lt;connectionStrings&amp;gt;
    &amp;lt;add name="MongoSessionServices" connectionString="mongodb://localhost" /&amp;gt;
  &amp;lt;/connectionStrings&amp;gt;
  &amp;lt;system.web&amp;gt;
    &amp;lt;sessionState
        mode="Custom"
        customProvider="MongoSessionStateProvider"&amp;gt;
      &amp;lt;providers&amp;gt;
        &amp;lt;add name="MongoSessionStateProvider"
             type="MongoSessionStateStore.MongoSessionStateStore"
             connectionStringName="MongoSessionServices"
             writeExceptionsToEventLog="false"
             fsync="false"
             replicasToWrite="0" /&amp;gt;
      &amp;lt;/providers&amp;gt;
    &amp;lt;/sessionState&amp;gt;
  &amp;lt;/system.web&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;
replicasToWrite is interpreted as follows:
&lt; 0 = ignored. Treated as 0.&lt;br/&gt;
0 = will wait for acknowledgement from primary node.&lt;br/&gt;
&gt; 0 = will wait for writes to be acknowledged from (1 + {replicasToWrite}) nodes.
&lt;p&gt;
&lt;b&gt;&lt;u&gt;Please Note&lt;/u&gt;&lt;/b&gt;, per the MongoDB Driver docs, if (1 + {replicasToWrite}) equates to a number greater than the number of replica set members that hold data, then MongoDB waits for the non-existent members to become available (so blocks indefinitely).
&lt;/p&gt;
&lt;p&gt;
It still treats write concerns as important, ensuring it waits for acknowledgement back from at least one MongoDB node.
&lt;/p&gt;
As always, all feedback welcome.
&lt;/div&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=gVGCZzCzIW0:HlTqfmTwAyQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=gVGCZzCzIW0:HlTqfmTwAyQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=gVGCZzCzIW0:HlTqfmTwAyQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=gVGCZzCzIW0:HlTqfmTwAyQ:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=gVGCZzCzIW0:HlTqfmTwAyQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=gVGCZzCzIW0:HlTqfmTwAyQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=gVGCZzCzIW0:HlTqfmTwAyQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/gVGCZzCzIW0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/4840750543755934222/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2013/03/mongodb-aspnet-session-store-provider.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/4840750543755934222?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/4840750543755934222?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/gVGCZzCzIW0/mongodb-aspnet-session-store-provider.html" title="MongoDB ASP.NET Session Store Provider v1.1.0" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>4</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2013/03/mongodb-aspnet-session-store-provider.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEBR349eSp7ImA9WhBTFU8.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-1614318095347051001</id><published>2013-02-10T19:53:00.000Z</published><updated>2013-02-10T20:04:16.061Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-10T20:04:16.061Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ElasticSearch" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="Twitter" /><title>Importing twitter archive into ElasticSearch</title><content type="html">&lt;div class="post"&gt;
I recently downloaded my full history of tweets from Twitter (via the "Request your archive" button on the Settings page), which gives the data in CSV and JSON formats. The download comes with a simple web UI so you can browse locally, all your historical tweets, as well as perform basic searches. When I tried performing a wildcard search, it resulted in an unresponsive script warning and nobbled the browser tab.

&lt;h4&gt;Cue ElasticSearch&lt;/h4&gt;
I've kept meaning to have another hack around with &lt;a href="http://www.elasticsearch.org/" target="_new"&gt;ElasticSearch&lt;/a&gt; for a while now, as I started looking into it in 2011 and was very impressed with it. So I decided to knock up a little .NET app to take the .js files provided by Twitter in the export, extract the tweet data and push into &lt;a href="http://www.elasticsearch.org/" target="_new"&gt;ElasticSearch&lt;/a&gt;. It seems like a good little starter project to learn more about &lt;a href="http://www.elasticsearch.org/" target="_new"&gt;ElasticSearch&lt;/a&gt; and actually could give me some useful insights into all the tweets I've made. I'm sure I'm going to find some really good links I tweeted and then couldn't find again!
&lt;p&gt;
At the moment there's a very basic GUI (and I mean basic!) exposing the functionality to import the tweet data into ElasticSearch. I plan to stick a basic search GUI together too and then...well, I'm not quite sure yet, but I'm sure as time goes on I'll see more ways to extract interesting information from my tweet history.
&lt;/p&gt;
&lt;p&gt;
The ElasticTweets project as I've called it, can be found on &lt;a href="https://github.com/AdaTheDev/ElasticTweets" target="_new"&gt;GitHub here&lt;/a&gt; - feel free to use and abuse it, and let me know how you get on! 
&lt;/p&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=hhdkeNpgLVU:gviHhsXm5Bc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=hhdkeNpgLVU:gviHhsXm5Bc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=hhdkeNpgLVU:gviHhsXm5Bc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=hhdkeNpgLVU:gviHhsXm5Bc:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=hhdkeNpgLVU:gviHhsXm5Bc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=hhdkeNpgLVU:gviHhsXm5Bc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=hhdkeNpgLVU:gviHhsXm5Bc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/hhdkeNpgLVU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/1614318095347051001/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2013/02/import-twitter-archive-elasticsearch.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/1614318095347051001?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/1614318095347051001?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/hhdkeNpgLVU/import-twitter-archive-elasticsearch.html" title="Importing twitter archive into ElasticSearch" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2013/02/import-twitter-archive-elasticsearch.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YARH86cSp7ImA9WhVbEUQ.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-7069128716949079055</id><published>2012-05-28T10:20:00.002+01:00</published><updated>2012-05-28T10:59:05.119+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-28T10:59:05.119+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Azure" /><title>Configuring Azure Storage Emulator SQL Server Instance</title><content type="html">&lt;div class="post"&gt;
If you're using Windows Azure Storage, you are almost certainly going to be running the storage emulator during development, instead of working directly against your storage account up in the cloud. This emulator (which comes in the &lt;a href="https://www.windowsazure.com/en-us/develop/downloads/" target="_new"&gt;Windows Azure SDK&lt;/a&gt; - see the "other" category), allows you to test locally against local instances of Blob, Queue and Table services. 

&lt;p&gt;
As per the &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/gg432983.aspx" target="_new"&gt;Overview of Running a Windows Azure Application with Storage Emulator&lt;/a&gt; reference, the emulator needs a local SQL Server instance. By default, it's configured to run against a SQL Server Express 2005 or 2008 database.
&lt;/p&gt;
&lt;p&gt;
If you want to point it at a different instance of SQL Server, for example a shared development database server, you can do this using the DSInit command line tool. I originally came across this MSDN on &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/gg433134.aspx" target="_new"&gt;How to Configure SQL Server for the Storage Emulator&lt;/a&gt;, which led me to try the following in the Windows Azure Command Prompt:

&lt;pre class="code"&gt;DSInit /sqlInstance:MyDevServerName\MyInstanceName&lt;/pre&gt;

This tried to create the storage database, but failed with the following:

&lt;pre&gt;Creating database DevelopmentStorageDb20110816...
Cannot create database 'DevelopmentStorageDb20110816' : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again. These errors can occur if SQL Server was installed by someone other than the current user. Please refer to http://go.microsoft.com/fwlink/?LinkID=205140 for more details.
&lt;/pre&gt;

The correct way when trying to use a different database server instead of the local machine, is to use the SERVER switch instead:
&lt;pre class="code"&gt;DSInit /SERVER:MyDevServerName\MyInstanceName&lt;/pre&gt;

See the full &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/gg433005.aspx" target="_new"&gt;DSInit Command-Line Tool&lt;/a&gt; reference.
&lt;/p&gt;
&lt;p&gt;
When you then run the Storage Emulator, it will target that database server/instance. You can easily cleardown/reset that database
by right clicking the Windows Azure Emulator icon in the taskbar, select "Show Storage Emulator UI" and the click "Reset". &lt;b&gt;NB. Just to be clear, this will delete everything in your local storage emulator database&lt;/b&gt;.
&lt;/p&gt;
&lt;p&gt;
An added "gotcha" to watch out for, if you have the storage account connection stored in a web/app.config and want to specify to use the local emulated instance, you need to use &lt;pre class="code"&gt;UseDevelopmentStorage=true&lt;/pre&gt; &lt;b&gt;&lt;u&gt;exactly&lt;/u&gt;&lt;/b&gt; as it appears here. If like me, you initially give an ending semi-colon, you will get a FormatException stating with the error: "Invalid account string".
&lt;/p&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=tVpMSwCNjxU:7gOHjIU_Djk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=tVpMSwCNjxU:7gOHjIU_Djk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=tVpMSwCNjxU:7gOHjIU_Djk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=tVpMSwCNjxU:7gOHjIU_Djk:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=tVpMSwCNjxU:7gOHjIU_Djk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=tVpMSwCNjxU:7gOHjIU_Djk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=tVpMSwCNjxU:7gOHjIU_Djk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/tVpMSwCNjxU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/7069128716949079055/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2012/05/configuring-azure-storage-emulator-sql.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/7069128716949079055?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/7069128716949079055?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/tVpMSwCNjxU/configuring-azure-storage-emulator-sql.html" title="Configuring Azure Storage Emulator SQL Server Instance" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2012/05/configuring-azure-storage-emulator-sql.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUICRn04eSp7ImA9WhVUGEk.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-1409146766043917980</id><published>2012-05-24T09:19:00.001+01:00</published><updated>2012-05-24T09:19:27.331+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-24T09:19:27.331+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="Azure" /><title>Error Creating Azure Blob Storage Container</title><content type="html">&lt;div class="post"&gt;
I received a rather...vague...error when trying out a bit of .NET code to connect to a Windows Azure Blob Storage account, and create a new container in which to store some blobs.

&lt;h3&gt;The code&lt;/h3&gt;
&lt;pre class="code"&gt;
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
    "DefaultEndpointsProtocol=https;AccountName=REMOVED;AccountKey=REMOVED");

CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
            
CloudBlobContainer container = 
    blobClient.GetContainerReference("TestContainer1");

container.CreateIfNotExist(); // This error'd
&lt;/pre&gt;

&lt;h3&gt;The error&lt;/h3&gt;
A StorageClientException was thrown saying "One of the request inputs is out of range.". An inner WebException showed that "The remote server returned an error: (400) Bad Request."

&lt;h3&gt;The cause&lt;/h3&gt;
I'd assumed (incorrectly) that a container name could be pretty much any string. But that's not the case. As per &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/dd135715.aspx" target="_new"&gt;this MSDN reference&lt;/a&gt;, a container name must:
&lt;ul&gt;
&lt;li&gt;be in lowercase (this was the cause in my case)&lt;/li&gt;
&lt;li&gt;start with a letter or a number and only contain letters, numbers and hyphens (multiple consecutive hyphens are not allowed)&lt;/li&gt;
&lt;li&gt;be between 3 and 63 characters long&lt;/li&gt;
&lt;/ul&gt;

The "&lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/dd135715.aspx" target="_new"&gt;Naming and Referencing Containers, Blobs and Metadata&lt;/a&gt;" reference is worth a bookmark.
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=_KbIeTuvd_8:dP5rtTlhvv0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=_KbIeTuvd_8:dP5rtTlhvv0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=_KbIeTuvd_8:dP5rtTlhvv0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=_KbIeTuvd_8:dP5rtTlhvv0:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=_KbIeTuvd_8:dP5rtTlhvv0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=_KbIeTuvd_8:dP5rtTlhvv0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=_KbIeTuvd_8:dP5rtTlhvv0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/_KbIeTuvd_8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/1409146766043917980/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2012/05/error-creating-azure-blob-storage.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/1409146766043917980?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/1409146766043917980?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/_KbIeTuvd_8/error-creating-azure-blob-storage.html" title="Error Creating Azure Blob Storage Container" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2012/05/error-creating-azure-blob-storage.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04MR3oyeSp7ImA9WhVUF0s.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-2172022797124095569</id><published>2012-05-23T09:33:00.000+01:00</published><updated>2012-05-23T09:33:06.491+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-05-23T09:33:06.491+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="performance" /><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><title>ASP.NET MVC Performance Profiling</title><content type="html">&lt;div class="post"&gt;
Building up a profile of how a web application functions, all the database interactions that take place and where the server-side time is spent during a request can be a challenging task when you are new to an existing codebase. If you're trying to address the generic/non-specific "we need to improve performance / it's slow" issue, you need to get a good picture of what is going on and where to prioritise effort.
&lt;p&gt;
There are a number of ways to identify specific problems depending on the technologies. For example, if your application is backed by SQL Server, you can query a set of DMVs to identify the top n worst performing queries and then focus your effort on tuning those. Identifying a badly performing query and tuning it can obviously yield huge benefits in terms of the end user's experience. But this doesn't necessarily flag up all the problems. If you are looking at a particular page/view within the application, then you could start a SQL Profiler trace to monitor what's going on during the lifecycle of the request - this is another common and valuable tool to use. Personally, I usually have SQL Profiler open most of the time during development. If you're developing against a shared dev database with others, you can filter out other people's events from the trace - injecting your machine name into the connection string as the ApplicationName, and then filtering on this is one of a number of ways to achieve this which works nicely.
&lt;/p&gt;
&lt;h3&gt;MiniProfiler For The Win&lt;/h3&gt;
Recently, I've started using another extremely valuable tool within an ASP.NET MVC solution - &lt;a href="http://miniprofiler.com/" target="_new"&gt;MiniProfiler&lt;/a&gt; which is (quote):
&lt;blockquote&gt;A simple but effective mini-profiler for ASP.NET MVC and ASP.NET&lt;/blockquote&gt;

It was developed by the team over at &lt;a href="http://www.stackoverflow.com" target="_new"&gt;StackOverflow&lt;/a&gt;. Simply put, it can render performance statistics on the page you are viewing that detail where the time was spent server-side, fulfilling that request. But the key thing for me, is it provides an ADO.NET profiler. Say you're using LINQ-to-SQL - by wrapping the SqlConnection in a ProfiledDbConnection before then passing it to the constructor of a DataContext, info on the SQL queries executed within the lifetime of a request are then also included in the statistics displayed. (It can also profile calls via raw ADO.NET / Entity Framework etc, minimal effort required).
&lt;/p&gt;
&lt;h3&gt;Make the invisible, visible&lt;/h3&gt;
Since integrating this into an MVC application, the benefits have been priceless. The key thing for me is: &lt;b&gt;&lt;u&gt;VISIBILITY&lt;/u&gt;&lt;/b&gt;.
It provides extremely value visibility of what is happening under the covers. Going back to the start of this post, if you're new to a codebase, then having this information provided to you as you browse is invaluable. It enables you to identify problems at a glance, and increases visibility of problems to other developers so the "life expectancy" of those problems is lower - they're a lot less likely to hover undetected just under the radar if the information is being pushed right in front of the developer on screen. It also helps you build up a picture of how things hang together.
&lt;p&gt;
MiniProfiler includes functionality to flag up N+1 and duplicate queries, a common potential problem you could encounter with  ORMs if you're not careful. If a view were performing 100 low hitting queries, these may not show themselves as queries to be tuned. But the fact that 100 database roundtrips are being made, could scream out that perhaps they could be replaced with a single roundtrip and a performance improvement gained there.
&lt;/p&gt;
&lt;p&gt;
I'm now a big fan of MiniProfiler, especially due to it's simplicity to integrate into a codebase. Working on ASP.NET MVC/ASP.NET applications? You might want to give it a try!
&lt;/p&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=WYyERKS2LFk:GSQGwHiegt8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=WYyERKS2LFk:GSQGwHiegt8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=WYyERKS2LFk:GSQGwHiegt8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=WYyERKS2LFk:GSQGwHiegt8:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=WYyERKS2LFk:GSQGwHiegt8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=WYyERKS2LFk:GSQGwHiegt8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=WYyERKS2LFk:GSQGwHiegt8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/WYyERKS2LFk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/2172022797124095569/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2012/05/aspnet-mvc-performance-profiling.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/2172022797124095569?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/2172022797124095569?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/WYyERKS2LFk/aspnet-mvc-performance-profiling.html" title="ASP.NET MVC Performance Profiling" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2012/05/aspnet-mvc-performance-profiling.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkANQXg6eSp7ImA9WhVXE0w.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-7306475222022390311</id><published>2012-04-13T11:59:00.000+01:00</published><updated>2012-04-13T11:59:50.611+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-13T11:59:50.611+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="development" /><title>Trust your developer instinct and experience</title><content type="html">&lt;div class="post"&gt;
&lt;p&gt;
That feature you're implementing, that bug you're fixing, that performance improvement you're trying to make...it's using up a fair few brain CPU cycles trying to analyse how best to implement it. Scalability, performance, ease of maintenance, clean code...just some of the things you are mentally scoring your potential approaches against to determine which route to take. And that's without any mention of business domain logic. We've all been in the situation where you start heading down one path only to find a hurdle. It's OK though, you're an athlete (very debatable in my case) - you can jump over that hurdle. So you do. But then you find a 7 foot high wall with barbed wire on top. No problem - you have a ladder and wire cutters; it's a bit unwieldy carrying them around with you everywhere, but hey - over you go. All good. Until you come across Chuck Norris, who is angry about that "Yo' mamma.." joke you made about his mother. That wall you climbed...that was protecting his private property. Your ladder? Oh, that's still on the outside of the wall - you couldn't pull it over with you so you jumped down without it. Brace for pain.
&lt;/p&gt;
&lt;h4&gt;Those voices in your head&lt;/h4&gt;
There's always unexpected problems and hurdles that crop up. It's all part of being a developer after all. But maybe at the point you got your ladder and wire cutters out to climb over that wall, you heard a little voice inside say "Hmm, this doesn't quite feel right" or perhaps you just felt something niggling away with you about the approach. That voice, your instinct and experience as a developer built up over your career, is worth listening to. When it pipes up, sit back and take 5 to just take a bird's eye view. 
&lt;p&gt;
Trust that instinct and experience - it's usually right. At the very least, it's highlighting the need to at least re-justify to yourself that you are heading down the right path.
&lt;/p&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=AQZSVRA-htY:Q2y0XjJVRHM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=AQZSVRA-htY:Q2y0XjJVRHM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=AQZSVRA-htY:Q2y0XjJVRHM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=AQZSVRA-htY:Q2y0XjJVRHM:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=AQZSVRA-htY:Q2y0XjJVRHM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=AQZSVRA-htY:Q2y0XjJVRHM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=AQZSVRA-htY:Q2y0XjJVRHM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/AQZSVRA-htY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/7306475222022390311/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2012/04/trust-your-developer-instinct-and.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/7306475222022390311?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/7306475222022390311?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/AQZSVRA-htY/trust-your-developer-instinct-and.html" title="Trust your developer instinct and experience" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2012/04/trust-your-developer-instinct-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEDQnwzfCp7ImA9WhBQEkw.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-2254629423609347758</id><published>2012-03-14T22:11:00.000Z</published><updated>2013-03-13T23:17:53.284Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-13T23:17:53.284Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Ordnance Survey" /><category scheme="http://www.blogger.com/atom/ns#" term="sql server" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="spatial" /><title>Ordnance Survey Data Importer Coordinate Conversion Accuracy</title><content type="html">&lt;div style="background-color:#FFE97F; border: 1px solid #FFD800"&gt;
&lt;b&gt;Update 13 March 2013:&lt;/b&gt; Please see latest blog post (fix) on this &lt;a href="http://www.adathedev.co.uk/2013/03/gb-post-code-importer-conversion.html"&gt;here&lt;/a&gt;.
&lt;/div&gt;
&lt;div class="post"&gt;
&lt;p&gt;
Thanks to a &lt;a href="http://www.adathedev.co.uk/2011/01/gb-post-code-geographic-data-load-to.html?showComment=1331734250799#c7081796813185142076" target="_new"&gt;comment on my original post&lt;/a&gt; around my project that imports Ordnance Survey CodePoint data into SQL Server, I was made aware of a potential issue with the (awesome) third party &lt;a href="http://code.google.com/p/geocoordconversion/" target="_new"&gt;GeoCoordConversion&lt;/a&gt; DLL I use to convert the Eastings/Northings coordinates supplied in the Ordnance Survey data files, into Latitude/Longitude coordinates. The &lt;a href="http://code.google.com/p/geocoordconversion/issues/detail?id=2" target="_new"&gt;issue&lt;/a&gt; relates to an inaccuracy in the conversion process, specifically to do with integer divisions instead of double.
&lt;/p&gt;
&lt;p&gt;
So, this blog post is to document my analysis of that and try to quantify what, if any, impact there is on the accuracy of the conversion of Eastings/Northings to Latitude/Longitude. So what I've done is:

&lt;ol&gt;
&lt;li&gt;Import the Ordnance Survey data set using the released version (1.0.0.0) of the &lt;a href="http://code.google.com/p/geocoordconversion/downloads/list" target="_new"&gt;GeoCoordConversion library&lt;/a&gt; (i.e. the version my project uses)&lt;/li&gt;
&lt;li&gt;Downloaded the source code for GeoCoordConversion and corrected the parts of the calculations where the &lt;a href="http://code.google.com/p/geocoordconversion/issues/detail?id=2" target="_new"&gt;raised issue&lt;/a&gt; noted an inaccuracy&lt;/li&gt;
&lt;li&gt;Reran the data import into a separate table using the "corrected" conversion code&lt;/li&gt;
&lt;li&gt;Ran the following query to try and quantify how much of a difference it actually makes:
&lt;/ol&gt;
&lt;pre class="code"&gt;
;WITH CTEDiff AS 
(
    SELECT orig.OutwardCode, orig.InwardCode,
        orig.GeoLocation.STDistance(new.GeoLocation) Dist
    FROM PostCodeData orig
 JOIN PostCodeDataWithFix new ON orig.InwardCode = new.InwardCode 
            AND orig.OutwardCode = new.OutwardCode
)
SELECT MIN(Dist) AS MinDifferenceInMetres, 
    MAX(Dist) AS MaxDifferenceInMetres, 
    AVG(Dist) AS AverageDifferenceInMetres, 
    SUM(CASE WHEN Dist = 0 THEN 0 ELSE 1 END) AS NumberOfDifferences
FROM CTEDiff
&lt;/pre&gt;
&lt;/p&gt;

&lt;h4&gt;Results&lt;/h4&gt;
The &lt;b&gt;&lt;u&gt;MAXIMUM&lt;/u&gt;&lt;/b&gt; distance between the 2 conversions for a given postcode is: &lt;b&gt;&lt;u&gt;124.9 metres&lt;/u&gt;&lt;/b&gt;.&lt;br/&gt;
The &lt;b&gt;&lt;u&gt;MINIMUM&lt;/u&gt;&lt;/b&gt; distance between the 2 conversions for a given postcode is: &lt;b&gt;&lt;u&gt;0 metres&lt;/u&gt;&lt;/b&gt;.&lt;br/&gt;
The &lt;b&gt;&lt;u&gt;AVERAGE&lt;/u&gt;&lt;/b&gt; distance between the 2 conversions for a given postcode is: &lt;b&gt;&lt;u&gt;2.5 metres&lt;/u&gt;&lt;/b&gt;.&lt;br/&gt;
The &lt;b&gt;&lt;u&gt;TOTAL NUMBER&lt;/u&gt;&lt;/b&gt; of differences was 1,652,458 (out of 1,705,177 conversions).

&lt;p&gt;
This map shows the case that had the biggest difference (postcode: NR34 8JW). Plotted points are as follows:&lt;br/&gt;
&lt;b&gt;(A)&lt;/b&gt; = position from conversion process before fix&lt;br/&gt;
&lt;b&gt;(B)&lt;/b&gt; = position from conversion process with fix&lt;br/&gt;
&lt;b&gt;(C)&lt;/b&gt; = position Google Maps gives for location&lt;br/&gt;

Note &lt;b&gt;(B)&lt;/b&gt; and &lt;b&gt;(C)&lt;/b&gt; are in the same spot, so that's why you can't see both!
&lt;/p&gt;
&lt;iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.google.com/maps?f=d&amp;amp;source=s_d&amp;amp;saddr=52.44527%091.53&amp;amp;daddr=52.44528%091.528163+to:NR34%098JW&amp;amp;hl=en&amp;amp;geocode=FVZAIAMdkFgXAA%3BFWBAIAMdY1EXAA%3BFWFAIAMdY1EXAClRsJ1xffbZRzGcjYe25cwC0g&amp;amp;aq=&amp;amp;sll=52.445281,1.528163&amp;amp;sspn=0.014831,0.042272&amp;amp;g=NR34%098JW&amp;amp;mra=ls&amp;amp;ie=UTF8&amp;amp;t=m&amp;amp;ll=52.445312,1.528924&amp;amp;spn=0.001144,0.00228&amp;amp;z=18&amp;amp;output=embed"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;&lt;a href="http://www.google.com/maps?f=d&amp;amp;source=embed&amp;amp;saddr=52.44527%091.53&amp;amp;daddr=52.44528%091.528163+to:NR34%098JW&amp;amp;hl=en&amp;amp;geocode=FVZAIAMdkFgXAA%3BFWBAIAMdY1EXAA%3BFWFAIAMdY1EXAClRsJ1xffbZRzGcjYe25cwC0g&amp;amp;aq=&amp;amp;sll=52.445281,1.528163&amp;amp;sspn=0.014831,0.042272&amp;amp;g=NR34%098JW&amp;amp;mra=ls&amp;amp;ie=UTF8&amp;amp;t=m&amp;amp;ll=52.445312,1.528924&amp;amp;spn=0.001144,0.00228&amp;amp;z=18" style="color:#0000FF;text-align:left"&gt;View Larger Map&lt;/a&gt;&lt;/small&gt;

&lt;h4&gt;Summary&lt;/h4&gt;
For me, and what I see as potential uses for this data, I personally don't see this as much of an issue especially with an average difference of 2.5 metres. 
I will add a comment on to the GeoCoordConversion project issue page, referencing this post. Though there doesn't look to be any activity on the project, so whether a fix can be applied is yet to be seen. That's my preferred route at present, to see if the author of that project is around to apply a fix as I currently don't have full knowledge of what I changes I can make to the source code and what would be acceptable in order to distribute the amended source code as part of my project (my project is released under a different, but compatible license...but things might get murkier when it comes to amending/distributing those amendments). In a nutshell, I just don't have time to try to make head and tail of what I can legitimately do (and I don't want to change the license for my project)!
&lt;p&gt;All feedback welcomed&lt;/p&gt;

&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FbxmF4Oqy9c:DsZjIhPNHAg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FbxmF4Oqy9c:DsZjIhPNHAg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=FbxmF4Oqy9c:DsZjIhPNHAg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FbxmF4Oqy9c:DsZjIhPNHAg:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FbxmF4Oqy9c:DsZjIhPNHAg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FbxmF4Oqy9c:DsZjIhPNHAg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=FbxmF4Oqy9c:DsZjIhPNHAg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/FbxmF4Oqy9c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/2254629423609347758/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2012/03/ordnance-survey-data-importer.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/2254629423609347758?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/2254629423609347758?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/FbxmF4Oqy9c/ordnance-survey-data-importer.html" title="Ordnance Survey Data Importer Coordinate Conversion Accuracy" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>4</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2012/03/ordnance-survey-data-importer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08GQ3k9fSp7ImA9WhVTGU4.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-2246119748705521439</id><published>2012-03-05T09:30:00.000Z</published><updated>2012-03-05T09:30:22.765Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-05T09:30:22.765Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="performance" /><category scheme="http://www.blogger.com/atom/ns#" term="sql server" /><title>Quick win - check your table variable use</title><content type="html">&lt;div class="post"&gt;
&lt;p&gt;
Quick wins are awesome. Making a change that takes minimal effort and yields a significant performance improvement is very satisfying.
&lt;/p&gt;
&lt;p&gt;
This particular potential quick win relates to the use of table variables vs. temporary tables. Have a non-trivial stored procedure that produces some intermediary results and stores in a table variable which then goes on to be used further in the stored procedure? Consider evaluating a switch to a temporary table instead. This very quick change, can give a great performance boost for such little effort due to the points outlined on &lt;a href="http://msdn.microsoft.com/en-us/library/ms175010.aspx" target="_new"&gt;MSDN&lt;/a&gt; (quote):

&lt;blockquote&gt;table variables are not supported in the SQL Server optimizer's cost-based reasoning model. Therefore, they should not be used when cost-based choices are required to achieve an efficient query plan. Temporary tables are preferred when cost-based choices are required. This typically includes queries with joins, parallelism decisions, and index selection choices.&lt;/blockquote&gt;
&lt;blockquote&gt;
Queries that modify table variables do not generate parallel query execution plans. Performance can be affected when very large table variables, or table variables in complex queries, are modified. In these situations, consider using temporary tables instead......Queries that read table variables without modifying them can still be parallelized.
&lt;/blockquote&gt;
&lt;blockquote&gt;
Indexes cannot be created explicitly on table variables, and no statistics are kept on table variables. In some cases, performance may improve by using temporary tables instead, which support indexes and statistics.&lt;/blockquote&gt;

I've seen cases where &lt;b&gt;&lt;i&gt;this alone&lt;/i&gt;&lt;/b&gt;, with no other modifications, results in noticeable better performance. This could then be built on further by adding supporting indices. Of course, you should be considering whether you need temporary tables/table variables at all in your stored procedure. If you can remove the need entirely, then look to do that.
&lt;/p&gt;
Further reading: &lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/b/sqlserverstorageengine/archive/2008/03/30/sql-server-table-variable-vs-local-temporary-table.aspx" target="_new"&gt;TempDB : Table variable vs local temporary table&lt;/a&gt; by Sunil Agarwal over on the SQL Server Storage Engine MSDN blog.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms175010.aspx" target="_new"&gt;TABLE reference on MSDN&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FVND7MZrCoQ:k8y5PPuDKj8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FVND7MZrCoQ:k8y5PPuDKj8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=FVND7MZrCoQ:k8y5PPuDKj8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FVND7MZrCoQ:k8y5PPuDKj8:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FVND7MZrCoQ:k8y5PPuDKj8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FVND7MZrCoQ:k8y5PPuDKj8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=FVND7MZrCoQ:k8y5PPuDKj8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/FVND7MZrCoQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/2246119748705521439/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2012/03/quick-win-check-your-table-variable-use.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/2246119748705521439?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/2246119748705521439?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/FVND7MZrCoQ/quick-win-check-your-table-variable-use.html" title="Quick win - check your table variable use" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>4</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2012/03/quick-win-check-your-table-variable-use.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUANSXg5fCp7ImA9WhRaF0o.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-2813185862524157987</id><published>2012-02-20T21:36:00.000Z</published><updated>2012-02-20T21:36:38.624Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-20T21:36:38.624Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="performance selenium browsermob .NET" /><title>Automating Web Performance Stats Collection in .NET</title><content type="html">&lt;div class="post"&gt;
You have a web application. You're a .NET developer. Maybe you already have some automated UI testing in place via &lt;a href="http://seleniumhq.org/" target="_new"&gt;Selenium&lt;/a&gt;, or maybe you don't. What you want to do is automate the collection of some performance metrics about your application.&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;Q.&lt;/b&gt; How would you go about doing that in .NET?&lt;br/&gt;
&lt;b&gt;A.&lt;/b&gt; Use the following recipe for success.
&lt;br/&gt;
&lt;h4&gt;Ingredients&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://opensource.webmetrics.com/browsermob-proxy/" target="_new"&gt;BrowserMob Proxy&lt;/a&gt; by Webmetrics, which (quote) is: &lt;blockquote&gt;A free utility to help web developers watch and manipulate network traffic from their web applications&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://seleniumhq.org/" target="_new"&gt;Selenium&lt;/a&gt;, which (quote): &lt;blockquote&gt;automates browsers. That's it.&lt;/blockquote&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/AutomatedTester/AutomatedTester.BrowserMob" target="_new"&gt;BrowserMob Proxy .NET Library&lt;/a&gt;, a .NET library to provide a simple way to work with BrowserMob Proxy and Selenium, written by David Burns (&lt;a href="http://www.theautomatedtester.co.uk" target="_new"&gt;blog&lt;/a&gt; | &lt;a href="http://twitter.com/automatedtester" target="_new"&gt;twitter&lt;/a&gt;) and myself (you're already on my blog | &lt;a href="http://twitter.com/adathedev" target="_new"&gt;twitter&lt;/a&gt;).
&lt;/ul&gt;

&lt;h4&gt;Preparation&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Download the BrowserMob Proxy from &lt;a href="https://github.com/webmetrics/browsermob-proxy/downloads" target="_new"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Download the BrowserMob Proxy .NET Library from GitHub (&lt;a href="https://github.com/AutomatedTester/AutomatedTester.BrowserMob/downloads" target="_new"&gt;binaries&lt;/a&gt;, or get the source and build yourself)&lt;/li&gt;
&lt;li&gt;Reference Selenium in your .NET project (available via nuget, or from &lt;a href="http://seleniumhq.org/download/"&gt;seleniumhq&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Reference the BrowserMob Proxy .NET Library in your .NET project&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Make and Bake&lt;/h4&gt;
Example:
&lt;pre class="code"&gt;
using AutomatedTester.BrowserMob.HAR;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;

namespace AutomatedTester.BrowserMob.Example
{
    public class ExampleClass
    {
        public void ExampleUse()
        {
            // Supply the path to the Browsermob Proxy batch file
            Server server = new Server(@"C:\BrowserMobProxy\bin\browsermob-proxy.bat");
            server.Start();

            Client client = server.CreateProxy();
            client.NewHar("google");

            var seleniumProxy = new Proxy { HttpProxy = client.SeleniumProxy };
            var profile = new FirefoxProfile();
            
            profile.SetProxyPreferences(seleniumProxy);
            // Navigate to the page to retrieve performance stats for
            IWebDriver driver = new FirefoxDriver(profile);
            driver.Navigate().GoToUrl("http://www.google.co.uk");

            // Get the performance stats
            HarResult harData = client.GetHar();           
 
            // Do whatever you want with the metrics here. Easy to persist 
            // out to a data store for ongoing metrics over time.
            
            driver.Quit();
            client.Close();
            server.Stop();
        }   
    }
}
&lt;/pre&gt;

What's great is that if you already have some Selenium tests in place, you can add in the collection of performance metrics quickly and easily. This gives you the ability to collate performance metrics over time - a perfect way to identify problem areas to investigate and to quantify performance improvements you make.

To learn more about what is in the performance data, check out these links which go into more detail about the HAR format (HTTP Archive) - this is what Webmetric's BrowserMob Proxy returns, which we expand out into a POCO structure (HarResult type).
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://groups.google.com/group/http-archive-specification" target="_new"&gt;HTTP Archive specification google group&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.softwareishard.com/blog/har-12-spec/" target="_new"&gt;HAR 1.2 Spec&lt;/a&gt;
&lt;/ul&gt;

&lt;a href="http://opensource.webmetrics.com/browsermob-proxy/" target="_new"&gt;BrowserMob Proxy&lt;/a&gt; allows you to do some pretty funky stuff, such as:
&lt;ul&gt;
&lt;li&gt;blacklisting / whitelisting content&lt;/li&gt;
&lt;li&gt;simulate network traffic / latency&lt;/li&gt;
&lt;/ul&gt;
The .NET library wrapper we've made available supports this functionality.

Hopefully, this will come in useful for those in the .NET world!
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=zNirT-NfrdM:s9vdJuZ9ois:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=zNirT-NfrdM:s9vdJuZ9ois:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=zNirT-NfrdM:s9vdJuZ9ois:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=zNirT-NfrdM:s9vdJuZ9ois:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=zNirT-NfrdM:s9vdJuZ9ois:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=zNirT-NfrdM:s9vdJuZ9ois:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=zNirT-NfrdM:s9vdJuZ9ois:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/zNirT-NfrdM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/2813185862524157987/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2012/02/automating-web-performance-stats.html#comment-form" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/2813185862524157987?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/2813185862524157987?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/zNirT-NfrdM/automating-web-performance-stats.html" title="Automating Web Performance Stats Collection in .NET" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>8</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2012/02/automating-web-performance-stats.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYCQHY4eip7ImA9WhRVF0w.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-1678938059227823700</id><published>2012-01-16T10:36:00.000Z</published><updated>2012-01-16T10:36:01.832Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-16T10:36:01.832Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sql server" /><category scheme="http://www.blogger.com/atom/ns#" term="TSQL" /><category scheme="http://www.blogger.com/atom/ns#" term="XML" /><title>Excluding nodes from XML data before returning from SQL Server</title><content type="html">&lt;div class="post"&gt;
This post follows on from a question I recently replied to, for how to exclude a specific node from an XML column value before returning it, using TSQL.
&lt;h4&gt;Example setup&lt;/h4&gt;
&lt;pre class="code"&gt;
CREATE TABLE Example
(
ID INTEGER IDENTITY(1,1) PRIMARY KEY,
XmlField XML
)

INSERT Example (XmlField) VALUES ('&amp;lt;Root&amp;gt;&amp;lt;ChildA&amp;gt;Value I want to see&amp;lt;/ChildA&amp;gt;&amp;lt;ChildB&amp;gt;Value I do not want to see&amp;lt;/ChildB&amp;gt;&amp;lt;/Root&amp;gt;')
&lt;/pre&gt;

So if you want to return the XML minus the &lt;b&gt;ChildB&lt;/b&gt; node, how do you do it?
&lt;h4&gt;Modify it&lt;/h4&gt;
Literally, using the &lt;a href="http://msdn.microsoft.com/en-us/library/ms187093.aspx"&gt;modify&lt;/a&gt; method that is supported on the XML data type. To quote MSDN, modify:

&lt;blockquote&gt;Modifies the contents of an XML document. Use this method to modify the content of an xml type variable or column. This method takes an XML DML statement to insert, update, or delete nodes from XML data. The modify() method of the xml data type can only be used in the SET clause of an UPDATE statement.&lt;/blockquote&gt;

That last statement, to me at least, seems slightly open for misinterpretation as strictly speaking it isn't only valid in an UPDATE statement - you can use it as part of a standalone SET statement on an XML variable (though yes, to UPDATE that variable).
&lt;br/&gt;&lt;br/&gt;
So, while you &lt;u&gt;&lt;b&gt;can't&lt;/b&gt;&lt;/u&gt; do something like this:
&lt;pre class="code"&gt;
SELECT XmlField.modify('delete /Root/ChildB')
FROM Example
WHERE ID = 1
&lt;/pre&gt;
as it results in the following error:
&lt;pre class="error"&gt;
Msg 8137, Level 16, State 1, Line 1
Incorrect use of the XML data type method 'modify'. A non-mutator method is expected in this context.
&lt;/pre&gt;

you can instead do this:

&lt;pre class="code"&gt;
DECLARE @xml XML
SELECT @xml = XmlField
FROM Example
WHERE ID = 1

-- Delete the node from the XML in the variable
SET @xml.modify('delete /Root/ChildB')

SELECT @xml
&lt;/pre&gt;

That does the trick.
&lt;h4&gt;Dealing with multiple rows&lt;/h4&gt;
If you wanted to do something like this from the database side when returning multiple rows then you'd need to either:
&lt;ol&gt;
&lt;li&gt;create a scalar UDF to perform the removal. e.g.
&lt;pre class="code"&gt;
CREATE FUNCTION dbo.RemoveNode(@xml XML)
 RETURNS XML
AS
BEGIN
 SET @xml.modify('delete /Root/ChildB')
 RETURN @xml
END
GO

SELECT dbo.RemoveNode(XmlField) AS XmlField
FROM Example
&lt;/pre&gt;
Note the parameter to the modify method must be a literal string, so you can't parameterise the UDF to make it a bit more generic by using that parameter in the call to modify().
&lt;br/&gt;&lt;br/&gt;
&lt;/li&gt;
&lt;li&gt;SELECT the xml values into a temp table/table variable, do an UPDATE like this:&lt;br/&gt;
&lt;pre class="code"&gt;
UPDATE #Temp
SET XmlField.modify('delete /Root/ChildB')
&lt;/pre&gt;
and then SELECT from the temp table/table variable.&lt;br/&gt;&lt;br/&gt;
&lt;/li&gt;
&lt;li&gt;Use SQLCLR&lt;/li&gt;
&lt;/ol&gt;

Of course, the typical question should be asked - do you need to do this on the database side, or can you return the XML as-is from SQL Server and modify it accordingly in your calling code? In the original case acting on a single XML value, it's OK but when you start looking into scalar UDF's etc for multi-row requirements then you should be careful to check performance.
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=eaeDldoC1Cg:m1wWwmtqqio:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=eaeDldoC1Cg:m1wWwmtqqio:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=eaeDldoC1Cg:m1wWwmtqqio:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=eaeDldoC1Cg:m1wWwmtqqio:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=eaeDldoC1Cg:m1wWwmtqqio:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=eaeDldoC1Cg:m1wWwmtqqio:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=eaeDldoC1Cg:m1wWwmtqqio:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/eaeDldoC1Cg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/1678938059227823700/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2012/01/modifying-xml-data-before-returning.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/1678938059227823700?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/1678938059227823700?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/eaeDldoC1Cg/modifying-xml-data-before-returning.html" title="Excluding nodes from XML data before returning from SQL Server" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2012/01/modifying-xml-data-before-returning.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEMQn8yfyp7ImA9WhRWFUU.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-3821401087892466110</id><published>2012-01-02T22:32:00.000Z</published><updated>2012-01-03T10:31:23.197Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-03T10:31:23.197Z</app:edited><title>Round up of 2011</title><content type="html">&lt;div class="post"&gt;
Another year is done and dusted so it's that time again - time to reflect on the past year.
&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;Quick Timeline&lt;/b&gt;&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;March: &lt;a href="http://skillsmatter.com/event-details/nosql/mongouk-2011" target="_new"&gt;Mongo UK&lt;/a&gt; - London&lt;/b&gt;&lt;br/&gt;
A chance to attend my first NOSQL conference, having recently entered in the world of MongoDB for some projects. Picked up some good pointers and food-for-thought.&lt;br/&gt;
&lt;i&gt;&lt;b&gt;Just some words: &lt;/b&gt;NOSQL, hard seats, gonna-need-a-bigger-venue, enlightening.&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;April: &lt;a href="http://sqlbits.com/events/event8/SQLBitsVIII.aspx" target="_new"&gt;SQLBits 8 - Beside The Seaside&lt;/a&gt; - Brighton&lt;/b&gt;&lt;br/&gt; 
Highlight of the year for me, conference-wise (was unable to make SQLBits 9 - Liverpool). Fantastic venue, truly awesome speakers/technical content and a really great crowd of people - a true community. Out of all conferences I've gone to over the years, SQLBits never fails to stand out and this one took things to a whole new level.&lt;br/&gt;
&lt;i&gt;&lt;b&gt;Just some words: &lt;/b&gt;Crappy code, community, awesome, invaluable, bean bags.&lt;/i&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;April: Microsoft Community Contributor Award&lt;/b&gt;&lt;br/&gt;
I really enjoy chipping in on sites like StackOverflow and the MSDN forums, and this was a nice (humbling) surprise when I got the email to say I'd received this acknowledgement (&lt;a href="http://www.adathedev.co.uk/2011/04/microsoft-community-contributor-award.html" target="_new"&gt;blog&lt;/a&gt;).&lt;br/&gt;
&lt;i&gt;&lt;b&gt;Just some words: &lt;/b&gt;Surprise&lt;/i&gt;
&lt;li&gt;&lt;b&gt;July: Job Change&lt;/b&gt;&lt;br/&gt;
After a great 4 and a half years, it was time to move on to a new role. Took the opportunity to work with fellow SQLSoton attendee Matt Whitfield (&lt;a href="http://twitter.com/atlantis_uk" target="_new"&gt;twitter&lt;/a&gt;) - who by the way, has some great (&lt;u&gt;FREE&lt;/u&gt;) SQL Server tools which can be found &lt;a href="http://www.atlantis-interactive.co.uk/" target="_new"&gt;here&lt;/a&gt;.&lt;br/&gt;
&lt;b&gt;&lt;i&gt;Just some words: &lt;/b&gt;New challenge, acquisition, end of an era.&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;September: &lt;a href="http://www.10gen.com/events/mongouk-sept-2011" target="_new"&gt;Mongo UK&lt;/a&gt; - London&lt;/b&gt;&lt;br/&gt;
A chance to brush up on the latest in the world of MongoDB after a few months away from it.&lt;br/&gt;
&lt;i&gt;&lt;b&gt;Just some words: &lt;/b&gt;NOSQL, comfy seats, information gems, lego man USB stick.&lt;/i&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Monthly: SQLSoton User Group&lt;/b&gt;&lt;br/&gt;
A really good year of UserGroup meets down here in Southampton every month. Thanks to Mark Pryce-Maher (&lt;a href="http://twitter.com/tsqltidy" target="_new"&gt;twitter&lt;/a&gt;) for his time and effort, and all the speakers who have taken the time to give a talk. From the first meeting just over a year a go - a small group, in a tiny side room, with no projector - to now - a larger crowd, in a bigger hall, with a projector - it's obvious SQLSoton is providing a valuable SQL Server community service to the Southampton/South Coast area. Check out all the UK SQL Server UserGroups over at &lt;a href="http://sqlserverfaq.com/" target="_new"&gt;SQLServerFAQ&lt;/a&gt;.&lt;br/&gt;
&lt;i&gt;&lt;b&gt;Just some words: &lt;/b&gt;Community, pizza, swag, network.&lt;/i&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
&lt;b&gt;Top 3 Blog Posts By Views&lt;/b&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.adathedev.co.uk/2010/02/sqlbulkcopy-bulk-load-to-sql-server.html" target="_new"&gt;High Performance Bulk Loading to SQL Server Using SqlBulkCopy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.adathedev.co.uk/2010/02/sql-server-2008-table-valued-parameters.html" target="_new"&gt;SQL Server 2008 - Table Valued Parameters vs XML vs CSV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.adathedev.co.uk/2010/07/getting-started-with-cassandra-and-net.html" target="_new"&gt;Getting Started With Cassandra and .NET&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.adathedev.co.uk/2011/01/gb-post-code-geographic-data-load-to.html" target="_new"&gt;Ordnance Survey Post Code Geographic Data Load to SQL Server Using .NET&lt;/a&gt;*&lt;/li&gt;
&lt;/ol&gt;
* OK, so that's the top 4, not the top 3. But that's because I suspect #3 is actually skewed by people looking for "an entirely different kind of site"...I know I had to be careful which links to click when googling for Cassandra (as in the NOSQL database, obviously) and .NET!
&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;Open Source Projects&lt;/b&gt;&lt;br/&gt;
I started on a few little side projects, which I stuck up on to &lt;a href="https://github.com/AdaTheDev" target="_new"&gt;GitHub&lt;/a&gt; for the world to see and (hopefully) use. First came a .NET app to load some of the freely available geographical datasets from Ordnance Survey into SQL Server (&lt;a href="https://github.com/AdaTheDev/Ordnance-Survey-Code-Point-Data-Importer" target="_new"&gt;GitHub&lt;/a&gt;) which relates to blog post #4 above. Next came a MongoDB-backed ASP.NET session state store (&lt;a href="https://github.com/AdaTheDev/MongoDB-ASP.NET-Session-State-Store" target="_new"&gt;GitHub&lt;/a&gt;). It was a lot of fun working on these, even though they are pretty trivial things, and was great to actually get some nice feedback from people who found and started using them.
&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;Bottom Line&lt;/b&gt;&lt;br/&gt;
2011 was a good year. A lot of learning and new challenges meant I was kept on my toes. Looking back though, there are definitely things I'm not pleased about. I dropped the blogging ball in the second half of the year - activity pretty much flatlined for various reasons. So I'm disappointed about that. To &lt;a href="https://twitter.com/#!/JohnSansom/status/150141809920704512" target="_new"&gt;quote a tweet&lt;/a&gt; by John Sansom (&lt;a href="http://twitter.com/johnsansom" target="_new"&gt;twitter&lt;/a&gt;)...
&lt;blockquote&gt;blogging is like going to the gym. Once you fall out of a routine it's tougher to get back into your rhythm&lt;/blockquote&gt;
True that.

Looking forward to 2012!
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=AD5JQzarjrc:2Db6zEFwC4s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=AD5JQzarjrc:2Db6zEFwC4s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=AD5JQzarjrc:2Db6zEFwC4s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=AD5JQzarjrc:2Db6zEFwC4s:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=AD5JQzarjrc:2Db6zEFwC4s:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=AD5JQzarjrc:2Db6zEFwC4s:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=AD5JQzarjrc:2Db6zEFwC4s:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/AD5JQzarjrc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/3821401087892466110/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2012/01/round-up-of-2011.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/3821401087892466110?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/3821401087892466110?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/AD5JQzarjrc/round-up-of-2011.html" title="Round up of 2011" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2012/01/round-up-of-2011.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IEQXY8cSp7ImA9WhdVEUw.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-4549262424275753860</id><published>2011-09-15T21:44:00.000+01:00</published><updated>2011-09-15T21:45:00.879+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-15T21:45:00.879+01:00</app:edited><title>OS CodePoint Data Geography Update Sept 2011</title><content type="html">&lt;div class="post"&gt;
&lt;b&gt;History:&lt;/b&gt;&lt;br/&gt;
&lt;a href="http://www.adathedev.co.uk/2011/01/gb-post-code-geographic-data-load-to.html" target="_new"&gt;GB Post Code Geographic Data Load to SQL Server using .NET&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.adathedev.co.uk/2011/02/os-codepoint-data-geography-load-update.html" target="_new"&gt;OS CodePoint Data Geography Load Update&lt;/a&gt;
&lt;p&gt;
Following a comment on my original post listed above, it appears the structure of the CodePoint data file has changed. This means that the importer will fail when attempting to import the latest data files supplied by Ordnance Survey as the columns in the files have changed.
&lt;/p&gt;
&lt;p&gt;
I've pushed an update to the &lt;a href="http://github.com/AdaTheDev/Ordnance-Survey-Code-Point-Data-Importer" target="_new"&gt;project on GitHub&lt;/a&gt; to address this - it now takes a sensible approach so the index positions are no longer hard coded. Instead, the CodePoint importer now takes an extra argument - the path to the CSV file that contains the column header listing as supplied in the supporting docs in the download. The column indices we are interested in (for Easting, Northing and PostCode) are worked out from this. Obviously makes it a bit more future proof, so if the structure changes again in the future, it should pick up on that automatically.
&lt;/p&gt;
&lt;p&gt;This is an update to the CodePoint import only at the moment as I haven't had time to check the Scale Gazetteer import as yet. See the project/readme on GitHub for more info.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FU-k1qsEsPs:iJv2rVXI1p0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FU-k1qsEsPs:iJv2rVXI1p0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=FU-k1qsEsPs:iJv2rVXI1p0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FU-k1qsEsPs:iJv2rVXI1p0:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FU-k1qsEsPs:iJv2rVXI1p0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=FU-k1qsEsPs:iJv2rVXI1p0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=FU-k1qsEsPs:iJv2rVXI1p0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/FU-k1qsEsPs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/4549262424275753860/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/09/os-codepoint-data-geography-update-sept.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/4549262424275753860?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/4549262424275753860?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/FU-k1qsEsPs/os-codepoint-data-geography-update-sept.html" title="OS CodePoint Data Geography Update Sept 2011" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/09/os-codepoint-data-geography-update-sept.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQBSXc4cCp7ImA9WhdQF00.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-6228557977473291416</id><published>2011-08-18T21:44:00.001+01:00</published><updated>2011-08-18T21:45:58.938+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-18T21:45:58.938+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="nosql" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="Riak" /><title>Getting Started with Riak and .NET</title><content type="html">&lt;div class="post"&gt;Earlier in the year, I started playing around with MongoDB using .NET and wrote up a &lt;a href="http://www.adathedev.co.uk/2011/01/getting-started-with-mongodb-and-net.html" target="_new"&gt;Getting Started&lt;/a&gt; guide. Now it's Riak's turn.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Nutshell&lt;/b&gt;&lt;br /&gt;
Riak is a distributed, schemaless, data-type agnostic key-value "NoSQL" database written primarily in Erlang.&lt;br /&gt;
&lt;br /&gt;
Check out the "&lt;a href="http://wiki.basho.com/What-is-Riak%3F.html" target="_new"&gt;What is Riak?&lt;/a&gt;" page on Basho's wiki.&lt;br /&gt;
&lt;br /&gt;
Riak does not run on Windows so you'll need to choose your supported OS of choice to install Riak on. Having used Ubuntu before for MongoDB, I went down that route so my notes here are oriented that way. So, after getting a Ubuntu VM set up...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 1&lt;/b&gt;&lt;br /&gt;
Install the latest custom .deb package, as per the &lt;a href="http://wiki.basho.com/Installing-on-Debian-and-Ubuntu.html" target="_new"&gt;Basho guide&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 2&lt;/b&gt;&lt;br /&gt;
Before you start Riak up, you need to tweak the configuration in Riak's app.config file. Follow the &lt;a href="http://wiki.basho.com/Basic-Cluster-Setup.html" target="_new"&gt;Basic Cluster Setup&lt;/a&gt; guide, but  note that when you update the IP address for the http interface per those instructions, also make the same change to the pb_ip config value - this is for the Protocol Buffers interface. For performance, I wanted to use the Protocol Buffers interface instead of the HTTP REST API and had some initial problems as the pb_ip configuration was still set to 127.0.0.1.&lt;br /&gt;
&lt;br /&gt;
You then need to edit vm.args, per the setup guide.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 3&lt;/b&gt;&lt;br /&gt;
Now you're ready to fire up Riak. Run:&lt;br /&gt;
&lt;pre class="code"&gt;$ riak start
&lt;/pre&gt;Then make sure all is well using:&lt;br /&gt;
&lt;pre class="code"&gt;$ riak ping
&lt;/pre&gt;If all is well, it will respond with "pong".&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 4&lt;/b&gt;&lt;br /&gt;
Now, back in the comfort of Windows (my Linux-fu is seriously lacking) we're ready to get going. There is no official .NET client library at time of writing, but Basho list a few &lt;a href="http://wiki.basho.com/Client-Libraries.html"&gt;community contributed projects&lt;/a&gt;. When I first looked, only 2 were listed and these appeared to be inactive with no updates since last year. It was a bit disappointing to see the lack of support for those of us in the .NET world. I then discovered &lt;a href="http://corrugatediron.org/" target="_new"&gt;CorrugatedIron&lt;/a&gt;, very hot-of-the-press, under development by OJ Reeves (&lt;a href="http://twitter.com/thecolonial" target="_new"&gt;Twitter&lt;/a&gt; | &lt;a href="http://buffered.io/" target="_new"&gt;Blog&lt;/a&gt;) and Jeremiah Peschka (&lt;a href="http://twitter.com/peschkaj" target="_new"&gt;Twitter&lt;/a&gt; | &lt;a href="http://facility9.com/"&gt;Blog&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
The simplest way to get everything you need to get going is via NuGet.&lt;br /&gt;
&lt;br /&gt;
Nu-what?&lt;br /&gt;
&lt;br /&gt;
NuGet. It's a Visual Studio extension that you can download from &lt;a href="http://nuget.org/"&gt;here&lt;/a&gt;. Once installed, fire up VS and create a new .NET 4.0 Framework project. Then in the Solution Explorer, right click the project and select "Manage NuGet Packages...".&lt;br /&gt;
&lt;img src="https://lh4.googleusercontent.com/-43q2u5SeTS8/Tk1tuz2PKPI/AAAAAAAAAV0/ODm7OvIWBWs/s800/ManageNuGet.png" /&gt;&lt;br /&gt;
&lt;br /&gt;
In the dialog, search online packages for: CorrugatedIron.&lt;br /&gt;
&lt;br /&gt;
&lt;img src="https://lh5.googleusercontent.com/-KcUWXidnH6k/Tk1ujytAvRI/AAAAAAAAAV8/SvpHGgAuuNM/s800/CorrugatedIron.png"/&gt;&lt;br /&gt;
&lt;br /&gt;
Click Install, and it will download all the assemblies/dependencies you need. When it's finished, you'll see you have references to CorrugatedIron, Newtonsoft.Json and protobuf-net.&lt;br /&gt;
&lt;br /&gt;
Open up app.config and you'll see some initial example config for CorrugatedIron. Configure that accordingly to point at your running Riak node. For example, my Riak node is running on a VM called "Riak1", with the REST interface listening on port 8098 and the protocol buffers interface listening on port 8087:&lt;br /&gt;
&lt;pre class="code"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;configuration&amp;gt;
  &amp;lt;configSections&amp;gt;
    &amp;lt;section name="riakConfig" type="CorrugatedIron.Config.RiakClusterConfiguration, CorrugatedIron" /&amp;gt;
  &amp;lt;/configSections&amp;gt;
  &amp;lt;riakConfig nodePollTime="5000" defaultRetryWaitTime="200" defaultRetryCount="3"&amp;gt;
    &amp;lt;nodes&amp;gt;
      &amp;lt;node name="Riak1" hostAddress="Riak1" pbcPort="8087" restScheme="http" restPort="8098" poolSize="20" /&amp;gt;      
    &amp;lt;/nodes&amp;gt;
  &amp;lt;/riakConfig&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Step 5&lt;/b&gt;&lt;br /&gt;
A quick check to make sure you can communicate with your Riak node:&lt;br /&gt;
&lt;pre class="code"&gt;static void Main(string[] args)
{
    IRiakCluster cluster = RiakCluster.FromConfig("riakConfig");
    IRiakClient client = cluster.CreateClient();
    RiakResult result = client.Ping();
    Console.WriteLine(result.IsSuccess);
}
&lt;/pre&gt;&lt;br /&gt;
Fingers crossed, and you will get a successful response! From here, you can start playing around with Riak from .NET and find your way round the client.&lt;br /&gt;
&lt;br /&gt;
CorrugatedIron is still very new, so keep an eye on the &lt;a href="http://corrugatediron.org/" target="_new"&gt;site&lt;/a&gt; and/or on the &lt;a href="https://github.com/DistributedNonsense/CorrugatedIron" target="_new"&gt;GitHub repository&lt;/a&gt;. Give it a whirl, and be sure to let the guys know how you get on - I'm sure they'd be keen to hear from those using it and the project deserves support from those of us in the .NET world.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Useful tool&lt;/b&gt;&lt;br /&gt;
It's useful to have some form of GUI over Riak so you can actually "see stuff". I've been using Rekon which I found useful to get up and running with Riak. See the download/install instructions on it's &lt;a href="https://github.com/basho/rekon" target="_new"&gt;GitHub repository page&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Hopefully, this post will help anyone else wanting to give Riak a try from a .NET perspective!&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=KwRjlely-z4:Ks78EfGieyQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=KwRjlely-z4:Ks78EfGieyQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=KwRjlely-z4:Ks78EfGieyQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=KwRjlely-z4:Ks78EfGieyQ:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=KwRjlely-z4:Ks78EfGieyQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=KwRjlely-z4:Ks78EfGieyQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=KwRjlely-z4:Ks78EfGieyQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/KwRjlely-z4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/6228557977473291416/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/08/getting-started-with-riak-and-net.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/6228557977473291416?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/6228557977473291416?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/KwRjlely-z4/getting-started-with-riak-and-net.html" title="Getting Started with Riak and .NET" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh4.googleusercontent.com/-43q2u5SeTS8/Tk1tuz2PKPI/AAAAAAAAAV0/ODm7OvIWBWs/s72-c/ManageNuGet.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/08/getting-started-with-riak-and-net.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8NQ3g7fSp7ImA9WhZaEk0.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-3457010554494897869</id><published>2011-06-27T20:28:00.000+01:00</published><updated>2011-06-27T20:28:12.605+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-27T20:28:12.605+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sql server" /><title>sp_executesql change between 2005 and 2008</title><content type="html">&lt;div class="post"&gt;Today I tripped over what turned out to be a difference in the way sp_executesql behaves between SQL Server 2005 and 2008 when executing a string containing a parameterised stored procedure call.&lt;br /&gt;
&lt;br /&gt;
Take this simplified example:&lt;br /&gt;
&lt;pre class="code"&gt;DECLARE @SQL NVARCHAR(256)
SET @SQL = 'sp_help @obj'
EXECUTE sp_executesql @SQL, N'@obj NVARCHAR(100)', 'sp_help'&lt;/pre&gt;In SQL Server 2008 (10.0.4000.0), the above executes successfully.&lt;br /&gt;
In SQL Server 2005 (9.00.1399.06), it throws the following exception:&lt;br /&gt;
&lt;pre class="error"&gt;Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'sp_help'.&lt;/pre&gt;Adding the "EXEC(UTE)" before the stored procedure name in @SQL resolves the issue in 2005. As standard, I (usually) standardise on ensuring all stored procedure calls are made with "EXEC(UTE)" even when it is the only statement in the batch. Obviously, in this case it was overlooked and tripped me up!&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;pre class="code"&gt;&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=sH2X4NX9EPk:E0uS8dkGM0M:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=sH2X4NX9EPk:E0uS8dkGM0M:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=sH2X4NX9EPk:E0uS8dkGM0M:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=sH2X4NX9EPk:E0uS8dkGM0M:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=sH2X4NX9EPk:E0uS8dkGM0M:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=sH2X4NX9EPk:E0uS8dkGM0M:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=sH2X4NX9EPk:E0uS8dkGM0M:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/sH2X4NX9EPk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/3457010554494897869/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/06/spexecutesql-change-between-2005-and.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/3457010554494897869?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/3457010554494897869?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/sH2X4NX9EPk/spexecutesql-change-between-2005-and.html" title="sp_executesql change between 2005 and 2008" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/06/spexecutesql-change-between-2005-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QGSHg6fyp7ImA9WhZbGUk.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-5718442392417962451</id><published>2011-06-24T20:55:00.000+01:00</published><updated>2011-06-24T20:55:29.617+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-24T20:55:29.617+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="performance" /><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB" /><category scheme="http://www.blogger.com/atom/ns#" term="sql server" /><category scheme="http://www.blogger.com/atom/ns#" term="scalability" /><title>The importance of "Working Set"</title><content type="html">&lt;div class="post"&gt;One of the things that I see cropping up pretty often is this thing called "working set". After recently chipping in on another StackOverflow question on the subject of "&lt;a href="http://http://stackoverflow.com/questions/6453584/what-does-it-mean-to-fit-working-set-into-ram-for-mongodb" target="_new"&gt;What does it meant to fit 'working set' in RAM?&lt;/a&gt;", I thought it was a good subject for a blog post. This is really just a copy and extension of my input on that question and focused in certain parts on MongoDB, but is also as relevant to other databases.&lt;br /&gt;
&lt;br /&gt;
"Working set" is basically the amount of data and indexes that will be active/in use by your system at any given time.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Why is it important to keep your working set in RAM?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Accessing RAM is quick. Accessing disk is slow. When querying your data store, if all the data and indexes typically accessed are in RAM, then performance is blisteringly quick. If it's not in RAM, then disk access is required and that is when performance suffers. Hence it is important to ensure you have enough to hold your working set. The moment your working set exceeds the about of RAM you have, you will start to notice the performance degradation as it has to pull stuff back off disk, so it's important to monitor the situation and react.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Crude Example&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Suppose you have 1 year's worth of data. For simplicity, each month relates to 1GB of data giving 12GB in total, and to cover each month's worth of data you have 1GB worth of indexes again totalling 12GB for the year.&lt;br /&gt;
&lt;br /&gt;
If you are always accessing the last 12 month's worth of data, then your working set is: 12GB (data) + 12GB (indexes) = 24GB.&lt;br /&gt;
&lt;br /&gt;
However, if you actually only access the last 3 month's worth of data, then your working set is: 3GB (data) + 3GB (indexes) = 6GB.&lt;br /&gt;
&lt;br /&gt;
You need to understand your data set, scenario and the usage patterns, in order to work out a ball park estimate of your working set. Don't expect a black and white answer for what your working set is in your environment, from someone who doesn't know these things.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What if my working set sky-rockets?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Add more RAM. This can be a case of adding more into your existing node(s). Or, if you need non-trivial increases, making use of sharding to split the data over a number of nodes and just bring more nodes online as you need. This provides incredible potential to scale out your workload.&lt;br /&gt;
&lt;br /&gt;
The key point is to ask yourself: do I have enough RAM for my working set? If the answer is: "I don't know", then get yourself to the position of knowing.&lt;br /&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=kgoBDopXQ5E:Q84XMM2NE7Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=kgoBDopXQ5E:Q84XMM2NE7Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=kgoBDopXQ5E:Q84XMM2NE7Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=kgoBDopXQ5E:Q84XMM2NE7Q:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=kgoBDopXQ5E:Q84XMM2NE7Q:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=kgoBDopXQ5E:Q84XMM2NE7Q:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=kgoBDopXQ5E:Q84XMM2NE7Q:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/kgoBDopXQ5E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/5718442392417962451/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/06/importance-of-working-set.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/5718442392417962451?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/5718442392417962451?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/kgoBDopXQ5E/importance-of-working-set.html" title="The importance of &quot;Working Set&quot;" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/06/importance-of-working-set.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cBQ3c7cSp7ImA9WhZbGE4.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-979120483531362822</id><published>2011-06-23T14:15:00.001+01:00</published><updated>2011-06-23T14:17:32.909+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-23T14:17:32.909+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="usergroup" /><category scheme="http://www.blogger.com/atom/ns#" term="sqlsoton" /><title>Upcoming SQLSoton UG - 6th July 2011</title><content type="html">&lt;div class="post"&gt;The next SQLSoton (&lt;a href="http://twitter.com/sqlsoton" target="_new"&gt;twitter&lt;/a&gt;) UserGroup meet is coming up on &lt;a href="http://www.sqlserverfaq.com/events/284/SQL-User-group-evening-of-Matt-Whitfield-atlantisuk-and-Alex-Whittles-PurpleFrogSys-WIN-AN-XBOX.aspx" target="_new"&gt;Wednesday 6th July&lt;/a&gt;. Matt Whitfield (&lt;a href="http://twitter.com/atlantis_uk" target="_new"&gt;twitter&lt;/a&gt; | &lt;a href="http://www.atlantis-interactive.co.uk/blog/" target="_new"&gt;blog&lt;/a&gt;) will be presenting some "notes from the field" and Alex Whittles (&lt;a href="http://twitter.com/PurpleFrogSys" target="_new"&gt;twitter&lt;/a&gt; | &lt;a href="http://www.purplefrogsystems.com/blog/" target="_new"&gt;blog&lt;/a&gt;) will be giving a talk on automating cube documentation with SSRS, DMV &amp; spatial data.&lt;br /&gt;
&lt;br /&gt;
Don't forget to &lt;a href="http://www.sqlserverfaq.com/events/284/SQL-User-group-evening-of-Matt-Whitfield-atlantisuk-and-Alex-Whittles-PurpleFrogSys-WIN-AN-XBOX.aspx" target="_new"&gt;register&lt;/a&gt;!&lt;br /&gt;
&lt;br /&gt;
Oh, and did I forget to mention? &lt;a href="https://twitter.com/#!/tsqltidy/statuses/83600236689375233" target="_new"&gt;There's an XBox up for grabs&lt;/a&gt;. See you there? Thought so :)&lt;br /&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=l6wg-vvaRm8:_LVXwIKUIWA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=l6wg-vvaRm8:_LVXwIKUIWA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=l6wg-vvaRm8:_LVXwIKUIWA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=l6wg-vvaRm8:_LVXwIKUIWA:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=l6wg-vvaRm8:_LVXwIKUIWA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=l6wg-vvaRm8:_LVXwIKUIWA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=l6wg-vvaRm8:_LVXwIKUIWA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/l6wg-vvaRm8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/979120483531362822/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/06/upcoming-sqlsoton-ug-6th-july-2011.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/979120483531362822?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/979120483531362822?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/l6wg-vvaRm8/upcoming-sqlsoton-ug-6th-july-2011.html" title="Upcoming SQLSoton UG - 6th July 2011" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/06/upcoming-sqlsoton-ug-6th-july-2011.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8HSHo4fCp7ImA9WhZbF04.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-3017031773214413596</id><published>2011-06-22T11:33:00.000+01:00</published><updated>2011-06-22T11:33:59.434+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-22T11:33:59.434+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="community" /><title>If you can't make it, untake it</title><content type="html">&lt;div class="post"&gt;There's some great free events out there; &lt;a href="http://www.sqlbits.com" target="_new"&gt;SQLBits&lt;/a&gt; community day and the upcoming &lt;a href="http://sqlinthecity.red-gate.com/" target="_new"&gt;SQL In The City&lt;/a&gt; day by Red Gate are just two examples. With the high demand for spaces at events like these, it is well worth getting in there ASAP to reserve your space before they all go and you end up on a waiting list. &lt;br /&gt;
&lt;br /&gt;
But if you find you can no longer make it, make someone else's day by cancelling your place so that it can be freed up for those on the waiting list. You may not personally be losing out by not taking the time to cancel your place, but someone else will be.&lt;br /&gt;
&lt;br /&gt;
So...."if you can't make it, untake it" &lt;br /&gt;
&lt;br /&gt;
P.S. Yes, I know, not my greatest blog title ever...&lt;br /&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=UDaXHXYUVWg:zDXeF1Lj0pA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=UDaXHXYUVWg:zDXeF1Lj0pA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=UDaXHXYUVWg:zDXeF1Lj0pA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=UDaXHXYUVWg:zDXeF1Lj0pA:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=UDaXHXYUVWg:zDXeF1Lj0pA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=UDaXHXYUVWg:zDXeF1Lj0pA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=UDaXHXYUVWg:zDXeF1Lj0pA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/UDaXHXYUVWg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/3017031773214413596/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/06/if-you-cant-make-it-untake-it.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/3017031773214413596?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/3017031773214413596?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/UDaXHXYUVWg/if-you-cant-make-it-untake-it.html" title="If you can't make it, untake it" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/06/if-you-cant-make-it-untake-it.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIMRno_fSp7ImA9WhBRE0k.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-2996204283337163486</id><published>2011-05-03T21:03:00.000+01:00</published><updated>2013-03-03T22:09:47.445Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-03T22:09:47.445Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><title>MongoDB ASP.NET Session State Store Provider</title><content type="html">&lt;div style="background-color:#FFE97F;border: 1px solid #FFD800"&gt;
Please note: v1.1.0 of this Sesssion State Provider is now available. See blog post: &lt;a href="http://www.adathedev.co.uk/2013/03/mongodb-aspnet-session-store-provider.html"&gt;http://www.adathedev.co.uk/2013/03/mongodb-aspnet-session-store-provider.html&lt;/a&gt;
&lt;/div&gt;
&lt;div class="post"&gt;
I've pushed up an initial drop of a custom ASP.NET session state store, backed by MongoDB, to &lt;a href="https://github.com/AdaTheDev/MongoDB-ASP.NET-Session-State-Store" target="_new"&gt;my GitHub repository&lt;/a&gt;. After a quick test it seems OK, though could do with a real hammering before being deemed production worthy! So if you want to use it, just make sure you give it a good test through and most importantly, let me know how it goes! It's based on the sample custom session state provider in this &lt;a href="http://msdn.microsoft.com/en-us/library/ms178588.aspx" target="_new"&gt;MSDN article&lt;/a&gt;, basically just with the MongoDB specific bits swapped in.&lt;br /&gt;
&lt;br /&gt;
Session state is stored in a "Sessions" collection within a "SessionState" database. Example session document:&lt;br /&gt;
&lt;pre class="code"&gt;{
    "_id" : "bh54lskss4ycwpreet21dr1h",
    "ApplicationName" : "/",
    "Created" : ISODate("2011-04-29T21:41:41.953Z"),
    "Expires" : ISODate("2011-04-29T22:01:41.953Z"),
    "LockDate" : ISODate("2011-04-29T21:42:02.016Z"),
    "LockId" : 1,
    "Timeout" : 20,
    "Locked" : true,
    "SessionItems" : "AQAAAP////8EVGVzdAgAAAABBkFkcmlhbg==",
    "Flags" : 0
}
&lt;/pre&gt;&lt;br /&gt;
 Inline with the &lt;a href="http://msdn.microsoft.com/en-us/library/ms178588.aspx" target="_new"&gt;MSDN reference&lt;/a&gt; ("ODBCSessionStateStore" changed appropriately to "MongoSessionStateStore"):&lt;br /&gt;
&lt;blockquote&gt;If the provider encounters an exception when working with the data source, it writes the details of the exception to the Application Event Log instead of returning the exception to the ASP.NET application. This is done as a security measure to avoid private information about the data source from being exposed in the ASP.NET application.&lt;br /&gt;
&lt;br /&gt;
The sample provider specifies an event Source property value of "MongoSessionStateStore". Before your ASP.NET application will be able to write to the Application Event Log successfully, you will need to create the following registry key:&lt;br /&gt;
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MongoSessionStateStore&lt;br /&gt;
&lt;br /&gt;
If you do not want the sample provider to write exceptions to the event log, then you can set the custom writeExceptionsToEventLog attribute to false in the Web.config file.&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
The session-state store provider does not provide support for the Session_OnEnd event, it does not automatically clean up expired session-item data. You should have a job to periodically delete expired session information from the data store where Expires date is in the past, i.e.:&lt;br /&gt;
&lt;pre class="code"&gt;db.Sessions.remove({"Expires" : {$lt : new Date() }})&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Example web.config settings&lt;/b&gt;&lt;br /&gt;
&lt;pre class="code"&gt;&amp;lt;configuration&amp;gt;
  &amp;lt;connectionStrings&amp;gt;
    &amp;lt;add name="MongoSessionServices" connectionString="mongodb://localhost" /&amp;gt;
  &amp;lt;/connectionStrings&amp;gt;
  &amp;lt;system.web&amp;gt;
    &amp;lt;sessionState
        mode="Custom"
        customProvider="MongoSessionStateProvider"&amp;gt;
      &amp;lt;providers&amp;gt;
        &amp;lt;add name="MongoSessionStateProvider"
             type="MongoSessionStateStore.MongoSessionStateStore"
             connectionStringName="MongoSessionServices"
             writeExceptionsToEventLog="false"
             fsync="false"
             replicasToWrite="0" /&amp;gt;
      &amp;lt;/providers&amp;gt;
    &amp;lt;/sessionState&amp;gt;
  &amp;lt;/system.web&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
A few points to note, to give some control over fault tolerance and consistency:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;if you want updates to the MongoDB store to be fsync'd before returning, set fsync="true"&lt;/li&gt;
&lt;li&gt;if you have a replica set and want updates to be persisted to multiple nodes before returning, set the replicatesToWrite setting to the appropriate number.&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;&lt;u&gt;SafeMode is currently always enabled.&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If you give a whirl, please let me know how you get on.&lt;br /&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=_WBWnhijF0w:_xYfyWi-DNw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=_WBWnhijF0w:_xYfyWi-DNw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=_WBWnhijF0w:_xYfyWi-DNw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=_WBWnhijF0w:_xYfyWi-DNw:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=_WBWnhijF0w:_xYfyWi-DNw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=_WBWnhijF0w:_xYfyWi-DNw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=_WBWnhijF0w:_xYfyWi-DNw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/_WBWnhijF0w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/2996204283337163486/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/05/mongodb-aspnet-session-state-store.html#comment-form" title="29 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/2996204283337163486?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/2996204283337163486?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/_WBWnhijF0w/mongodb-aspnet-session-state-store.html" title="MongoDB ASP.NET Session State Store Provider" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>29</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/05/mongodb-aspnet-session-state-store.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4BSH85fyp7ImA9WhZXEU0.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-7285001781480423284</id><published>2011-04-29T20:22:00.000+01:00</published><updated>2011-04-29T20:22:39.127+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-29T20:22:39.127+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Community Contributor Award" /><title>Microsoft Community Contributor Award 2011</title><content type="html">&lt;div class="post"&gt;For a number of years now (since 2002 to be exact), I've been chipping in with my 2 pence on various online Q&amp;A sites. As I mention in one of my first blog posts from just over a year ago, "&lt;a href="http://www.adathedev.co.uk/2010/02/ways-to-improve-technical-skills.html"&gt;Ways to improve technical skills&lt;/a&gt;" and one back in August on "&lt;a href="http://www.adathedev.co.uk/2010/08/importance-of-being-earnest.html"&gt;The importance of being earnest&lt;/a&gt;", participating in sites like StackOverflow and the MSDN forums is a great way to keep you on your toes technically. I've learnt a lot from picking through other people's questions and challenges that they are facing, and attempting to provide some input. It gives exposure to real world problems outside of the ones I face in my own job and that I may not otherwise face. I've found it really does broaden my horizons and help me to learn more about my favourite technologies - SQL Server, C# and more recently MongoDB have been the main focus for me. Not only that, but I actually really enjoy it.&lt;br /&gt;
&lt;br /&gt;
Bearing in mind these reasons for me taking part in online communities like this and what I've personally got out of doing so, I found it quite humbling to have received the &lt;a href="https://www.microsoftcommunitycontributor.com"&gt;Microsoft Community Contributor Award&lt;/a&gt; 2011. It came as a surprise; I certainly wasn't expecting it. From what I understand, one way to be selected to receive the award is to be recommended by an MVP. If that was how I came to be selected (which I'm not sure it was), then my thanks go to whoever did that for me - it was a nice surprise to open my emails to!&lt;br /&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=J9SNLZAYk0A:y6W6fm6xmQI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=J9SNLZAYk0A:y6W6fm6xmQI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=J9SNLZAYk0A:y6W6fm6xmQI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=J9SNLZAYk0A:y6W6fm6xmQI:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=J9SNLZAYk0A:y6W6fm6xmQI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=J9SNLZAYk0A:y6W6fm6xmQI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=J9SNLZAYk0A:y6W6fm6xmQI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/J9SNLZAYk0A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/7285001781480423284/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/04/microsoft-community-contributor-award.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/7285001781480423284?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/7285001781480423284?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/J9SNLZAYk0A/microsoft-community-contributor-award.html" title="Microsoft Community Contributor Award 2011" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/04/microsoft-community-contributor-award.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8MQXY5eSp7ImA9WhZSGUw.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-7516207543851555045</id><published>2011-04-04T12:01:00.000+01:00</published><updated>2011-04-04T12:01:20.821+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-04T12:01:20.821+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="conference" /><title>5 Tips For Attending Conferences</title><content type="html">&lt;div class="post"&gt;With SQLBits 8 being this week in Brighton and it being set to be the biggest and best one yet, it got me thinking.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;If I was a first timer to a conference like this, what should I expect?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
So here's my top 5 tips:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Talk.&lt;/b&gt;&lt;br/&gt;It's easy to be daunted by a room full of people who all seem to be in little groups chatting away. You think everyone else there knows someone, except you. &lt;b&gt;Wrong.&lt;/b&gt; Of course there are people that know each other, but there will be others who don't. Don't be afraid to try and strike up a conversation with people. See it as an investment - the more people you chat to, the more people you will know at future conferences. On twitter? Play "Tweep Bingo" - try and hunt down the people you follow - that way you've got an instant "foot in the door" so to speak (unless you ignore / don't read any of their tweets in which case why are you following them?!).&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Listen.&lt;/b&gt;&lt;br/&gt;Well, wouldn't be worth talking if you didn't listen would it? The main point here is, when you're in a session, focus on listening. Don't try to keep notes of everything the speaker says because:&lt;br /&gt;
a) you'll get cramp in your hand, and you'll get it bad (personal experience, QCon 2010)&lt;br /&gt;
b) you'll be focusing on hearing and writing as opposed to listening and learning&lt;br /&gt;
There is an amazing amount of content, let your brain try to sponge it up, not your notepad. That's not to say don't make any notes, just don't fall into the trap of trying to get everything.&lt;br /&gt;
The videos will more than likely be posted online anyway for you to watch back at your leisure (they are for SQLBits).&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Bearings.&lt;/b&gt;&lt;br/&gt;Find out where the rooms are that you want to attend sessions in and make sure you know where you are going for your next session to give yourself time to get there. You don't want to be sitting in a room at the start of one session when they start talking about Squirrels when you actually wanted to hear the talk on Meerkats the other side of the building (no I haven't been to an animal conference before, but yes I have found myself in the wrong room - personal experience #2 from QCon 2010). Plus, it pays to be prepared to get to the very popular sessions - I remember Conor Cunningham's session at SQLBits 6 and the room was packed to the rafters.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Etiquette.&lt;/b&gt;&lt;br/&gt;Switch off your phone or stick it in silent mode. Don't run the risk of annoying the rest of the room by having it go off mid-session.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Socialise.&lt;/b&gt;&lt;br/&gt;A lot of conferences have after parties or evening events. Go along to them if you can, they're a great way to meet up and have some banter with others in an often very different environment. There's often free food and drink to be had if that sways you!&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=qHInUUAtTfU:qh-rk5DHzx0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=qHInUUAtTfU:qh-rk5DHzx0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=qHInUUAtTfU:qh-rk5DHzx0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=qHInUUAtTfU:qh-rk5DHzx0:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=qHInUUAtTfU:qh-rk5DHzx0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=qHInUUAtTfU:qh-rk5DHzx0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=qHInUUAtTfU:qh-rk5DHzx0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/qHInUUAtTfU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/7516207543851555045/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/04/5-tips-for-attending-conferences.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/7516207543851555045?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/7516207543851555045?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/qHInUUAtTfU/5-tips-for-attending-conferences.html" title="5 Tips For Attending Conferences" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/04/5-tips-for-attending-conferences.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ICR3c-eCp7ImA9WhZSEkg.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-7490801996327958499</id><published>2011-03-27T21:54:00.001+01:00</published><updated>2011-03-27T21:59:26.950+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-27T21:59:26.950+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Ordnance Survey" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="sql server" /><category scheme="http://www.blogger.com/atom/ns#" term="spatial" /><title>OS Data Importer Supports Scale Gazetteer Dataset</title><content type="html">&lt;div class="post"&gt;I've just pushed some updates to &lt;a href="https://github.com/AdaTheDev/Ordnance-Survey-Code-Point-Data-Importer"&gt;GitHub&lt;/a&gt; for the Ordnance Survey Data Importer .NET app I've been working on every now and then (see my previous posts: &lt;a href="http://www.adathedev.co.uk/2011/01/gb-post-code-geographic-data-load-to.html"&gt;GB Post Code Geographic Data Load to SQL Server using .NET&lt;/a&gt; and &lt;a href="http://www.adathedev.co.uk/2011/02/os-codepoint-data-geography-load-update.html"&gt;OS CodePoint Data Geography Load Update&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
Aside from a little re-jigging to potentially pave the way to load more Ordnance Survey data files to SQL Server in the future, it now supports importing the 1:50000 Scale Gazetteer data file to SQL Server (available to download from &lt;a href="https://www.ordnancesurvey.co.uk/opendatadownload/products.html"&gt;here&lt;/a&gt;). To quote the Ordnance Survey site:&lt;br /&gt;
&lt;blockquote&gt;The 1:50 000 Scale Gazetteer is a reference tool or location finder, similiar to the index in a road atlas. It can be used as a simple list to find out relevant coordinates and six-figure grid references for a town or area.&lt;/blockquote&gt;At the time of this post this data file contains 259,113 locations taken from the OS Landranger Map series.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example Use&lt;/b&gt;&lt;br /&gt;
To load the 1:50000 scale gazetteer data file that has been downloaded and extracted to C:\OSGazetteerData\50kgaz2010.txt, into dbo.Gazetteer table in MyDatabase on server SQLServerA, and load county codes into table: County and feature codes into table: Feature, run the following from the command prompt:&lt;br /&gt;
&lt;pre class="code"&gt;OSCodePointDataImport.exe GAZETTEER SQLServerA MyDatabase dbo Gazetteer County Feature "C:\OSGazetteerData\50kgaz2010.txt"
&lt;/pre&gt;The Gazetteer database table will consist of the following columns:&lt;br /&gt;
&lt;pre class="code"&gt;SeqNo INTEGER PRIMARY KEY
PlaceName VARCHAR(60)
CountyCode CHAR(2) FK to County.Code
FeatureCode VARCHAR(3) FK to Feature.Code
Longitude FLOAT
Latitude FLOAT
GeoLocation GEOGRAPHY
&lt;/pre&gt;The County lookup table will consist of the following columns:&lt;br /&gt;
&lt;pre class="code"&gt;Code CHAR(2) PRIMARY KEY
Name VARCHAR(60)
&lt;/pre&gt;The Feature lookup table will consist of the following columns:&lt;br /&gt;
&lt;pre class="code"&gt;Code VARCHAR(3) PRIMARY KEY
Description VARCHAR(50)
&lt;/pre&gt;&lt;br /&gt;
The source is on GitHub here: &lt;a href="https://github.com/AdaTheDev/Ordnance-Survey-Code-Point-Data-Importer"&gt;https://github.com/AdaTheDev/Ordnance-Survey-Code-Point-Data-Importer&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=C6Yo-E1LW48:sLZBuyr1pP0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=C6Yo-E1LW48:sLZBuyr1pP0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=C6Yo-E1LW48:sLZBuyr1pP0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=C6Yo-E1LW48:sLZBuyr1pP0:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=C6Yo-E1LW48:sLZBuyr1pP0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=C6Yo-E1LW48:sLZBuyr1pP0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=C6Yo-E1LW48:sLZBuyr1pP0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/C6Yo-E1LW48" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/7490801996327958499/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/03/os-data-importer-supports-scale.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/7490801996327958499?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/7490801996327958499?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/C6Yo-E1LW48/os-data-importer-supports-scale.html" title="OS Data Importer Supports Scale Gazetteer Dataset" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/03/os-data-importer-supports-scale.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8FQ346eip7ImA9WhZTFEk.&quot;"><id>tag:blogger.com,1999:blog-7592516066850632747.post-5454562361611598779</id><published>2011-03-18T10:34:00.001Z</published><updated>2011-03-18T10:40:12.012Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-18T10:40:12.012Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB" /><category scheme="http://www.blogger.com/atom/ns#" term="nosql" /><title>MongoDB Journaling Performance - Single Server Durability</title><content type="html">&lt;div class="post"&gt;&lt;b&gt;Note: Relates to v1.8.0 release.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
v1.8 of MongoDB (production release hot off the press, available from &lt;a href="http://www.mongodb.org/downloads" target="_new"&gt;here&lt;/a&gt;) brings single server durability to MongoDB via its support for write-ahead journaling. The following summarises the key points from the journaling &lt;a href="http://www.mongodb.org/display/DOCS/Journaling" target="_new"&gt;documentation&lt;/a&gt;, &lt;a href="http://www.mongodb.org/display/DOCS/Journaling+Administration+Notes" target="_new"&gt;administration guide&lt;/a&gt; and from my initial playing around.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;you have to specify the --journal switch for mongod in order to enable journaling (was previously --dur prior to production release)&lt;/li&gt;
&lt;li&gt;journal files are created within a journal subfolder of your dbpath, up to 1GB each in size&lt;/li&gt;
&lt;li&gt;in the event of a crash, when mongod restarts it will replay the journal files to recover automatically before the server goes online&lt;/li&gt;
&lt;li&gt;if mongod shuts down cleanly, the journal files are cleared down. Also note that you shouldn't end up with a lot of journal files as they are rotated out as they are no longer needed&lt;/li&gt;
&lt;li&gt;batch commits are performed approximately every 100ms (note the mention in the docs that this will be more frequent in future)&lt;/li&gt;
&lt;li&gt;preallocation of journal files may be done when mongod starts up. If it decides this is worth doing, it will fully provision 3 x 1GB files BEFORE accepting any connections - so there could be a couple of minutes delay after starting up before you can connect. These preallocated files are not cleared down when mongod is shutdown - so it won't have to create them each time.&lt;/li&gt;
&lt;li&gt;when running with journal files on a SATA drive, I found that it chose not to preallocate them. When I set up a junction to map the journal folder onto a separate 15K SAS drive, it did then choose to preallocate the files.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Durability vs. performance - what's the cost?&lt;/b&gt;&lt;br /&gt;
I wanted to get an idea of how much this journaling costs in terms of performance. Obviously there's going to be a hit, I just like to get a rough feel for just how much. So I took a test 295MB CSV data file containing 20 million rows of data with 2 columns: _id (integer) and val (random 5 character string) and loaded into a fresh database, with/without journaling enabled.&lt;br /&gt;
&lt;br /&gt;
Tests were run on a single machine, Intel Xeon W3520 Quad Core, 10GB RAM, Disk 1=7200RPM SATA, Disk 2=15K SAS, Win 7 64Bit. MongoDB data is on Disk 1 (slower but larger disk).&lt;br /&gt;
&lt;br /&gt;
&lt;table class="results"&gt;&lt;tr&gt;&lt;th&gt;Journaling?&lt;/th&gt;&lt;th&gt;Journal location&lt;/th&gt;&lt;th&gt;Files preallocated?&lt;/th&gt;&lt;th&gt;Import time (s)&lt;/th&gt;&lt;th&gt;Avg. Import Rate/s&lt;/th&gt;&lt;th&gt;Performance&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;No&lt;/td&gt;&lt;td&gt;n/a&lt;/td&gt;&lt;td&gt;n/a&lt;/td&gt;&lt;td&gt;291&lt;/td&gt;&lt;td&gt;68729&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Yes&lt;/td&gt;&lt;td&gt;Disk 1 (same as data)&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;td&gt;442&lt;/td&gt;&lt;td&gt;45249&lt;/td&gt;&lt;td&gt;-34%&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Yes&lt;/td&gt;&lt;td&gt;Disk 1 (same as data)&lt;/td&gt;&lt;td&gt;Yes (manually*)&lt;/td&gt;&lt;td&gt;422&lt;/td&gt;&lt;td&gt;47393&lt;/td&gt;&lt;td&gt;-31%&lt;/td&gt; &lt;/tr&gt;
&lt;td&gt;Yes&lt;/td&gt;&lt;td&gt;Disk 2 (separate from data)&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;&lt;td&gt;448&lt;/td&gt;&lt;td&gt;44643&lt;/td&gt;&lt;td&gt;-35%&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
(*) mongod always chose not to preallocate when the journal directory was on the slower disk (same as the data) so I had to manually preallocate the files by copying the ones that were created when the faster disk was used. &lt;br /&gt;
&lt;br /&gt;
I couldn't run the test with the journals on disk 2 without them being preallocated because they were always preallocated and you can't delete them all while mongod is running.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Summing up&lt;/b&gt;&lt;br /&gt;
In my tests, I found:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;using --journal resulted in about a 30-35% drop in throughput for my mongoimport job (just under 70K docs/s down to less than 50K docs/s)&lt;/li&gt;
&lt;li&gt;preallocating of journal files (as you'd expect) helps as it doesn't have to create the files as it's going along&lt;/li&gt;
&lt;li&gt;setting up a junction on Windows to map the journal directory onto a separate (and faster) disk to where the data is resulted in slower performance, presumably due to the overhead of the junction redirects. If there's another/better way of doing this I'd be interested to know. Also I haven't run this on Linux, so maybe there would be less of a hit on that. Personally, I'd like to see support for the journal folder to be explicitly configurable so you can point it at a separate disk.&lt;br /&gt;
&lt;/ul&gt;Based on these results, for me, the decision on whether to use journaling or not would come down to how much I actually need single server durability. Is it critical for my specific use? Could I live without it and just use replica sets? What is the value / importance of it for my data vs. raw performance? 

Let's not forget this is a new feature in MongoDB. As stated in the &lt;a href="http://www.mongodb.org/display/DOCS/Journaling" target="_new"&gt;docs&lt;/a&gt;, there are a number of cases in 1.8.1 for performance improvements with regard to journaling. Definitely something to keep an eye on. &lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=hgRNLmd96MA:pP9yljLeVts:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=hgRNLmd96MA:pP9yljLeVts:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=hgRNLmd96MA:pP9yljLeVts:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=hgRNLmd96MA:pP9yljLeVts:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=hgRNLmd96MA:pP9yljLeVts:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Adathedev?a=hgRNLmd96MA:pP9yljLeVts:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Adathedev?i=hgRNLmd96MA:pP9yljLeVts:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Adathedev/~4/hgRNLmd96MA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.adathedev.co.uk/feeds/5454562361611598779/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.adathedev.co.uk/2011/03/mongodb-journaling-performance-single.html#comment-form" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/5454562361611598779?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7592516066850632747/posts/default/5454562361611598779?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Adathedev/~3/hgRNLmd96MA/mongodb-journaling-performance-single.html" title="MongoDB Journaling Performance - Single Server Durability" /><author><name>Adrian Hills</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="31" src="http://1.bp.blogspot.com/_C_6bW1ZWP-k/TC2jEYbIdRI/AAAAAAAAAR8/oWyC2Ng9UP0/S220/me.jpg" /></author><thr:total>5</thr:total><feedburner:origLink>http://www.adathedev.co.uk/2011/03/mongodb-journaling-performance-single.html</feedburner:origLink></entry></feed>
