Is Facebook Replacing Its MySQL Database With Something More ...

Facebook Linkedin Twitter Search Facebook Linkedin Twitter Sign in Welcome! Log into your account your username your password Forgot your password? Get help Privacy Policy Password recovery Recover your password your email A password will be e-mailed to you. Open Source For You Home Audience For U & Me Is Facebook replacing its MySQL database with something more dynamic
  • For U & Me
Facebook

Facebook MySQL database replacement with Apollo

Facebook has always been using MySQL databases ever since its genesis. Most people are curious about the optimisation process that allows the social networking site to support data from over two billion users and yet run smoothly without any snags. In fact, when people talk about scalable databases, the mention of Facebook is almost mandatory. There have been no bigger success stories in the niche of database management and growth in the recent times for sure. Facebook may still be using MySQL database as their core engine, but with changing times, the team led by Mark Zuckerberg is now gradually gravitating towards NoSQL databases like most prominent organisations.

Inclination towards a NoSQL database

Back in 2014, Jeff Johnson, a Facebook representative announced the introduction of Apollo at the QCon New York. It is Facebook’s own version of the Paxos like NoSQL database. This new NoSQL database model is a hierarchical storage system. The stored data in the advanced database is available in fragments, just like in region servers in HBase. However, the unique feature of the new NoSQL model is its online low latency storage system. It is not a document-oriented data system. Apollo is more about data structure modification that will allow the users to modify data structures without much prologue. The individual shards of data are small – between a byte and 1MB. But the total size of the data can reach up to 10+ Petabyte. It can support almost a thousand servers starting from a meager three.

Understanding Apollo

The data stored in the Apollo database is available in the form of tiny fragments. Each of these fragments has four distinct components.

The first part of Apollo is based on Raft. It is a quorum consensus protocol that is a direct derivation of Raft — the robust leader protocol from the house of Stanford. This is unique about the Apollo database system.

The second component in the Apollo database is the storage system inside the database. RocksDB inspires the storage system. It is a Key/Value store built on Google LevelDB. Facebook can easily manipulate it to mimic other data structures including its old MySQL database structure. Notably, Apollo is not very amicable to customisations of storage. As a result, the database management teams of Facebook are working on adding fragments of MySQL database support to their new Apollo database storage system.

The third component is Facebook’s native API. Any database API is a critical component. For Apollo, it is a Client API with read() and write() components. Users need to express their pre-conditions. Apollo returns the values (reads or writes) if the preconditions are correct. You must remember that all data inside the database is in fragments. Therefore, any operation inside the Apollo database at the Shard level is atomic. You can always combine many conditions and reads together to create new operations pre-conditions.

The fourth component is the Fault Tolerant State Machines or FTSMs. These are a part of the system code in Apollo DB. Each shard owns a separate FTSM. Think of it this way, if there is a shard of three different machines, all of them will execute the same code concurrently. It has a huge advantage in the world of large databases. If one code suddenly dies, the other shards keep running the same code in the proper acceptable order, accepted by all nodes.

Although there’s a huge hullaballoo about Apollo being Facebook’s new blue-eyed boy, the news says, Facebook is not using it in production as of now. The company is instead looking forward to replacing some Memcached use cases. Facebook relies heavily on memory cached storage systems, and that is no secret. There are whispers about Apollo becoming the new queuing system for outbound messages from Facebook to iOS devices and carriers via SMS. It is going to be great for analytics. Furthermore, it will boost speed and accuracy of data extraction.

Why is Apollo coming to existence

Facebook uses the state machines mostly for load balancing, shard generation and management, coordinating data transactions across machines and data migrations. However, the process is not perfect enough. These state machines can send RPC requests to the remote servers. In addition to that, whenever users need to make changes to the persistent state of data, they need to go through Raft and get all other servers to agree.

What is Facebook using right now

Apollo is still “under construction.” It is far away from being the daily database for Facebook. Therefore, at present, the social networking giant is using MySQL databases with a lot of modifications and add-ons to facilitate the humongous amounts of data transfer and data storage every day. You cannot expect a multi-billion dollar corporation to use MySQL out-of-the-box! They have induced some changes in the IO Subsystem including new features:

innodb_read_io_threads, innodb_write_io_threads – This sets the number of background IO threads.

innodb_io_capacity – This sets the IO capacity of each server to determine the background IO limits.

innodb_max_merged_io – This one sets the highest number of adjoining IO requests. Usually, the next IO requests merge into a much larger IO request later on.

