Simplified DAPP Development
We are very excited to introduce DEMUX – an open-source EOSIO development tool that helps simplify complex DAPP development. Being able to empower decentralized application development for usability, scalability, and flexibility is one of the main benefits of using the EOSIO blockchain platform. Simply put, deterministic off-chain databases that are verified by the EOSIO blockchain.
Demux draws inspiration from Facebook’s Flux Architecture pattern and Redux, creating a back-end infrastructure pattern for sourcing blockchain events in order to deterministically update queryable databases for applications built on the EOSIO blockchain.
This suggested architecture allows application developers to use traditional Mongo or Postgres SQL databases in a way that means the data stored in them is still verifiable by the blockchain. This enables the best of both worlds: the flexibility and speed of traditional databases, coupled with the trust and immutable properties of a blockchain.
Storing and retrieving indexed data is something that developers have commonly utilized for decades. The ability to search, sort, filter, etc. are all easily done in traditional database environments but is something that is missed when working directly with the inherently limited query interface of blockchain nodes.
Complex DAPPs present several problems
When building more complex DAPPs, you run into a few problems when retrieving data directly from the blockchain:
- The query interface used to retrieve the indexed data is limited. Complex data requirements can mean you either have to make an excess number of queries and process the data in your DAPP, or you must store additional sorted data on the blockchain itself.
- Additionally, scaling your query load means requiring more blockchain endpoint nodes, which can be expensive.
How Demux addresses database issues
Demux solves these problems by offloading storage and queries to your preferred database (MongoDB, Postgres, etc). As blockchain events happen, your chosen database is updated by Updater functions, which deterministically process an array of Action objects. The database can then be queried by your front-end DAPP through a suitable API (for example, REST or GraphQL), reducing the amount of direct interaction with the blockchain in order to retrieve data for your application. This also can help developers to limit the amount of data that needs to be stored in RAM, lowering applications’ operating costs whilst also improving their architectural efficiency.
The full details of the release can be viewed on the official GitHub repository. The example library demux-js serves as a reference for NodeJS implementation of Demux architecture.
Developer Relations will continue to bring you updates highlighting the features our development teams at Block.one is working on to improve the developer experience on EOSIO. As always, stay tuned for more updates by following EOSIO on our social channels, and be sure to subscribe to our mailing list on the EOSIO Developer Portal.
Originally Published Here