Archive for February, 2010

Doing .NET Days Day 2

February 13th, 2010

downloadDoing .NET Days Day 2 has been confirmed and locked in for the 6th of March and Registrations are open. Simon has the details on the need for moving the date.  A seat can be reserved by via email on the Doing .net Days page. Remember seats are fairly limited so if you wish to attend don’t put it off if you can help it.

The topics covered this time around are ‘Helping the Entity Framework play its <ROLE>’, looking at ways of using behavioural roles defined by interfaces in your system to be explicit and achieve high performance results, finer grained separation of concerns and greater configurability between your Domain Model and infrastructure. The second topic will be a practical look at getting started with NServiceBus, including demonstrations taking in messaging patterns such as Publish / Subscribe and full duplex.

Developing a sense of Scalability

February 6th, 2010

Scott Hanselman’s recent post about exporting data from a database to a csv file where he talks about how some code could be improved. He does a very nice job of showing how and were the code could remove the smells that were present in the original design. However there are a few things that I see that if changed could improve both the performance and scalability of the system.

While this is something that depending on the complexity and scalability needs of your site one may consider over kill, it is something that takes minimal effort in design to create a system that is innately more scalable. What happens when the data you are querying starts to push out is 5-10Mb of Data to a CSV file?

Option 1

So rather than generate the list of Foo into a CSV at each request why not pre generate the list at pre configured intervals depending on the volatility of the data and save the resultant CSV to a san that can be served up via IIS. In this scenario there is no need for the ASP.NET worker process to get involved and the IIS process can do what it was meant to do serve content.

Pregenerated file system

Advantages

  • No need to hit the DB to get the data
  • You don’t have to involve the asp.net worker process and let IIS do what its designed to do

Disadvantages

  • Your data may be stale up to a preconfigured amount of time (but since its going to a report of sorts it is more than likely stale)

Option 2

So your business requirement absolutely dictates that it is required to be generated and sent as the user requests it. There is no choice, you have but to send it through the response stream. BUT there is another way. Say when this request for the data to be exported VIA an AJAX call to your server the response from the server is a URL to where the file will be output. Now the server it self can then send a message to the export to csv service and request the file be output to the san. The client can then poll the server waiting for a 200 response code, when it does get one it can then redirect the browser to the given URL.

polling file system

Advantages

  • Gives you more or less up to the minute accurate data
  • Reduces the amount of work the asp.net worker process has to perform

Disadvantages

  • Introduces polling into the design of the client

When designing systems that do not take Scalability into account from the ground up, you generally are missing something. Considering Scalability does not mean that you choose either of these two options all the time. At times it might make sense to think about using the approach suggested in Scott’s article, the key being to always think about know your data and make informed decisions.

Doing Advanced Distributed Systems Design – A Gift from Santa

February 4th, 2010

It is the second time I have sat through Udi’s Advanced Distributed Systems Design. Unlike repeating a course at University, I was like a 6 year old waiting for Santa Claus to arrive with his presents at Christmas. Not only has the course content been refined in some sections, CQRS (In case you missed it you can watch Udi’s presentation on CQRS here) for instance. Udi’s delivery of the material is such that he always has you yearning for more. The first time i did this course it was as though someone had opened my minds eye. Since then I have made so many changes to my thinking and the way I approach development.

My reasons for attending the course again were simple

  1. Gauge my progression
  2. Hear other peoples thoughts and opinions
  3. Spend more time at the feet of the master
  4. And of course Learn some more

The beauty of this course is that despite the complexity of the architecture and the concepts the delivery makes the comprehension a breeze.  Paul Batum and Rhys Campbell who attended the course have written up their impressions, as has Simon and we all agree that it is worth its weight in gold. So if you have thought about ever doing this course and can make it to one do so, but if your not able to go to one of upcoming courses I would strongly suggest getting in touch with Udi and working other possible solutions with him. Which is why I guess Simon is owed big thanks for setting up this opportunity.

As for NServiceBus and its comparisons to Nuclear Armament, I can only say that once you have used it, there is a realization that there is great power that can be wielded without any effort. Till you can try it for yourself see what twitter has to say about NServiceBus. For me the next dose of sharing some NServiceBus love will be at Day 2 of Doing .net Days on the 27th February 2010 if you have nothing on that Saturday why not send an email to register a seat before they run out