Going Deep

Mike Sampson: Inside Rev9

Download this episode

Download Video


A preview version of the new Channel 9 is now available at http://preview.channel9.msdn.com. Please file any bugs or suggestions on Connect.  

Mike Sampson (aka Sampy) has done some stellar work with the backend architecture and design of the next version of Channel 9, code named "Rev9," and this fifth version includes a revamped UI and restructured backend.

In this conversation (it's a long and deep one, so set aside some time—it's well worth it), Sampy takes us through how and why he designed the new Channel 9 architecture. "Rev9" appears to be a very scalable and modern system built on tried and true technologies and architectural patterns such as MVC 2.0, Unity (from P&P), NHibernate, Fluent NHibernate, Memcached, Enyim Managed Memcached driver, Azure – Fabric, Storage, Diagnostics, SQL Azure, xUnit (testing only), Live ID, Spark View Engine, Akismet (spam filtering service), AntiXSS, Tinymce, jQuery, and Silverlight.

Sampy's great work is simply astounding. I left his office feeling more confident than ever that Channel 9 will scale to the future and the experience of performance and reliability will be at an all time high. Thank you, Sampy, Duncan, Cara, Geoff, Clint, and Dan. The revolution is now televised and in full swing.



Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • Ian2

      1.03GB WMV Download - Wow,  'I may be gone sometime...'

    • Charles

      That's for the high res WMV... This is a 72 minute interview. High res = 848x480 with 3mbs+ bit rate.... Download the lesser quality WMV version or the mp4.


    • Ian2

      No worries, wasn't really a criticism - just the largest video that I recall seeing.


      Noticed the Connect option for Channel 9 feedback -  is this preffered over feedback via the forum?

    • Charles

      Yep. For Rev9 bugs and feedback, please use Connect!!

    • Zeus

      I am looking @ the video, and am very interested in the way you are doing this .... are you going to release the source at any time ?

    • Clint

      Bug tracking system for ... you know ... bugs Smiley

    • ruchit

      Are you going to share the QueryFactory design or code here ? Would appreciate if you can post some code on that subject ?


      @Sampy: Is your QueryFactory design only intended to work with NHibernate ?

    • Sampy

      QueryFactory is actually very simple

      namespace Channel9Controller.Infrastructure 
          public class QueryFactory : IQueryFactory 
              private readonly IUnityContainer container; 
              public QueryFactory(IUnityContainer container) 
                  this.container = container; 
              public TQueryType Create<TQueryType>() where TQueryType : IQuery 
                  TQueryType query = container.Resolve<TQueryType>(); 
                   return query; 


      The trick is that every query takes an NHibernate ISession that it uses to do its work. I have that session delivered up by the Unity container so all the Query has to do is specify that it needs ISession by taking one it its constructor and it gets the session for this request. Queries can also take addition parameters if they need. Most don't need any but some need to do operations based on when Now is so they take an IClock which is a simple interface that has a single property Now. I use this instead of DateTime.Now to make things easier to test and to ensure that time is tightly controlled in the application. I even have a specialty clock that returns Now as the most recently passed 5 minute mark (10:00, 10:05, etc). I use this for checking things like Published on an Entry or Banned on a user so that the query will cache better.

    • CKurt
    • Jocuri Hannah Montana

      Very cool...

    • dbones

      awesome work you have done here.

      have you blogged anything you have learned since this... also does any other projects in your office use a simlar approach/architecture?

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.