News.EOS.WiKi Bilingual News & Info Of EOS

引进EOSIO区块链链下验证的解复用确定性数据库/Introducing Demux — Deterministic Databases Off-Chain Verified by the EOSIO Blockchain

译文/Translated:

EOSIO区块链平台主要优势之一是为有用、可扩展且灵活的分散型应用赋权。为此,Block.one很高兴宣布EOSIO社区新型开放源代码开发工具Demux,Demux简化了复杂的DAPP开发。

Demux受到Facebook的Flux构架模式和Redux的启发,创造了获得区块链事件的后端基础设施模式,以便为EOSIO区块链上构建的应用确切地更新可查询数据库。

该建议性构架允许应用开发人员在使用传统Mongo或Postgres SQL数据库时,让数据储存在库中,但仍可被区块链验证。这样就可以实现两全其美:获得传统数据的灵活性和速度,同时伴有区块链的信赖和不可变属性。

储存和检索索引数据是开发人员数十年来共同使用的功能。搜索、分类、筛选等功能在传统数据库环境中能轻易完成,但却是直接使用区块链节点固有的有限查询界面时所缺少的功能。

在构建更加复杂的DAPP时,直接从区块链检索数据会遇到几个问题:

  1. 用以检索索引数据的查询界面有限。复杂的数据要求可能意味着您必须在DAPP中进行多次查询并处理数据,或者您必须将附加的分类数据储存在区块链自身身上。
  2. 此外,扩展查询负载意味着需要更多区块链端点节点,花费昂贵。

Demux将储存和查询卸载到您选择的数据库中(MongoDB,Postgres等),以解决这些问题。区块链事件发生时,更新器涵式会更新您所选择的数据库,确切地处理大量的操作对象。而后,前端DAPP通过适合的API(例如,REST或GraphQL)可访问数据库,降低与区块链直接互动量,以便为应用程序检索数据。这同样可以帮助开发人员限制需要存储在RAM的数据量,在提升建筑效率的同时降低应用的运行成本。

可在官方Github资源库中查看该版本完整详情。示例库 demux-js 作为Demux构架NodeJS执行的参考。

开发者关系团队(Developer Relations)将为您持续更新,为您重点介绍Block.one的开发团队为优化EOSIO开发者体验,正努力研发的功能。请在社交渠道持续关注EOSIO,继续关注更多更新内容,请在EOSIO开发者门户订阅我们的邮件清单。

谢谢,

Block.one开发者关系团队

原文/Original:

One of the primary advantages of the EOSIO blockchain platform is in empowering the development of usable, scalable, and flexible decentralized applications. To that end, we at Block.one are excited to announce Demux, a new open-source development tool for the EOSIO community that simplifies complex DAPP development.

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.

When building more complex DAPPs, you run into a few problems when retrieving data directly from the blockchain:

  1. 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.
  2. Additionally, scaling your query load means requiring more blockchain endpoint nodes, which can be expensive.

Demux solves these problems by off-loading 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 NodeJS implementation of Demux architecture.

Developer Relations will continue to bring you updates highlighting the features our development teams at Block.one are 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.

Thanks,
Block.one Developer Relations

Read disclaimer

原文链接/Original URL:

https://medium.com/eosio/introducing-demux-deterministic-databases-off-chain-verified-by-the-eosio-blockchain-bd860c49b017

About the author

By user
News.EOS.WiKi Bilingual News & Info Of EOS

Recent Posts