Instagram Scales on Python for 2 Billion Daily Users (2024)

Instagram Scales on Python for 2 Billion Daily Users (1)

  • Report this article

Shrey Batra Instagram Scales on Python for 2 Billion Daily Users (2)

Shrey Batra

Founder & CEO @ Cosmocloud | Ex-LinkedIn | Patent for Distributed Algorithm | MongoDB Champion

Published Mar 30, 2022

+ Follow

Instagram, one of the most famous Social Media apps of our time, sharing enormous amount of photos, videos and media content, STILL RUNS ON PYTHON..! Everyone of you might have heard numerous different things about Python -

  • Python is too slow.
  • Python does not scale for millions of API requests
  • It is not concurrent / multi threaded
  • No company uses Python for scale. You can only use JAVA or Golang.

Well, guess what..!! Instagram, one of our favourite social media platform still works on a Monolithic Python's Django codebase..! Obviously, there are so many more services which could be using so many more frameworks and languages, but over here I'll talk about the main Backend Service powering Instagram's App - feed, content, media service.

Instagram's Scale

Instagram had a scale of 95 Million photos and videos uploaded every day, back in 2016.
Printing 2 week's content on paper and putting them side by side, you would actually had reached the moon.! That's back in 2016..!

Now, with that scale, back in 2016, they also had about 4.2 Billion Likes being sent every single day..! Does that blow your mind?

Now, to handle this scale for every single day, Instagram has a scale of 10's of thousands (or even more 100's) of Django Servers running, scattered across the world, fault tolerant and so much more..!

Instagram's History with Django

Instagram started with Django back in 2010 as their go to tech stack. Why? Because it's super easy to setup and took only 2 weeks to start and a couple of months to reach a million users..! A single Django server..!

Only in 2011 Summer, Instagram had about 5M users with all of its data being stored in PostgreSQL and using Django's ORM. As and when Instagram grew, they saw problems with Django's ORM, the complexity of vertical partitioning (available in Django at the time) and so many more things.

They started out with Horizontal Partitioning support in Django, cleaning but multiple ORM transaction support things and so much more.!

You can easily say that Instagram was one of the most advanced users of Django, and also one of the biggest contributer.

The Famous Django Celery Tech Stack

Now, anyone who works in Python's backend may have already used Django and Celery together..! They are an absolute love, and async processing without Celery is just unheard about..!

Celery is one of the best task Scheduler and Executor available in Python which comes out of the box with many many essential features. Plus it with RabbitMQ or Redis, you are good to go with any scale of Async Processing..!

Instagram Scales on Python for 2 Billion Daily Users (3)

Now the reason, why you see this stack in every single Python based product is because this is the original Instagram's Stack which they had used (still use) and you obviously know about Instagram's scale, don't you?

Is Instagram the only company using Python?

Instagram Scales on Python for 2 Billion Daily Users (4)
Have you ever heard to music being played on Spotify? Do you know what powers Spotify's backend APIs? You may get the idea haha.

Recommended next reads

Let’s build an API with Django REST Framework Emmanuel King Kasulani 6 years ago
What is Django? Top 5 websites built with Django BTree Systems 2 years ago
Instagram Scales on Python for 2 Billion Daily Users (8)
Youtube is another classic example of a company who initially were using PHP but soon migrated to Django and Python.
Instagram Scales on Python for 2 Billion Daily Users (9)
Bitbucket, all of you might have used it..! Or Dropbox, or read The Washington Post..! Ever thought that they all are built on Python?

Why Python?

Simple -

  • Fast developer productivity
  • Scalable
  • Ease to ship and maintain
  • Enormous amount of features and libraries

Reading Material

I hope you got the basic essence of this, from a very simplistic view. If you like this article, do Like ❤️, Share 🔁 and Comment 💬 and don't forget to subscribe ✅ to this newsletter..!

Help improve contributions

Mark contributions as unhelpful if you find them irrelevant or not valuable to the article. This feedback is private to you and won’t be shared publicly.

Contribution hidden for you

This feedback is never shared publicly, we’ll use it to show better contributions to everyone.

Instagram Scales on Python for 2 Billion Daily Users (10)

System Design & Architecture