Unlike Apollo, Facebook is currently relying upon the MySQL database as a key-value store, which enables random distribution of data across an array of logical instances. You can find these across the physical nodes of the server. All the load balancing work of the current server happens at the physical node level only.

The most surprising rumor states that Facebook has about 1,800 MySQL servers and only three in-house DBAs. This seems like quite an impossible task! Well, even if Facebook had just three DBAs to manage the entire dataset, it would never be possible without a MySQL database. It is simple yet powerful, and it will take Facebook or any other similar networking site years to replace the MySQL servers with the new NoSQL servers on a full-time basis.

RELATED ARTICLESMORE FROM AUTHOR

For U & Me

Is Hybrid Reasoning The Next Big Thing In Artificial Intelligence?

For U & Me

Are You Overlooking The Risks Of ‘Open Source AI’?

For U & Me

Demystifying Quantum Computing

LEAVE A REPLY Cancel reply

Please enter your comment! Please enter your name here You have entered an incorrect email address! Please enter your email address here

Save my name, email, and website in this browser for the next time I comment.

Δ

Thought Leaders

India’s Sovereign-AI Push Confronts a Reality Gap

December 1, 2025 Raspberry Pi

Build A Personal LLM System For Your Home

May 13, 2025

Unleashing The Power Of Generative AI Agents With Open Source Software

April 21, 2025

Working with Apache SINGA, the Deep Learning Library

April 11, 2025

The Do’s and Don’ts for Software Architects

March 14, 2025

HOW TOs

Search file and create backup according to creation or modification date

July 12, 2018 LAN and Raw Sockets network cable connect

A Guide to Using Raw Sockets

March 21, 2015 Grep me out!

A Beginner’s Guide To Grep: Basics And Regular Expressions

June 28, 2012

MOST POPULAR

Search file and create backup according to creation or modification date

July 12, 2018 Database Programming

Database Programming in Python

April 10, 2019 LAN and Raw Sockets network cable connect

A Guide to Using Raw Sockets

March 21, 2015

Open Journey

The Do’s and Don’ts for Software Architects

March 14, 2025

Top 7 Open Source Technologies To Learn And Master In 2025

March 12, 2025

The Best Open Source Cloud Management Tools

March 11, 2025

Open Source AI Frameworks: Integrating AI with IoT

February 18, 2025 Azure

IoT Services Offered by Microsoft Azure: An Overview

February 10, 2025

EDITOR PICKS

Shotcut 25.12 Brings Full 10-Bit Video Editing And Linear Colour Processing To Free Open Source Linux, MacOS, And Windows Users

Shotcut 25.12 Unlocks Full 10-Bit Video Editing For Free Open Source...

January 2, 2026 Open Source Ghostty Adopts Non-Profit Funding Model To Safeguard Community-First Terminal Infrastructure

Open Source Ghostty Moves Under Non-Profit Sponsorship

January 2, 2026 Open Source Websites Give More Than They Get As AI Crawlers Surge, Cloudflare Report Shows

Open Source Content Drained By AI Bots While Human Traffic Collapses,...

January 2, 2026

POPULAR POSTS

Search file and create backup according to creation or modification date

July 12, 2018 Database Programming

Database Programming in Python

April 10, 2019 LAN and Raw Sockets network cable connect

A Guide to Using Raw Sockets

March 21, 2015

POPULAR CATEGORY

  • News3534
  • Developers1848
  • Blogs1096
  • OSFY1080
  • For U & Me973
  • Admin757
  • Tools / Apps632
  • How-Tos617
  • Headlines569
ABOUT USOpen Source For You is Asia's leading IT publication focused on open source technologies. Launched in February 2003 (as Linux For You), the magazine/website aims to help techies avail the benefits of open source software and solutions. Techies that connect with the magazine include software developers, IT managers, CIOs, hackers, etc.FOLLOW US Facebook Linkedin Twitter © Open Source For You 2025 MORE STORIES Shotcut 25.12 Brings Full 10-Bit Video Editing And Linear Colour Processing To Free Open Source Linux, MacOS, And Windows Users

Shotcut 25.12 Unlocks Full 10-Bit Video Editing For Free Open Source...

January 2, 2026 Open Source Ghostty Adopts Non-Profit Funding Model To Safeguard Community-First Terminal Infrastructure

Open Source Ghostty Moves Under Non-Profit Sponsorship

January 2, 2026

Tag » What Database Does Facebook Use