DappCon 2023: Using Data Composition For A Better Web - Radek Sienkiewicz

DappCon 2023 · September 2023 · 24:12

At DappCon 2023, Radek Sienkiewicz presents a talk titled 'Using Data Composition For A Better Web,' part of the event's developer track. Data composability is the general principle of combining independent, reusable on-chain and off-chain data sources when building applications.

Speakers

Topics

From DappCon 2023, hosted by Dappcon Berlin.

Transcript

thanks hi I'm radic I'm a developer Advocate at Ceramic and what I want to talk about is about data composability and how it enables you to build better and faster and cheaper as well uh and how ceramic uh enables that helps you with that and and gives you the tools for that so this is the title of the talk it's like has a lot of fancy words like a composable graph database built for web 3 app developers so that's what compos DB is uh I'll focus on each and every part of that if uh that is not

clear the composable part the graph data uh graph database part and how that helps uh app developers so currently what's the Journey of the end user like web too if I go to Twitter uh I need to if I don't have an account right now I need to sign up I need to give my name I need to give my email birthday location whatever else that is required uh and then once I'm signed up I have some ways to customize my experience like side preferences showing some posts blocking some people uh

choosing other settings and once I start using the uh the app like the the social app then I have a my my social graph like I'm adding friends I'm following friends I'm blocking people that I don't want to see anything from and so so that's when I came to Twitter when I come to Facebook then it's exactly the same so my purpose is more or less the same I want to be able to to log in I want to be able to uh follow my friends or follow people I'm interested in uh blog them and so on but right now I need to go and do

everything from the beginning I need to sign up I need to give all my data I need to start following people uh so I need in order to start getting value from that I need to repeat the whole process again as as if like nothing that I've done before exists so that's uh the the Journey of uh the the current user in web 2 so what where does data composability comes in data composability comes in that a an app developer can create a model of a certain piece of

data so I can create a model for or a basic profile and then I set the fields in the basic profile it could be the name it could be the birthday location email whatever else and then I start using that model in my app and uh I I set up like multiple Fields there some that I use some I might not use at the moment and if I do a good enough job of creating a for example profile model I make it available and everybody can then use the same model as uh as I'm using and have access to that data that uh that that I

have like those those basic profiles so that's the composability so if I am a new app developer and I want to like jump start my social app but I don't have any users yet or the users that potentially I can have don't have any social graph on that uh social app yet then I can use those model like the the model for uh a profile the model for for example posts so I can even like take all my as a user I can take all my posts from a previous social app to my new social app and it's already there I can take all my followers uh and suddenly when I'm coming to a new social app I already

have activity I already have value and I already want to use it rather than start start building everything up so this is how the data model looks like I set up the model and one of the fields in the model is uh the URL to schema and schema is what I described that all these fields that can potentially be there um like username or email name location and so on uh and then with ceramic with the composed DB you can interact with that model by creating reading updating all the data and multiple apps can do that multiple apps can access multiple apps

can add to it edit and S based on uh the permissions that I'm setting up so that's the composability part of uh the model uh and what are the use cases and why why does it matter uh so the the core components of the Sovereign data that I I've been talking about is mainly and this is in the main use case at least right now and it's getting more and more steam is identity so the there are two parts of trust in web 3 so first of all uh I as a user need to

trust like the DAP that or the smart contract that it's not going to scam me or that this is a specific smart contract that I'm looking for and not some scam smart contract that is trying to look like a genuine one but also from the other side I as a developer as an dab owner I need to trust uh the that the user that is connecting is actually a user it's not a bot it's not like airdrop farmer or whatever else I need to be able to verify okay so this is the real user this is his like identity and reputation

this these are the actions that he took over the last like years and each of those actions like built up their profile so the actions are over time uh interacted with that specific smart contract did that action on a different app and so on so basically the longer use the more you build up the reputation and then the app can trust that this is the real user so uh and it it's uh more and more important uh right now because everything is in all the different parts but uh a lot of it is public it can be aggregated and it can build up your reputation so that's one uh of of the

use cases other use cases could be a public data graph so basically all the like the model and everything else that I described everything is public and can be accessible by different apps that's the whole idea of it there is a way to also have some Fields like encrypted and then it's it's useful on it's visible to everybody anyway but it's still only useful then only to your app for example but that's not the main use case the main use case is that everything is public accessible to everybody so that's the part of data that you want to expose that the one that can be sharable and benefits from sharing so that's the public data graph

