Tagged: MVC

StackOverflow featured as Microsoft Case Study

I bumped into this Microsoft Case Study showcasing Stack Overflow site and its ASP.Net MVC based architecture. [link]. The point of interest for me was the infrastructure specs for that site…

# Presentation. Customers browse pages served by Windows Server 2008 Standard, through IIS 7.5. The Web servers are computers with Xeon quad core CPUs and 8 gigabytes (GB) RAM. When a user submits a question or an answer, their information is written to the database using the lightweight LINQ to SQL database abstraction layer.
# Database. The database is hosted on a dedicated server with 2 Intel Xeon quad core CPUs and 48 GB of RAM, and runs Microsoft SQL Server 2008 Enterprise. Stack Overflow takes advantage of the Online Indexing feature, introduced with SQL Server 2008 Enterprise, which enables table re-indexing while the database continues to run.

Look at the number of horses that run that SQL Server backend… 48GB of RAM !!!!!!

Ext JS anyone?

I am playing with Ext JS, a javascript framework that provides a great UI tool set and all things AJAX! I am interested in hearing from anyone who has build real world solutions using Ext JS, anyone?

JSON Serialization and Circular Reference Error !

I have a table that references a child table with reference to parent (!), I am using LINQ to SQL, for a paricular scenario, when I want to serialize my result using Json(obj) in my controller code, I got an error saying.. “A circular reference was detected while serializing an object of type..”

This issue is very well explained by Rick Strahl in his blog (link here)

If we are using WCF services, setting SerializationMode of the data context to “Unidirectional” would do the trick. In my case I was using MVC and it was a controller action invoke from javascript!! Also I did not want to try setting the Access Level to internal because I was not sure whether I get deep serialization if I do that! (did not try, because I was half convinced that It may not work for me)

Issue was Json() call in my controller to convert my object to Json and send back as JsonResult… So I ended up serializing it in my biz layer, biz layer method now returned a Json String, changed my controller to return ActionResult/ContentResult and used Content(jsonString) to send back a ContentResult.

It worked because Javascript library expected a Json Literal and it got that. All is good for now!