What’s new in Corda?
Corda is the leading private, permissioned distributed application platform, powering multi-party workflows in regulated markets. With Corda, decentralized apps can be developed using standard languages and protocols such as Java or Kotlin. In this blog post, we will highlight three new components of Corda.
New architecture for Corda
Corda is known for its strong identity and privacy, high performance and scalability, and enterprise interoperability. With Corda, these good characteristics are kept, and we are taking it to another level. We completely redesigned the product architecture and drilled on high availability and horizontal scalability.
Corda is designed around a message-based, event-driven, architecture that uses Kafka. The primary role of the Kafka cluster is coordinating the different services that power Corda.
The new architecture brings new components and concepts for Corda. We are introducing:
1. Event-driven workers
2. Virtual nodes
3. Application Networks
Event-driven workers
In Corda 4, the physical node is running in a JVM and takes care of all of the DLT complexities for you, such as cryptography, peer discovery, key management, etc. It is an aggregated service engine. In Corda, we are introducing individual “workers” to take care of the services. We extracted each service from an all-in-one engine and make them into individual processes. The Kafka cluster connects them to each Corda identity whenever a service is required.
In Corda, different worker processes are responsible for various aspects of running Corda, e.g., the flow workers execute flows and verify contracts, and the DB workers handles interactions with the cluster database.
Examples of workers
Corda is designed to be horizontally scalable. It relies on cloud-native deployment technologies such as containerization (Docker) and container orchestration (Kubernetes). In Corda, scalability is achieved by increasing the number of workers in the Corda cluster. Increasing the number of Corda cluster workers will in turn consume more compute resources. This can be addressed by scaling the Kubernetes cluster, increasing the number of Kubernetes nodes (servers) the cluster is running on.
Horizontal scaling in Corda
Virtual nodes
Multi-tenancy is a new concept in Corda. To allow multi-tenancy, Corda introduces virtual nodes (VNodes). With Corda, a Corda instance can host multiple virtual nodes. An instance of Corda is composed of a number of processes executing in parallel to perform all of the required operations. Each virtual node would call up the stateless event-driven workers to execute its events. An event is recording a state change in the system. The workers are dismissed once the virtual node goes idle.
VNodes are a CorDapp in context of an identity. The Corda Cluster can be scaled based on the aggregate load for all virtual nodes.
Application networks
Corda is organized in application networks. Each network has a set of applications packaged in a CPB (Corda package bundle). It also has a network ID and a network policy which are bundled with the CPB into a CPI (Corda package installer). An application network membership is managed by an MGM (Membership Group Manager)–which is in itself a Virtual Node.
A Corda cluster is network agnostic, i.e., it can support VNodes belonging to different networks.
Summary
Corda cluster overview
To summarize what’s new in Corda, it moves away from the monolith physical node engine architecture and adopts the agile setup where stateless event-driven workers can spawn on demand. By doing so, Corda can maximize the resource utilization for each virtual node. The network management is moved before CorDapp deployment with the help of CPIs, leaving less operational intervention post-deployment.