that that comes in uh open source data models like I said if I create a good data model for some specific item idea like a basic profile or like uh social media post it can have pictures it can have videos it can have text it have can have many different things if I do a good job at creating that it can be like a basis of a Shar sharable data model that then everybody will start using and uh the composability comes in that everybody agrees that yeah this this is a good structure this is a good model let's reuse that and let's have access to all the data that uh other DBS already using

and that's your crossup data as well uh and social infrastructure it's already what I discussed that you have you can basically have already a uh done for you social app when uh when you come on come to a new service uh and you reuse everything that you have created you reuse your social graph uh your followers and people you blocked and so on so keepy components of how this works how ceramic and composed to be make it easier for you and make it possible for you so the first is the underlying infrastructure like level zero is ceramic ceramic is a protocol that handles all uh all this

it's currently on ipfs uh but it doesn't have to be it's possible that in the future the underlying layer can be swapped right now it's uh working on ipfs but that's abstracted uh and uh that's layer zero then layer one it's like the ceramic interface which is composed DB you use it like a database that you use in web to you set the queries you get the data back you update the queries and so on but uh the question is that the database is proprietary and the database nobody

has visibility other than you into the database so everybody needs to trust that with composed DB you work with it as a database it's public but it also uh is as fast as using the database and it also has the benefits of being like data on blockchain because I didn't mention it yet but the the whole idea also that it is possible and it makes sense is the verifiability so all the data is verifiable provable so it basically you get all the benefits of having the data on chain like on etherum for example example without all all the cons of it

you don't uh you don't pay the the whole cost for it it's it's very cheap it's uh it's fast uh so so you have the benefits that it's onchain it's verifiable but you don't pay for it and you get uh you get it fast so that's uh the value proposition of compos DB uh the way it's being done that all the data that it's in ceramic periodically it it's hashed all its data with Merkel trees and then the hash is created for that specific piece of data and then it's

uh uh anchored there's CIS ceramic anchor service it's anchored to ethereum and these hashes periodic hashes are on ethereum are immutable and this is what lets you verify that the data you have and the data you you can uh read and and verify that it's uh uh it's from this specific user it wasn't tampered with and like I said all the benefits of having this data on chain without uh the costs so this is how it works so API hosting it's like ceramic nodes that everybody can run or clone another camic uh node for example with that specific model and that specific data that uh

that you have from some somewhere else event storage it's uh the the API the ceramic words as like data streams like like for example C A blockchain you can uh view it like that event ordering indexing so this is what I said about like anchoring into ethereum so it's all verifiable and then networking you have the the ceramic nodes that speak to each other that clone that data that you need uh and how you query the the data from those nodes for your dap I covered most of that already uh how it's similar to similar and

different to to writing to blockchain rather than using ceramic cheaper more scalable uh the goal is uh it's much much faster it's almost like web to like like databases right now the goal is to have uh the performance be to be as close to to reading and writing to your database like Cloud database right now as possible uh friendly developer API so it all works on graph API so if you are familiar with graph you already can use ceramic like with small differences uh you with graphql you write your queries you uh you get all the data uh you update all the data with

with graph apis graph API so you you use the tools that you're already familiar with and it's also more powerful compared to writing to blockchain more powerful uh identity and like the building process uh it uses DS so you can use any blockchain wallet you're not tied to any uh blockchain or anything else uh you just confirm your identity sign your operations and then don't need to sign everything every transaction or every like 15 minutes uh it can persist and it it's uh you by using the D moduls

and also uh yeah you can abstract it to use any crypto wallet so you you are not tied to any blockchain uh the networks right now that ceramic provides the first one like at the bottom is in memory it's works on your local computer it's just for development it doesn't anchor to ethereum uh then Dev uh Dev is similar to me in memory clay test net is what works currently on using ethereum test net so so you can reuse the the data models that other people built uh you can use that anchoring to ethereum

testnet so you can kind of like work on as on main net without paying the fees of of main net and then main net when you go into production is is when you use uh the main net and then you start using the anchoring to ethereum and verif verifiable data right now ceramic takes care of all of that you don't pay for for anchoring we pay for anchoring in the future the goal is to have it decentralized and then the cost may be split right now we we take that away from from you from developers from Builders uh and and we take that cost so we don't need to think about

