Sunday, April 14, 2013

Software and scalability: It is all a numbers game.

A fascinating talk by Martin Thompson on making scalable software:

It's all a numbers game -- the dirty little secret of scalable systems by Martin Thompson




My highlights from the talk...

At a high level:
  • Be simple
  • Share Nothing Architecture
  • Profile the code once a week.
  • Separate reads from writes
  • Know the platform
  • Use cache oblivious algorithms
From a pattern perspective:
  • Use the "Single Writer Principle": Any item of data, or resource, is only mutated by a single writer/thread.  It is OK if multiple threads, or other execution contexts, read the same data. CPUs can broadcast read only copies of data to other cores via the cache coherency sub-system. This has a cost but it scales very well.
  • Disruptor vs queues: See the LMAX project on GitHub (http://lmax-exchange.github.io/disruptor/). Associated technical paper http://disruptor.googlecode.com/files/Disruptor-1.0.pdf.
  • The "Curse of Logging": Most common Java Logging libraries take way too many CPU cycles from the application (Log4j, JUL, Logback, etc.). 
  • Command Query Responsibility Segregation (CQRS):  Split the conceptual model into separate models for update and display.  This refers to as Command and Query respectively following the vocabulary of CommandQuerySeparation
Read Martin's blog.

No comments:

Post a Comment