StackOverflow Architechture

Caching

  • One is at Browser/Client level by caching images, javascripts,etc until their TTL(Time to live).
  • At Load balancer level, load balancer serves cached requests instead of making another query to the webserver behind it. This caching results in improved response times for those requests and less load on the webserver.
  • Via Redis, Redis Server caches data in-memory rather than frequent database hits. This caching is made highly consistent such that all data is in-memory & thus reducing database footprint. In-memory caching saves 10x time compared to databse hits .
  • At database level, Sql Server also provides a level of internal caching to avoid frequent disk calls
  • Using Elastic Search, which is an index server that powers quick searching. 90% of the queries are read only. This is the Read only server of Stackoverflow that help render pageviews real quick.

Scale Up

StackOverflow ensures High Availability on all its services by maintaining layers of redundancy. There has been centuries old debate regarding whether to scale up or scale out.

  • How much Redundancy do we need?
  • Do we actually need to Scale Out?
  • How much disk storage will be used?
  • SSDs or Disk Drives
  • How much Memory ?
  • Memory intensive application?
  • Parallel usage?
  • What CPU?
  • Cores based on parallelism
  • Network, whats the transaction rate?
  • How much Redundancy do we need?

Shared Nothing Architechture

Another factor of StackOverflow’s performance is its Shared Nothing Architechture.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Saurabh

Saurabh

1 Follower

Leading all phases of diverse Technology Products with hands-on technical edge. https://www.linkedin.com/in/100rabhnigam/