that this we mainly covered as well uh the main use cases decentralized identity uh social networks dowo tools Dow is is a very good use case because there there's a lot of data all of that is public uh there's a huge need for trust and verification of of uh users uh so it plays really great into ceramic strengths and information graphs a lot of uh like science uh industry uses uh ceramic to for for their research data for knowledge graphs so when creating different data or like training models

putting it on chain you can reuse what others have created before you can add to it so you build uh the the moduls on top of what others did and then also benefit from from that some of the current apps that are using ceramic and compos theb is gitcoin lit protocol disco and so on uh and now so now this was more of a why and this is now very quickly we have a few minutes this is how so this is technicality so this is how you set up the data mode so this is graphql this is the basic profile data model you have

the name you set up all the rules is it required is it not required what are uh the the limitations minimum lengths maximum lengths so uh nothing new and you this is how you set up the models and then you can set relations between the models so for example you can only use if you want the profile model but everything else you build yourself or you can build a profile model and use like the posts model like for social posts uh and have access to that as well and then you can also use the like the follower model that you can take all the social graph from other places but for everything else you can build your own models so that's the composability you take what you want and

what you need uh and for everything else if it's custom or if you don't want to share it uh you build your own models and you can for example not make it uh public or not make it sharable uh and this is like the example of that so basic profile you reuse that uh that model so this is at the top this is the address of the currently existing model but you create your posts model yourself that's how you compose that data uh so you get all the profiles but the post you you define uh yourself and this is how you read the data so this is graphql uh you query that you get the data very fast uh and uh you

yeah query Advanced query mutations this is like how you create content uh so this should be familiar for for graph well and then yeah this to to show you I don't know if you can see that yeah more or less so so basically you can do a lot of it's kind of like your own database you you query the data you combine multiple different conditions I think this is like four or five conditions combined you can uh filter uh you can sort the output and so on so basically kind of like SQL even uh you you get all the data but with all the benefit of having uh data your data on chain and these are the resources

ceramic. network is is where you can find more about it uh compos theb docs and guides if you want to start playing with it when you start creating a uh when you start setting up your environment the you are asked if you want to build a sample social app to start playing with and that's a a good like playground for to to see what is possible and how to interact with the data and if you don't want to host your own node uh you can go to higher notes.io and then host it at a third party this is our partner and scan S3 XYZ this is a repository of currently existing models

so you can have a look there's a basic profile model model there is like a thread model for uh social apps or like forums and so on and there the there are many different models there that you can reuse or at least get some uh inspiration from that and that's about it that's ceramic and that's compos theb thank you great uh thank you you very much uh I think anybody has any questions yes so uh building data first what would

be the road to share different parts of the graph with different apps uh so like like I said so that there are already defined models if you go to the last link here scan S3 XYZ uh there already different models there defined uh you can have a look at them you can have a look at the schema of the structure if the model that you want uh to use and if you do then you can also choose to pull in all the data that is already in that model or you can maybe just use the that model yourself and start building the your data yourself but yeah the the the idea is to you enable HDs so that's historical uh data

service I think uh so you that's an option for you to enable or not and if you enable that then you pull all the data that uh all the other users of this specific model have created and you have immediately access to that yes you had you had mentioned that uh data is stored on ipfs is there a road map to put it on chain or what is your uh eventual goal uh the the road map there is an idea to to potentially swap that from from ipfs to potentially a different solution not

blockchain because then it would invalidate most of the benefits uh even an L2 or or L3 uh but uh we we working and considering like uh our own like solution and protocol built specifically for for speed for Access of data with all the same benefits of ipfs and without the the drawbacks of it any further questions anybody guys oh yeah is your data asset compliant like are all your transactions ass Sor are your transactions asset

compliant like is it sequenced or guaranteed sequenced uh you you have the time stamps yeah you have the time stamps the the time stamps are verifiable so you can verify the the time and the user and the fact that it happened so so those three things are all then hashed and then anchored to etherum so you can verify all those three things including time stamp yeah great uh anybody okay so if there's no further questions thank you very much for being here uh it was quite insightful thank you give it up for uh radic please yes