Mike Sampson: Inside Rev9

Sign in to queue

Description

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.

Embed

Download

Download this episode

The Discussion

  • User profile image
    Ian2

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

  • User profile image
    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.

    C

  • User profile image
    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?

  • User profile image
    Charles

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

  • User profile image
    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 ?

  • User profile image
    Clint

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

  • User profile image
    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 ?

  • User profile image
    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>(); 
                query.EnableCaching(); 
                 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.

  • User profile image
    CKurt
  • User profile image
    Jocuri Hannah Montana

    Very cool...

  • User profile image
    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?

Add Your 2 Cents