Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3609022.3609416acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Mria: An Eventually Consistent Mnesia

Published: 31 August 2023 Publication History

Abstract

Mnesia, an Erlang distributed database, serves as an embedded storage and replication layer for OTP applications requiring low read latency and high availability. EMQX is a publish-subscribe message broker supporting the MQTT protocol that uses Mnesia to replicate its internal state across the cluster. We analyze the limitations of Mnesia's replication protocol scalability in large clusters under high load. To address these limitations, we developed Mria, an extension to the Mnesia database that provides eventual consistency within a cluster and achieves better horizontal scalability. We validated Mria using a variety of testing techniques, including model checking, chaos engineering, and formal verification. Replacing Mnesia with Mria allowed us to scale the EMQX cluster to 23 nodes, handle 100 million simultaneous client sessions and achieve a higher sustained load.

References

[1]
Håkan Mattsson, Hans Nilsson, and Claes Wikström. Mnesia—a distributed robust dbms for telecommunications applications. In Practical Aspects of Declarative Languages: First International Workshop, PADL’99 San Antonio, Texas, USA, January 18–19, 1999 Proceedings 1, pages 152–163. Springer, 1998.
[2]
EMQX: The most scalable open-source MQTT broker for IoT, IIoT, and connected vehicles . https://github.com/emqx/emqx/, 2023. [Online; accessed 26-5-2023].
[3]
Andrew Banks, Ed Briggs, Ken Borgendale, and Rahul Gupta. Mqtt version 5.0. Technical report, OASIS Open, March 2019.
[4]
Biswajeeban Mishra and Attila Kertesz. The use of mqtt in m2m and iot systems: A survey. IEEE Access, 8:201071–201086, 2020.
[5]
Eric C Cooper. Analysis of distributed commit protocols. In Proceedings of the 1982 ACM SIGMOD international conference on Management of data, pages 175–183, 1982.
[6]
Leslie Lamport. Time, Clocks, and the Ordering of Events in a Distributed System, page 179–196. Association for Computing Machinery, New York, NY, USA, 2019.
[7]
Mria: Asynchronously replicated Mnesia-like database for Erlang/Elixir . https://github.com/emqx/mria/, 2023. [Online; accessed 26-5-2023].
[8]
Mnesia source code . https://github.com/erlang/otp/blob/maint-25/lib/mnesia/src/mnesia_tm.erl#L2130, 2023. [Online; accessed 26-5-2023].
[9]
Diego Ongaro and John Ousterhout. In search of an understandable consensus algorithm (extended version). In Proceeding of USENIX annual technical conference, USENIX ATC, pages 19–20, 2014.
[10]
Alkis Gotovos, Maria Christakis, and Konstantinos Sagonas. Test-driven development of concurrent programs using concuerror. In Proceedings of the 10th ACM SIGPLAN Workshop on Erlang, pages 51–61, 2011.
[11]
Parosh Abdulla, Stavros Aronis, Bengt Jonsson, and Konstantinos Sagonas. Optimal dynamic partial order reduction. ACM SIGPLAN Notices, 49(1):373–384, 2014.
[12]
snabbkaffe: Distributed trace-based test framework with fault injection . https://github.com/kafka4beam/snabbkaffe/, 2023. [Online; accessed 26-5-2023].
[13]
Axiomatic abstraction of container . https://github.com/libtx/Storage/blob/main/theories/Storage/Properties.v, 2023. [Online; accessed 26-5-2023].
[14]
emqtt-bench: Lightweight MQTT benchmark tool written in Erlang . https://github.com/emqx/emqtt-bench/, 2023. [Online; accessed 26-5-2023].

Index Terms

  1. Mria: An Eventually Consistent Mnesia
    Index terms have been assigned to the content through auto-classification.

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    Erlang 2023: Proceedings of the 22nd ACM SIGPLAN International Workshop on Erlang
    August 2023
    38 pages
    ISBN:9798400702945
    DOI:10.1145/3609022
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 31 August 2023

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tag

    1. Information systems~DBMS engine architectures

    Qualifiers

    • Research-article

    Conference

    Erlang '23
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 51 of 68 submissions, 75%

    Upcoming Conference

    ICFP '25
    ACM SIGPLAN International Conference on Functional Programming
    October 12 - 18, 2025
    Singapore , Singapore

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 57
      Total Downloads
    • Downloads (Last 12 months)27
    • Downloads (Last 6 weeks)2
    Reflects downloads up to 22 Nov 2024

    Other Metrics

    Citations

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media