37,115 followers

+ Subscribe

Like
Comment

232

19 Comments

Rohith C H

Engineering @ SAP | Building Next Gen Procurement

2y

  • Report this comment

I recently came across a statement that caught my attention - "Any tech stack will scale if you got deep pockets" . Most startups now prefer getting out there as quickly as possible rather than build the most efficient system using the most efficient tech stack. Django is as quick as it gets. ❤️

Like Reply

1Reaction 2Reactions

Sourav Kumar

Senior Software Engineer@Barco | AWS Certified Developer | Ex-Zomato | Core Engineering at Scale

2y

  • Report this comment
Like Reply

1Reaction 2Reactions

Pratham Krishna

InfraOps@Optiva | AWS Certified Cloud Practitioner | prev Stoa, Gridkey, Accolite & Jio

2y

  • Report this comment

a question: instagram is quite buggy, especially as alot of us scroll through the feed and it’s down often. would having used a different language been better? or is it a problem with their architecture?

Like Reply

1Reaction 2Reactions

Vimox Shah

Over 7+ years Building Robust and Scalable Distributed Systems for Enterprises | Tech Enthusiast and Startup-Minded Software Engineer | Techpreneur

2y

  • Report this comment

Celerymakes it easier to implement the task queues for many workers in a Django app. I like the community support of Django and it has a lot of things in-built which is the one reason for rapid development and the developer likes it.

Like Reply

1Reaction 2Reactions

See more comments

To view or add a comment, sign in

More articles by this author

No more previous content

  • Caching is not always in-memory Mar 4, 2024
  • Live System Design Interview Sessions - S1 Feb 19, 2024
  • Building a 10 min grocery app (with hands-on) Jan 22, 2024
  • The basics of Docker Dec 3, 2023
  • Streaming System Series: Part 1 - Topics, Queues and PubSubs Oct 11, 2023
  • MongoDB Series - Part 4 - Indexing Basics and Types Jul 25, 2023
  • MongoDB Series - Part 3 - MongoDB Aggregations (More than CRUD) Jul 21, 2023
  • Calculating S3 folder storage - The tricky process Jul 13, 2023
  • Shrey's Backend Mentorship Program Jun 19, 2023

No more next content

See all

Sign in

Stay updated on your professional world

Sign in

By clicking Continue, you agree to LinkedIn’s User Agreement, Privacy Policy, and Cookie Policy.

New to LinkedIn? Join now

Insights from the community

  • API Development How do you implement OAuth 2.0 flows in Python with Flask or Django?
  • Software Development How can you optimize Django-based web app performance with stress testing?
  • Web Applications What are the advantages of containerizing a Python web app?
  • Back-End Web Development How do you choose between Node.js and Python for back-end development?
  • Computer Software Training How can you learn Django quickly and effectively with online tutorials?
  • Software Engineering What is the role of WSGI in Flask?
  • Payment Systems How can you make your Payment System scalable with Python?
  • Agile Testing How do you mock external dependencies and services, such as APIs, databases, or email, in your Django tests?
  • Computer Networking How can you optimize server performance for a Python application?
  • System Automation How do you collaborate and share web UI automation code and results with Python?

Others also viewed

  • Introduction to Django 3.0 - Building, Authenticating, and Deploying Ankita Verma 1y
  • What Is Django And Why Is It So Popular? saran preethi 5y
  • Should you learn Flask or Django? Andrea Rabbaglietti 8y
  • Background Tasks in FastAPI Varun S. 2y
  • 15 Years in Flight: Django Stars and the Technologies Driving It Forward Django Stars 6mo
  • The Django Experience Marco Fernandes 4y
  • Django User Model - User Activities Roshan Pandey ‎ 4y
  • Glimpse Of Django Framework ANKIT KUMAR 8y
  • How to Implement Google Recaptcha V3 in Django class view Yiqing Lan 4y

Explore topics

  • Sales
  • Marketing
  • Business Administration
  • HR Management
  • Content Management
  • Engineering
  • Soft Skills
  • See All
Instagram Scales on Python for 2 Billion Daily Users (2024)
Top Articles
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 5641

Rating: 4.3 / 5 (54 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.