A Reference Architecture for Blockchain-based Traceability Systems Using Domain-Driven Design and Microservices

Yanze Wang, Shanshan Li, Huikun Liu, He Zhang, Bo PanarXiv 2023 · DOI · arXiv

TL;DR

This paper proposes a new reference architecture for blockchain-based traceability systems (BTS) that solves the "complexity vs. performance" bottleneck. By combining Domain-Driven Design (DDD) and Microservices with a multi-chain blockchain structure, the authors created a system that is highly extensible, easier to maintain, and capable of handling high-volume supply chain data without the typical performance lag of a single-chain ledger.

What Problem Does This Paper Address?

Global supply chains are massive and prone to crises, like food safety scandals. While blockchain is a natural fit for traceability because it provides an immutable, transparent record, implementing it at scale is a nightmare.

The authors identify three primary hurdles:

  1. Complexity: Business processes in supply chains are broad and frequently change. Updating a monolithic blockchain system is difficult and error-prone.
  2. Data Overload: Storing every piece of business data on a single blockchain leads to performance degradation and massive storage overhead.
  3. Centralization Risks: Traditional systems often rely on centralized databases that are easy to manipulate and represent a single point of failure.

Methods

The authors propose a layered reference architecture that moves away from the "one-size-fits-all" blockchain approach. Their method relies on three pillars:

  • Domain-Driven Design (DDD): They use DDD to break the complex supply chain into "Bounded Contexts." Instead of one giant system, they identified six distinct domains: User Authority, Enterprise Record, Warehousing, Inventory, Supervision, and Traceability.
  • Microservices Architecture (MSA): Each domain is implemented as an independent microservice. This allows developers to update the "Warehousing" logic without touching the "User Authority" code, greatly improving system agility.
  • Master-Slave Multi-Chain Network: This is the core technical innovation. Rather than one blockchain, they use a Main Chain to store metadata and indexes, and six specialized Sub-Chains (one for each domain). Transactions are processed in parallel across these sub-chains, preventing bottlenecks.
  • Hybrid Storage: To keep the blockchain lean, they use IPFS (InterPlanetary File System) for large documents like certificates and a relational database for non-critical data, only storing hashes on-chain.

Datasets

The researchers did not use a standard public dataset. Instead, they collaborated with a blockchain research institute in China to import real-world data from a salmon supply chain scenario. This included tracking imported Norwegian salmon through various stages of the supply chain, involving over 5,000 enterprises.

Key Insights and Ideas

  • Sharding by Business Logic: The most significant "aha moment" is applying the concept of sharding not just to data, but to business domains. By giving each domain its own sub-chain, the system achieves natural load balancing.
  • The "Anti-Corrosion" Layer: In their DDD implementation, they utilized an anti-corrosion layer in the supervision context. This prevents changes in one domain (like a new warehouse regulation) from "polluting" or breaking the logic in other domains.
  • Smart Contract Granularity: The authors argue that smart contracts should match the granularity of domain entities. This ensures that when business requirements change, only a specific, small contract needs to be redeployed, rather than the entire system.

Key Results

The architecture was evaluated using the Architecture Trade-off Analysis Method (ATAM) and a prototype built on Hyperledger Fabric.

  • Throughput: The system achieved a querying throughput of approximately 2800 TPS (Transactions Per Second).
  • Latency: The average latency was clocked at 1.4 seconds, which is well within the requirements for real-time supply chain monitoring.
  • Extensibility: Evaluation showed that business logic changes required less than 2% code modification, proving the system is highly adaptable to new business requirements.
  • Security: By using sub-chains, data privacy is improved; only organizations registered to a specific sub-chain can access its ledger.

Limitations and Future Work

While the multi-chain approach solves performance issues, the authors acknowledge a few trade-offs:

  • Interoperability: Storing data off-chain (in IPFS) improves speed but creates a "sacrifice in interoperability" compared to keeping all data directly on the chain.
  • Complexity of Management: Managing six sub-chains and a main chain is inherently more complex than managing a single ledger.
  • Future Directions: The authors plan to explore better interoperability between different reference architectures and aim to scale the prototype to support even more diverse real-world scenarios beyond the salmon industry.

Summary updated

Abstract

Traceability systems are important for solving problems due to the increasing scale of the global supply chain, such as food safety crises and market disorder. Blockchain, as an immutable and decentralized ledger, is able to optimize the traditional traceability system by ensuring the transparency and reliability of the system data. However, the use of blockchain technology may lead to a rapid increase in the complexity of system design and development. It is challenging to address widespread and complicated business, changeable processes, and massive data in practice, which are the main factors restricting the wide application of a blockchain-based traceability system (BTS). Therefore, in this paper, we reviewed relevant studies and proposed a reference architecture for BTSs. The proposed reference architecture can improve the cohesiveness, maintainability, and extensibility of BTSs through domain-driven design (DDD) and microservices. Considering the efficiency reduction caused by massive data and complicated data structure, we further changed the traditional single blockchain framework into multiple sub-chain networks, which could improve development efficiency and system performance. With the guidance of the architecture trade-off analysis method (ATAM), we evaluated our reference architecture and implemented a prototype in the salmon supply chain scenario. The results show that our solution is effective and adaptable to meet the requirements of BTSs.
BibTeX
@misc{wang2023reference,
  author = {Yanze Wang and Shanshan Li and Huikun Liu and He Zhang and Bo Pan},
  title = {{A Reference Architecture for Blockchain-based Traceability Systems Using Domain-Driven Design and Microservices}},
  year = {2023},
  eprint = {2302.06184},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.06184},
}
Figure