Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Architecture of Stack Overflow - QCon Japan...

The Architecture of Stack Overflow - QCon Japan 2014

Slides for the Architecture of Stack Overflow talk at QCon Japan 2014

Marco Cecconi

April 30, 2014
Tweet

More Decks by Marco Cecconi

Other Decks in Programming

Transcript

  1. #48 network for traffic* …and #17 in Japan! *source: Quantcast,

    Alexa much successful very traffic ありがとう wow
  2. web servers load balancers redis search database http(s) http rest

    http protobuf sql sql protobuf tag engine
  3. Network Level Caches (CDN, etc.) Server Level Cache (HttpRuntime.Cache) Site

    Level Cache (Redis) SQL Server Database Cache (384 gigs of RAM!) Solid State Disk
  4. Too Many Allocations This is really the most basic thing

    that can go wrong. Too Many Pointers If you create a data structure that is a large mesh of pointers you'll have two problems. First, there will be a lot of object writes […] and, secondly, when it comes time to collect that data structure, you will make the garbage collector follow all those pointers and if necessary change them all as things move around. […] But if you create such a structure on a transitory basis, […], then you will pay the cost much more often. http://msdn.microsoft.com/en-us/library/ms973837.aspx#dotnetgcbasics_topic2
  5. Too Many Allocations This is really the most basic thing

    that can go wrong. Too Many Pointers If you create a data structure that is a large mesh of pointers you'll have two problems. First, there will be a lot of object writes […] and, secondly, when it comes time to collect that data structure, you will make the garbage collector follow all those pointers and if necessary change them all as things move around. […] But if you create such a structure on a transitory basis, […], then you will pay the cost much more often. http://msdn.microsoft.com/en-us/library/ms973837.aspx#dotnetgcbasics_topic2
  6. Too Many Allocations This is really the most basic thing

    that can go wrong. Too Many Pointers If you create a data structure that is a large mesh of pointers you'll have two problems. First, there will be a lot of object writes […] and, secondly, when it comes time to collect that data structure, you will make the garbage collector follow all those pointers and if necessary change them all as things move around. […] But if you create such a structure on a transitory basis, […], then you will pay the cost much more often. http://msdn.microsoft.com/en-us/library/ms973837.aspx#dotnetgcbasics_topic2
  7. Too Many Allocations This is really the most basic thing

    that can go wrong. Too Many Pointers If you create a data structure that is a large mesh of pointers you'll have two problems. First, there will be a lot of object writes […] and, secondly, when it comes time to collect that data structure, you will make the garbage collector follow all those pointers and if necessary change them all as things move around. […] But if you create such a structure on a transitory basis, […], then you will pay the cost much more often. http://msdn.microsoft.com/en-us/library/ms973837.aspx#dotnetgcbasics_topic2
  8. ...this is what you are actually doing! IRepository<Order> repository =

    new ValidatingOrderRepository ( new SecurityRepository<Order> ( new LoggingRepository<Order> ( new CachingRepository<Order> ( new NHibernateRepository<Order> () ) ) ) ); Order order = repository.Get(35);
  9. Few projects :-) Few lines of code :-) Awesome community

    to help :-D Eeek! very few tests :-S
  10. • Performance is a feature • Always. Be. Shipping. •

    Use your circumstances. • Open source your libraries • 3 obscenely big monitors. CONCLUSION