Skip to content

Commit

Permalink
fix for concurrency article
Browse files Browse the repository at this point in the history
  • Loading branch information
martinseanhunt committed Sep 10, 2021
1 parent 0aec39e commit d34f69e
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions content/10-plutus/10-concurrency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,41 @@ title: Understanding concurrency
metaTitle: Understanding concurrency
---

Concurrency may or may not improve a system’s performance, throughput, or responsiveness. The amount of concurrency limits the maximum number of simultaneous operations that can be performed.
Concurrency may or may not improve a system’s performance, throughput, or
responsiveness. The amount of concurrency limits the maximum number of
simultaneous operations that can be performed.

To obtain *actual* performance improvements in a UTXO-based blockchain, processors or other actors should be able to perform multiple actions simultaneously. The higher the level of concurrency, the higher the maximum possible parallelism. Such an approach then translates to performance improvements and throughput. It also provides significant advantages over account based systems (like Ethereum).
To obtain _actual_ performance improvements in a UTXO-based blockchain,
processors or other actors should be able to perform multiple actions
simultaneously. The higher the level of concurrency, the higher the maximum
possible parallelism. Such an approach then translates to performance
improvements and throughput. It also provides significant advantages over
account based systems (like Ethereum).

## Deploying DApps on UTXO ledgers is *different*
## Deploying DApps on UTXO ledgers is different

Cardano’s approach to DApp deployment is different and thus it requires a learning curve and a different approach. This is like working with different programming languages: there is one goal – to deploy a solution, but so many programming languages to use for this purpose.
Cardano’s approach to DApp deployment is different and thus it requires a
learning curve and a different approach. This is like working with different
programming languages: there is one goal – to deploy a solution, but so many
programming languages to use for this purpose.

Maximizing concurrency is a skill that needs to be learned: developers need to write code in a way that severely restricts the opportunities for contention (e.g., by avoiding shared states and accidental dependencies). The system must then translate this concurrency into parallelism. A number of developers have already identified ways to approach this, while others are still developing solutions. Simply transplanting lessons learned on one blockchain will not work; while the learning curve is a little steeper, the results make this worthwhile.
Maximizing concurrency is a skill that needs to be learned: developers need to
write code in a way that severely restricts the opportunities for contention
(e.g., by avoiding shared states and accidental dependencies). The system must
then translate this concurrency into parallelism. A number of developers have
already identified ways to approach this, while others are still developing
solutions. Simply transplanting lessons learned on one blockchain will not work;
while the learning curve is a little steeper, the results make this worthwhile.

Either way, it is important to understand that to deploy a scalable DApp on Cardano, a developer can’t just use an adapted Ethereum contract. Cardano is based on the UTXO model; it is not account-based which means that a single on-chain state will not meet the concurrency property of Cardano. Instead, DApps should split up their on-chain state across many UTXOs. This will increase the concurrency in their application, thereby allowing higher throughput.
Either way, it is important to understand that to deploy a scalable DApp on
Cardano, a developer can’t just use an adapted Ethereum contract. Cardano is
based on the UTXO model; it is not account-based which means that a single
on-chain state will not meet the concurrency property of Cardano. Instead, DApps
should split up their on-chain state across many UTXOs. This will increase the
concurrency in their application, thereby allowing higher throughput.

To learn more about scalability, you can read [how to design a scalable Plutus application](https://plutus.readthedocs.io/en/latest/plutus/howtos/writing-a-scalable-app.html) and to learn more about how to organise DApps on Cardano using patterns, read the [order book pattern](https://plutus.readthedocs.io/en/latest/plutus/explanations/order-book-pattern.html).
To learn more about scalability, you can read
[how to design a scalable Plutus application](https://plutus.readthedocs.io/en/latest/plutus/howtos/writing-a-scalable-app.html)
and to learn more about how to organise DApps on Cardano using patterns, read
the
[order book pattern](https://plutus.readthedocs.io/en/latest/plutus/explanations/order-book-pattern.html).

0 comments on commit d34f69e

Please sign in to comment.