r/programming • u/nickcraver • Feb 17 '16
Stack Overflow: The Architecture - 2016 Edition
http://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/
1.7k
Upvotes
r/programming • u/nickcraver • Feb 17 '16
54
u/[deleted] Feb 17 '16
Starry eyes.
67
u/SikhGamer Feb 17 '16
I said it last time, I'll say it again.
This is straight up dirty filthy porn. I fucking love it.
Thanks for putting together this post mate.
12
u/gambit700 Feb 18 '16
Great post, but I can't wait to read this one
520
u/orr94 Feb 17 '16
10
u/For_Iconoclasm Feb 17 '16
Do you share the TLS session cache between your load balancers? If not, doesn't the browser need to re-negotiate if it hits the other load balancer with its next request? Solutions that I've found for that problem seem a little complicated, so I'm wondering how you handle it.
21
u/908 Feb 17 '16
have been wondering how the programming language gets chosen - why is this thing running on asp net
does it depend on the nature of the sites funcionality ( sharing dog photos versus online casino etc )
is it usually because its a language that the founders know
18
u/artbristol Feb 17 '16
The post should be required reading for everyone starting a new project.
What I take from it is that vertical scaling (more powerful boxes) can get you a staggering amount of scale, and that almost every web application tier can run on a single box of sufficient power. You generally only need multiple boxes for availability.
54
u/deal-with-it- Feb 17 '16
I am a Windows guy but I still cant believe they can run StackOverflow and others off a single IIS instance.
3
u/qlaucode Feb 17 '16
Nice post. Can't wait to read more. Are there any plans to change from MVC 5 to MVC 6 (or Core or whatever new name they come up with)? Is it still too new to even consider, or are you happy with where you're at with the framework?
3
u/beginner_ Feb 18 '16
My conclusion is as I always say in NoSQL vs Relational DB threads: Performance and horizontal scaling is not a reason to go NoSQL. I usually used Wikipedia as an example but this is just as good. If these huge websites can run on SQL Server, your new pet project for sure can do it too. And as we can see vertical scaling gets you very far using modern server tech (lots of RAM pcie-ssds, 2x12 cores).
2
u/CloudEngineer Feb 18 '16
Is there a "Systems Engineering" subreddit?
Heck I think even the folks at /r/aws might appreciate it. This is freaking awesome.
2
u/sveiss Feb 18 '16
Thank you for sharing this -- your posts on the SO architecture are always worth reading. It's fun to see the differences (Windows, .NET, SQL Server vs Linux, Rails, MySQL) and similarities (HAProxy, Elasticsearch, Redis) with the stack I work on.
I'm also rather jealous of your neat racks and control of your network hardware. Yes, SoftLayer had a network blip again today...
45
u/NotInVan Feb 17 '16
Oops? Good it worked, though!
11
u/[deleted] Feb 17 '16
I wonder how many man hours they spent on this setup and how much it would cost in AWS. Pretty sure they would save money especially since they can have their servers scale instead of having so much power on standby.
26
u/[deleted] Feb 17 '16
Stack Overflow is the 55th ranked website on Alexa which surprised me at first, but it makes so much sense. It's such an amazing resource
165
u/[deleted] Feb 17 '16 edited Feb 17 '16
MFW reddit shits on asp.net/MS, in favour of the latest esoteric hipster tech, yet this shows just how solid and scalable it is.
6
u/[deleted] Feb 18 '16
I feel so inadequate!
Great read, thanks.
44
u/[deleted] Feb 17 '16
Wait, no cloud, Python, Node.js, Hadoop, AngularJS, Docker & bash?
That could never possibly work. Oh wait.
[Sarcasm mode off]
4
u/damnitbob Feb 18 '16
This is brilliant, I never thought about having redundant ISPs. Internet's a bit spotty, I'll just switch over.
1
u/pdbatwork Feb 17 '16 edited Feb 17 '16
and
Am I reading this wrong or are you suggesting we had a 168 hours long day February 9th?
I can't really read anywhere what these 168 hours covers?
EDIT: OK, now I feel stupid. 4 minutes and 5 people suggests it CPUhours.
1
u/keypusher Feb 18 '16 edited Feb 18 '16
I do wonder if Joel was a large influence for running primarily on a Microsoft stack. Not that there is anything wrong with the choice, it's just surprising for a site that is so much a part of the tech ecosystem when all the other architectures I see for Google, Amazon, startups, etc are running primarily on open source.
1
u/[deleted] Feb 18 '16 edited Feb 18 '16
What is your take on vnext / dnx core ? Any plans to migrate to linux ?
Also, I was looking at the websocket lib. It could use some document and comment love. Looked like a great solution that I couldent extend, as is.
1
u/shinysony Feb 18 '16
What's the benefit of moving sql out of stored procedures and into the application?
1
u/titoonster Feb 18 '16
Hey Nick, amazing as always.
Can you elaborate any more on this trick?
So is the trick that you are taking the rowversion is actually treating it a sequence? I thought it was a binary hash. Are you saying it's a binary sequence and you store that in Elastic?
3
u/hansmosh Feb 18 '16
What's the next most popular Stack Exchange site after Stack Overflow?
2
u/changingminds Feb 17 '16
I kind of have an idea what most of the stuff in their stack does, but I don't have any experience working with these.
Exactly what bits are needed strictly to deal with the massive traffic?
Like, I'm pretty sure I can spin up a pathetic but working stackoverflow clone and I wouldn't need to use most of the stuff mentioned in the post. What all among the stack is used solely to expand a bare bones stackoverflow website to be able to handle hundreds of thousands of concurrent sockets?
2
u/eigenman Feb 17 '16
Questions about Dapper. First why the need for yet another ORM model? I read the GIT Hub description dapper-dot-net and it seems performance is the best attribute. However, I'm a bit concerned about all the inline SQL strings in code. First: Is that a security issue? Second: Is there a Lambda Function method of querying the Dapper ORM? I like the idea of ORMs for SQL server that perform well. Just want to see what people think about Dapper before going deeper.
2
u/makonde Feb 18 '16
Whats the SQL Server license cost for that many CPUs I wonder.
9
u/frugalmail Feb 17 '16
It's refreshing to see .NET folks who know what the F*ck they are doing, it seems to be such a rarity.
Lucky for you folks there aren't many servers for one person to manage easily. Windows still sucks to manage, even though they are doing their best to catch up to Linux/BSD maintainability.
1
u/[deleted] Feb 18 '16
It's always interesting to see another website in the 50mil+ hits per month club. Keep up the good work
0
u/[deleted] Feb 17 '16
StackExchange.Redis + Protobuf-net + F# is a fun time for your L1/L2 caching needs.
You will need to explicitly call the implicit operators in StackExchange.Redis though, which is hilarious. This little operator overloader makes it less annoying: