educative.io

Why we used Mnesia database in whatsapp design?

Why are we using Mnesia db any specific benefit of it? can’t we use any other db, if we can then please name the few other db which we can use instead of Mnesia


Course: Grokking Modern System Design Interview for Engineers & Managers - Learn Interactively
Lesson: Requirements of WhatsApp’s Design

1 Like

Hi @Ravish_Aanand_4-Yr_B

Thank You for reaching out to the Educative team.

Regarding your query, Mnesia is mentioned as part of the building blocks for designing WhatsApp, but it’s important to note that the choice of a specific database system depends on various factors, and alternatives can be considered based on the specific requirements and characteristics of the application. Mnesia is a distributed, real-time, fault-tolerant database management system built into the Erlang programming language, which is known for its concurrency support and fault tolerance.

Mnesia may be used in this situation since it can handle distributed, real-time data with little latency, which is in line with WhatsApp Messenger’s functional requirements. However, depending on the particular requirements of the application, alternative databases could be taken into consideration. Other databases that could be taken into consideration include as follows:

  • MySQL or PostgreSQL:
    May have limitations in terms of distributed and real-time capabilities compared to some NoSQL databases.

  • MongoDB:
    While MongoDB is scalable, it may not be as optimized for real-time distributed scenarios as specialized databases.

  • Cassandra:
    Well-suited for scenarios with high write throughput and scalability requirements.

  • Redis:
    May not be suitable for all types of data and may not provide the same query capabilities as relational databases.

I hope it helps. Happy Learning :blush:

Hi @Khadija_Sohail
Could you please give me more information about the database schema in mnesia?