{"id":"LI23F1GUOh4","title":"DAML Performance: Scaling Reads and Writes","description":"📖 Get started with Daml: https://bit.ly/tryDaml\n📚 Learn more about Daml Smart Contracts: https://bit.ly/learn_daml\n📮Check out our blogs: https://bit.ly/daml-blog-engineering\n📋 Become a Daml certified expert: https://bit.ly/daml-certification\n\nLinks from the video:\n\nCQRS: https://martinfowler.com/bliki/CQRS.html​\nEvent-sourced architecture: https://martinfowler.com/eaaDev/Event...​\nDaml ledger topologies: https://docs.daml.com/deploy/ledger-t...​\nOur wonderful forum: https://discuss.daml.com/​","channel_name":"Daml","published_at":"2020-08-26T00:00:00.000Z","thumbnail_url":"https://i.ytimg.com/vi/LI23F1GUOh4/hqdefault.jpg","transcript_text":"hi everyone this is show and i created a very short presentation to talk about how we scale the performance of demo ledgers it's a very high level presentation to give you a sense of what parts of the system can scale horizontally and what parts of the system do so our agenda first we'll talk about the data flow of a demo based ledger at a high level we'll talk about what horizontal scaling is and which parts of the ledger can scale horizontally then we'll talk specifically about scaling the rights to the ledger and then where you can find more information or ask questions so we'll start with the data flow demo ledgers follow two architectural patterns command query responsibility segregation or cqrs and event sourced no need to understand that it's a mouthful but you can click the links if you want to learn more what does this mean it means that writing to the ledger what is called commands is a first data flow essentially a sequence or stream of transactions going into the ledger the ledger itself persisting to the ledger is a long log of transactions and that's the source of truth for all data in the system reading from the ledger what we call query is a second and segregated data flow now the important thing here is that in demo all interactions between the right path and the read path are only through the immutable ledger there are no out-of-balance workflows so let's talk about scaling scaling generally means how does the system behave when we add more resources to it horizontal scaling is a means to increase the throughput or reduce the latency by adding more resources to the system resources which can process in parallel so which parts of this data flow are trivial to scale horizontally first of all serving the api similar to the any other api endpoint in any system we can have multiple copies or multiple processes that interact with api clients and route messages to the different right paths or from the different read paths the read path is horizontally scaling scalable because remember the source of truth is the blockchain the event log so by duplicating the full read path or duplicating components in this read stream and creating multiple copies we can serve multiple different api clients or even we can have multiple read paths that all go to the same api client at very high throughput no synchronization between the different read paths is necessary because they're all getting the same data from the same source of truth the blockchain the right path isn't so trivial because we need to ensure that we're not writing conflicting transactions to the ledger so we need to validate every transaction within the context of every previous transaction so now let's dig into the right path the right path what we also call consensus in the blockchain world has to validate three things about the transaction being written to the ledger first of all the transaction needs to conform to all of the business logic the rules of demo the transaction needs to be authorized by someone who is allowed to write that transaction to the ledger and the transaction can't conflict with any previous transaction the first one is the one that has the highest need for computing resources because that is the interpretation of the business ledger itself the interpretation of the transaction so we can now split the right path into two stages one of which is horizontally scalable and the other is sequential now you may want to pause the video right now and try to think for yourself which of these three is horizontally scalable and which of these three is sequential by nature so the two stages of the right path the first one checks demo rules and authorization something that in demo we also call pre-execution now both of these checks can happen within the context of a single transaction so we can farm out the different transactions to different processes each one does these checks on a single transaction in parallel at the same time the third one conflict detection needs to check each transaction within the context of all of the previous transactions so that is sequential by nature so now let's dig into the conflict detection of it the conflict detection phase has very simple logic essentially as an example one transaction may say if contracts a b and c are on the ledger archive them and instead of them write contracts d e and f if a b and c are not on the ledger or if they've already been archived reject that transaction this is a very well known logic within the database world it's called compare and swap it's very simple logic and can run at high throughput now even within conflict detection some steps can be highly paralyzed but i won't be covering that in this deck so within the context of blockchains conflict detection is really the only piece of this whole system that needs to run within the consensus algorithm so that's it that was a very high level overview if you have any more questions or searching for more info you can go to docs.demo.com to the section that talks about the scaling of ledger topologies you can ask questions on discuss.demo.com or email me at show demo.com thank you hope this was helpful","transcript_synced_at":"2026-10-26T04:14:08.314Z","segments":[{"start_seconds":0,"text":"hi everyone this is show and i created a very short presentation to talk about how we scale the performance of demo ledgers it's a very high level presentation to","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=0s"},{"start_seconds":9,"text":"give you a sense of what parts of the system can scale horizontally and what parts of the system do so our agenda first we'll talk about the","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=9s"},{"start_seconds":18,"text":"data flow of a demo based ledger at a high level we'll talk about what horizontal scaling is and which parts of the ledger can scale horizontally then we'll talk","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=18s"},{"start_seconds":26,"text":"specifically about scaling the rights to the ledger and then where you can find more information or ask questions","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=26s"},{"start_seconds":34,"text":"so we'll start with the data flow demo ledgers follow two architectural patterns command query responsibility segregation or cqrs and","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=34s"},{"start_seconds":42,"text":"event sourced no need to understand that it's a mouthful but you can click the links if you want to learn more","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=42s"},{"start_seconds":49,"text":"what does this mean it means that writing to the ledger what is called commands is a first data flow essentially a","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=49s"},{"start_seconds":56,"text":"sequence or stream of transactions going into the ledger the ledger itself persisting to the ledger is a long","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=56s"},{"start_seconds":65,"text":"log of transactions and that's the source of truth for all data in the system reading from the ledger what we call","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=65s"},{"start_seconds":72,"text":"query is a second and segregated data flow now the important thing here is that in demo all interactions between the right","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=72s"},{"start_seconds":80,"text":"path and the read path are only through the immutable ledger there are no out-of-balance workflows","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=80s"},{"start_seconds":89,"text":"so let's talk about scaling scaling generally means how does the system behave when we add more resources to it","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=89s"},{"start_seconds":97,"text":"horizontal scaling is a means to increase the throughput or reduce the latency by adding more resources to the system resources which can process","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=97s"},{"start_seconds":105,"text":"in parallel so which parts of this data flow are trivial to scale","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=105s"},{"start_seconds":112,"text":"horizontally first of all serving the api similar to the any other api endpoint in any system we","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=112s"},{"start_seconds":120,"text":"can have multiple copies or multiple processes that interact with api clients and route messages to the different right paths or","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=120s"},{"start_seconds":128,"text":"from the different read paths the read path is horizontally scaling","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=128s"},{"start_seconds":135,"text":"scalable because remember the source of truth is the blockchain the event log so by duplicating the full read path or duplicating","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=135s"},{"start_seconds":143,"text":"components in this read stream and creating multiple copies we can serve multiple different api","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=143s"},{"start_seconds":151,"text":"clients or even we can have multiple read paths that all go to the same api client at very high throughput","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=151s"},{"start_seconds":158,"text":"no synchronization between the different read paths is necessary because they're all getting the same data from the same source of truth","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=158s"},{"start_seconds":166,"text":"the blockchain the right path isn't so trivial because we need to ensure that we're not writing conflicting transactions to the","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=166s"},{"start_seconds":174,"text":"ledger so we need to validate every transaction within the context of every previous transaction","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=174s"},{"start_seconds":183,"text":"so now let's dig into the right path the right path what we also call consensus in the blockchain world has to validate three things about the","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=183s"},{"start_seconds":191,"text":"transaction being written to the ledger first of all the transaction needs to conform to all of the business logic the rules of demo","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=191s"},{"start_seconds":200,"text":"the transaction needs to be authorized by someone who is allowed to write that transaction to the ledger","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=200s"},{"start_seconds":206,"text":"and the transaction can't conflict with any previous transaction the first one is","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=206s"},{"start_seconds":214,"text":"the one that has the highest need for computing resources because that is the interpretation of the business ledger itself the interpretation of the transaction","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=214s"},{"start_seconds":222,"text":"so we can now split the right path into two stages one of which is horizontally scalable and the other is sequential now you may want to pause the video","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=222s"},{"start_seconds":230,"text":"right now and try to think for yourself which of these three is horizontally scalable and which of these three is sequential","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=230s"},{"start_seconds":236,"text":"by nature so the two stages of the right path the","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=236s"},{"start_seconds":243,"text":"first one checks demo rules and authorization something that in demo we also call pre-execution now both of these checks","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=243s"},{"start_seconds":252,"text":"can happen within the context of a single transaction so we can farm out the different transactions to different processes each one does these checks on a single","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=252s"},{"start_seconds":261,"text":"transaction in parallel at the same time the third one conflict detection needs to check each transaction within the context of all of the previous","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=261s"},{"start_seconds":269,"text":"transactions so that is sequential by nature so now let's dig into the conflict detection of it the conflict detection phase has very","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=269s"},{"start_seconds":278,"text":"simple logic essentially as an example one transaction may say if contracts a b and c are on the ledger","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=278s"},{"start_seconds":287,"text":"archive them and instead of them write contracts d e and f if a b and c are not on the ledger or if they've already been archived","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=287s"},{"start_seconds":294,"text":"reject that transaction this is a very well known logic within the database world it's called compare and swap it's very simple logic","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=294s"},{"start_seconds":303,"text":"and can run at high throughput now even within conflict detection some steps can be highly paralyzed but i","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=303s"},{"start_seconds":311,"text":"won't be covering that in this deck so within the context of blockchains conflict detection is really the only piece of this whole system that needs to","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=311s"},{"start_seconds":319,"text":"run within the consensus algorithm so that's it that was a very high level overview if you have any more questions or","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=319s"},{"start_seconds":328,"text":"searching for more info you can go to docs.demo.com to the section that talks about the scaling of ledger topologies you can ask questions on discuss.demo.com or","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=328s"},{"start_seconds":337,"text":"email me at show demo.com thank you hope this was helpful","url":"https://www.youtube.com/watch?v=LI23F1GUOh4&t=337s"}],"youtube_url":"https://youtube.com/watch?v=LI23F1GUOh4","url":"https://ccpedia.xyz/videos/LI23F1GUOh4"}