Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1LjPgnq.
David Fullerton shares some of the things the Stack Exchange tech team have learned along the way while scaling one of the top sites in the world primarily through vertical scaling. Filmed at qconnewyork.com.
David Fullerton is the developer-turned-manager responsible for all software development and system administration at Stack Exchange. David joined Stack Exchange, Inc. from Fog Creek Software, where he worked briefly as the developer lead for Stack Exchange 1.0 and as a developer on the FogBugz team. He has a B.A. in Computer Science from Dartmouth College.
2. InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/stack-exchange
3. Presented at QCon New York
www.qconnewyork.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
27. 25
Step 1: Start with what we know
• Original developers knew C# and MSSQL
• Started with a bunch of off-the-shelf tools:
– ASP.NET MVC
– LINQ to SQL
– MSSQL + SQL fulltext search
– Built-in caching (no Redis)
28. 26
Step 2: Measure it live
• Performance is a feature!
• Test under real load
• Measure, don’t guess
33. 31
Step 3: Fix the slow
• Slow performance is a bug, fix it now!
• Over time, replace major parts of our stack:
– Caching and Redis
– SQL access
– Tag Engine
– Elasticsearch
42. 40
Tag Engine
• Highly custom in-memory tag index cache
• Carefully memory-managed to avoid GC stalls
– Learned the hard way: see “Assault by GC” by
Marc Gravell
• Serialize / deserialize from disk on build
44. 42
Results
1. Start with what we know
2. Measure it live
3. Fix the slow
Optimize for performance,
get scale thrown in
45. 43
Results
• “Monolith Plus” architecture
• Extract services that solve real problems, not
imagined ones
• Avoid SOA “tax”
46. 44
So my primary guideline would be don’t even
consider microservices unless you have a
system that’s too complex to manage as a
monolith
- Martin Fowler, “MicroservicePremium”
48. 46
Conclusions
1. Our architecture is boring
2. How we keep it boring is interesting:
1. Start with what we know
2. Measure it live
3. Fix the slow
49. 47
Application
• You can optimize for performance and get scale
thrown in (almost for free)
• Your monolith can scale further than you think
• SOA is not the only way
– Know your own problem space
– Fix actual problems
50. 48
Questions?
(We’re all about questions)
Obligatory:
• We’re hiring! stackexchange.com/work-here
• Open source! stackexchange.github.io
• Follow me! twitter.com/df07
55. 53
StackExchange.Redis
• Wrote our own library for talking to Redis
• Multiplexing operations over a single connection
• Aware of primary / secondary instances
– Can target reads at secondary slave