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

Mria: An Eventually Consistent Mnesia

Published:31 August 2023Publication 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. Google ScholarGoogle Scholar
  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]. Google ScholarGoogle Scholar
  3. Andrew Banks, Ed Briggs, Ken Borgendale, and Rahul Gupta. Mqtt version 5.0. Technical report, OASIS Open, March 2019. Google ScholarGoogle Scholar
  4. Biswajeeban Mishra and Attila Kertesz. The use of mqtt in m2m and iot systems: A survey. IEEE Access, 8:201071–201086, 2020. Google ScholarGoogle ScholarCross RefCross Ref
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle Scholar
  7. Mria: Asynchronously replicated Mnesia-like database for Erlang/Elixir . https://github.com/emqx/mria/, 2023. [Online; accessed 26-5-2023]. Google ScholarGoogle Scholar
  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]. Google ScholarGoogle Scholar
  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. Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Parosh Abdulla, Stavros Aronis, Bengt Jonsson, and Konstantinos Sagonas. Optimal dynamic partial order reduction. ACM SIGPLAN Notices, 49(1):373–384, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. snabbkaffe: Distributed trace-based test framework with fault injection . https://github.com/kafka4beam/snabbkaffe/, 2023. [Online; accessed 26-5-2023]. Google ScholarGoogle Scholar
  13. Axiomatic abstraction of container . https://github.com/libtx/Storage/blob/main/theories/Storage/Properties.v, 2023. [Online; accessed 26-5-2023]. Google ScholarGoogle Scholar
  14. emqtt-bench: Lightweight MQTT benchmark tool written in Erlang . https://github.com/emqx/emqtt-bench/, 2023. [Online; accessed 26-5-2023]. Google ScholarGoogle Scholar

Index Terms

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

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in
            • 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

              Copyright © 2023 ACM

              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].

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 31 August 2023

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article

              Acceptance Rates

              Overall Acceptance Rate51of68submissions,75%

              Upcoming Conference

              ICFP '24
            • Article Metrics

              • Downloads (Last 12 months)51
              • Downloads (Last 6 weeks)11

              Other Metrics

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader