# IPFS & Filecoin Breaking Free from the Client Server Model - Discordian & Dawn Kelly

- Channel: [ETHGlobal](https://streameth.org/ethglobal)
- Date: 2022-10-09
- Duration: 30:27
- Topics: Science & Technology
- Watch: https://streameth.org/watch/yt-sH_tUHGG3zw
- YouTube: https://www.youtube.com/watch?v=sH_tUHGG3zw

## Description

Welcome Discordian & Dawn Kelly from IPFS & Filecoin for a workshop titled "Breaking Free from the Client Server Model".

ETHOnline is our biggest event of the year! Collaborate with thousands of developers and creatives from around the world and win over $300k+ in prizes! We're bringing in 30+ of the biggest teams in web3 to give you access like never before. Learn from ecosystem leaders and build your biggest ideas as the merge nears reality. The future of Ethereum is being written right now, and it's time to make your mark.

---------------------------------------------------
Follow us: https://twitter.com/ETHGlobal​
Check us out: https://ethglobal.co​m
Email us at: hello@ethglobal.com

#ethereum #web3 #blockchain

## Transcript

foreign [Applause] [Music] good morning good afternoon good evening depending on where you're calling from um we have the ipfs filecoin team here today to do a workshop on Breaking Free from the client server model um this is going to be a pre-recorded Workshop by discording from ipfs filecoin um however we have Dawn um hear from the team who can help with any questions so definitely still ask your questions in the zoom chat if you have any and Dawn will take the last couple minutes of the workshop to answer any of the questions that you may have um so with that being said we'll start the recording and yeah feel free to ask the questions in the zoom chat so hello everyone uh once again I'm discordian a community engineer from protocol labs I'm here to give you a 201 talk on Breaking Free from the client server model this is meant to be a follow-up to the intro to ipfs filecoin Workshop having knowledge on what a server is and some knowledge about ipfs filecoin will be a huge asset to following along but I've tried to structure this presentation in a way that it should be informative and hopefully enjoyable to anyone interested in our ecosystem or the distributed web in general if you have any questions during this Workshop please feel free to ask them any question I don't get to during the workshop I'll do my best to get to afterwards all right so let's get started first by calling back all of the noise in the background and let's focus for a moment on what the client server model even is through this we'll rebuild the graphic and hopefully with it your understanding of the concepts at play as a whole so what is the client server model well today only a few companies are responsible for serving up most of the web we have Google Amazon Facebook and fastly just to name a few these companies combined service our ads web pages social media videos images and allow us to host servers and services on their infrastructures to interact with these Services we also have to use their apis sending some data to their server and eagerly waiting for a response so we can process it and do whatever magic we need to do to create our apps and websites there are several problems with this design though from costs to privacy free services are often funded by ads further destroying our privacy as all our data is routed through a few Central points paid for by our attention and private information for the most part all our data routes through their servers if you want to view a video send a message collaborate with remote teammates or do anything on the web at all early you're going through someone's Central server this principle is fundamental to the client server model we use a client such as a web browser or Chata and communicate with a single entity and that's the server in the client server model relying on just one point for our source of Truth also opens up a whole host of problems like Trust currently we have SSL certificates to verify an entity is who they say they are however that doesn't do us much good if that service is compromised and even if we are sure of who the entity is it still doesn't help us know how advertisers or others are using our data or even what data is collected for the development side the source of Truth in this instance could be the results of an HTTP API call if for any reason the location of that API cannot be accessed your service could also be impacted today a popular way to build is to lean on the apis of another remote service which makes the web very fragile if the service you rely on goes down so does your service in the second half of this workshop I'll go over some other ways to communicate with outside entities in a distributed way to retrieve information without leaning on just a single entity too much in the client server model generally if you want some data you must know where it is if you want some image you generally need the full URL to that image to retrieve and share it if that image is no longer available on that service you either need to search for it or upload a copy on another server to make it available again sharing the new location of that image this is assuming you even have a copy yourself this principle is called location-based addressing and is how most of the World Wide Web functions today if you go to a website it has a URL and all data from that website is addressed by the location of the data if the image analogy is too hard to follow think of how you would share a video on your favorite video platform you'd likely just share the URL to the video also known as the location of the video by this point you might be wondering without addressing by location how would I even find the data we'll get to that I promise but for now I'm going to finish unraveling what the client server model is how it functions and some of the drawbacks to the approach as a whole for The Wider web speaking of drawbacks a major drawback of the client server model is that a single outage can take entire Services down think of when AWS goes offline fastly Facebook or YouTube these events are treated as news and often slows or even halts productivity one of these Services goes offline it's much more impactful than just a single image or video being lost you've now lost access to your ability to even make new data available at all all the data you have hosted in the central hubs is temporarily completely inaccessible or Worse permanently the location of the data simply cannot be accessed because it's offline you cannot simply ask for the data from The Wider web either and expect to receive it even if another related entity has the very data you are looking for you could of course host your own service maybe distribute out the locations of your servers in a way where outages are rare let's say you even come up with the next big idea for a website or platform where you're in control of all your own infrastructure not relying on some other Central entity for your needs well that's my segue into my next point scaling can be very expensive these expenses don't always maybe not even usually happen linearly meaning an explosion of traffic can easily translate into an explosion of costs whether you host your own infrastructure or you pay someone else to you'll be paying for it if you want it to scale and run effectively the more users you have the more traffic that generates your CPU RAM and bandwidth expenses ramp up on top of this if users end up depending on your service for one reason or another you're obligated to keep the service running and available if you want to retain users and keep them happy not everyone can afford these costs and they can be quite daunting especially if you want to create uh if you just want to create a fun project technology or even a Blog a lot of companies as I mentioned previously turn to advertising to supplement these costs too resulting in much of humanity effectively selling their private information in exchange for free services online speaking of content creation content creators are often completely locked to a few platforms like YouTube Instagram and other similar platforms those can be subject to a whole host of rules and regulations as well far more restrictive than what your local government might allow and you have no say in when or how these rules change if you want to host any content at all on one of these Central entities you must of course ensure you're abiding by their rules and regulations this can be quite unfortunate when popular content gets lost to rules changing or updating as is quite common with video and graphic media today as a content creator sometimes it can feel like an impossibly daunting task to solve this problem especially when people become so dependent on algorithms pushing their own or pushing their content to users sure one could set up their own Services as I mentioned previously however not everyone knows how to do that effectively and they're not prepared for the time and costs associated with that from social media to blogs to forums anything in between anything on the web at all these are all the fundamental issues with the client server model to summarize the drawbacks seem to be one only a few companies decide the rules for what's allowed on the web and control the infrastructure surrounding the web itself two the source of truth comes from Only The Entity you're interacting with so if that entity or server is ever compromised there's little if anything you can do about it three data is addressed by location so for any reason at all if your data is no longer available in the same location it's effectively lost four an outage of any of these mentioned servers can not only remove your content from the web but can also completely prevent you from effectively publishing new content at all five scaling with this model can be very expensive and six it's not you or your government that decides what content is allowed to exist but instead a handful of companies I think we can do better Breaking Free from the client server model means rethinking how the web works as we know it today this is the stage of the presentation where we get to start talking about the fun stuff the client server model represents web 2 as we know it today love it or hate it I believe there's a clear and strong argument for how the web 2 model referring to the client server model can be improved what do we call this new model this new model is referring to the distributed web so let's talk about that and how ipfs fits in but first for the uninitiated let's briefly talk with the distributed web is and what it means to you whether you're a user or a developer you can benefit from the distributed web what I think of as web3 the client server model is a centralized model this is why we're always talking about Central servers in single points of failure pictured on the left is this model you can see a central point in Orange this is the server and then the spokes are the clients who are often the users this graphic should make it easy to see how if that Central Point is ever removed then the users can no longer communicate with one another before we jump into the distributed model though let's talk about the decentralized also known as the Federated model with another visual so the decentralized model is a huge Improvement to this to the centralized model it still operates in a client server sort of way we end up with hubs that serve users and if a hub goes out only a piece of the network is lost while this is a Matrix when those Services have an outage it only affects a piece of the communities they represent instead of the whole social network or chat service while these are awesome let's see what the distributive model looks like as you can see on the left and on the right in the distributed web each user is also providing a piece of the network itself if a user goes offline the network functions as normal if a major node goes down the network can still function as well by leveraging the local peers it is the champion of resilience and the model I believe will take us forward some nodes might be bigger than others but no single outage can take the entire network down let's take a look at how ipfs fits into all of this and also Dives deeper into the distributed model itself we talked a lot about location-based addressing so let's talk about one of the fundamental building blocks to an alternative called content addressing ipfs creates mathematically generated fingerprints for data called content identifiers or cids for short this step relates to something called ipld or interplanetary linked data and is fundamental to how ipfs Works to give us content addressing breaking us free from location-based addressing pictured on the screen right now is the anatomy of a version 1 CID represented in binary let's break it down real quick on the far left of the graphic not pictured here would be the multi-base prefix this is actually omitted here because when working with binary there actually isn't a multi-base prefix so you can save that byte with the multi-base prefix does though is it allows us to know what base encoding was used to create the CID at least to represent the CID might be a better way to put it as ipld supports many codecs next we have the version identifier which is simply whatever version number we're working with in this case we're working with a version one CID so current which is a variable sized integer and the list of supporting encodings are available in the GitHub multi-formats repository and uh I have a link on there in the on the right side it got a little broken oh no am I freezing ah I'm sorry to hear that's happening I'll make sure to uh toss my router out the window after this to get a new one okay good good I'll uh I'll continue and hope it oh I hope it gets better um next up is the multihash which includes three things a multi-hash algorithm a multi-hash length and then finally the hash digest itself you can see here we're working with a sha2 hash of 32 bytes in length then the hash itself Trails off the screen the multi-hash specification is also available in the multi-formats GitHub repository I recommend checking it out if you're interested in all the options you have for generating a CID as we went over if you're requesting data by its CID you can also verify it's the correct data as you have the hash of the data you are expecting baked right into the CID so you don't have to trust who's sending it to you as you can simply run the hash function in the case of the example that shot 2. on the data and verify it yourself ipfs uses cids by either looking up the Cid in the distributed hash table also known as the DHT or by using pit Swap and asking their local peers do you have the CID with this it no longer matters where the data lives as we know exactly what we want so it doesn't matter who has it just that someone has it we have now broken free from location-based addressing does multiple files that are the same get cataloged differently uh no actually if um if you added a file on your node let's say using the default settings and then somebody else across the world adds the exact same file in their node at the default settings you'll generate the exact same CID so uh they don't get cataloged differently no problem so now if you want to share a web page an image a video or an article you know that if you send that CID to your friend they can download the exact same version of the data you also saw as long as at least your node or someone else's has a copy you can share it it wouldn't matter if the initial Hoster removed the data only that you or someone else has a copy of the data through this data can live as long as there's someone who wants it to through filecoin you can even pay storage providers to guarantee your data will live for some time maybe even forever but that dive is for another talk in the meantime if you're looking for a service to persist your data I recommend checking out web3.storage nft.storage and lighthouse.storage they're all storage helpers eager to get your data available over ipfs and backed up the filecoin does it get duplicatable still refer to file one um actually yeah that's a great question so if you if you have a CID um and let's say a I think a good example is if you have a file and then two folders one folder has that file in it and then you wanted to add the same file to folder two it won't duplicate the data it'll just add a reference to the exact same CID so this makes ipfs naturally it has deduplication as a result because there is no instance where you can have the same data twice because you can just refer to the CID and get the same data so you're really just dealing with handfuls of cids yeah no problem oh I like this question too could ipns be a weight of version ipfs files how would that work and if so does it make sense to use that if you want to be able to update an nft or is there something more clean about using the ipfs address actually IP it sounds like you've already uh answered your own question IPS would be absolutely perfect for that because with ipfs you won't be able to update the CID whatsoever but if you have ipns what you're doing is you're you're publishing and saying like I have this ipns key and I want this address to now point to this new CID so that's really what will give you that mutability that you're looking for um you can create an ipns Key by installing something like uh Kubo also previously known as go ipfs and then you run ipfs key gen and then uh the final parameter is the name of the key that you want and then that's how you'll generate a new ipns key foreign so now that we've broken free of location-based addressing and moved on to content addressing what does that mean for us well it means that now transparently the network can find new routes around problems problems in this case can be outages we know that if our node goes down for a period of time that we're in the clear if we've gotten our data onto some other nodes or even if a user running an ipfs node happens to have a copy of our data with ipfs your node will cache new data until it's garbage collected this AIDS in automatically strengthening the resilience of a CID this can work with entire Internet outages as well in certain countries as long as some node on the local network has a copy of the data the data can still be served this shows that in a peer-to-peer network no single node outage or event can cause the service to go down okay multiple people version in ipns um that might be something to play with I know if you have two nodes with the same ipns key each different node can update it but I'm not entirely sure all the Nuance that comes into play when that happens but yeah I would like to see some more delegating kind of stuff to do with ipns in the future uh we're just not quite at totally speccing that out yet I don't think um so this knowledge is important when you're designing your application sure you can leverage a Gateway and if you're tight on time in a hackathon that makes perfect sense however if you really want to create a resilient web 3 peer-to-peer application then it's important to think about how to achieve resilience and to do that you must be utilizing the peer-to-peer nature of ipfs when you rely on a Gateway especially just a single one then if that Gateway slows or goes down your entire application will go with it where if you utilize ipfs directly leveraging its peer-to-peer capabilities you're on track to creating a virtually Unstoppable service so we touched on how ipfs users help re-serve data they're interested into nearby peers this happens when a user requests data from the network via CID their node caches it then makes it available to the rest of the network this AIDS in more than just resilience you can see it as the network pitching in to help you scale efficiently too think about the client server problem of when you create a popular app and your traffic explodes that situation is effectively flipped on its head with ipfs resulting in what we call negative bandwidth scaling costs if a bunch of nodes are attempting to download your CID they'll be automatically re-sharing that CID as well so while your traffic explodes from people sharing your CID to each other those very same people are helping send the data itself to their friends or colleagues automatically so effectively the more popular your CID is the easier it is for people to retrieve the data from some other node that might be more local to them this property is very important to the interplanetary aspect of ipfs if someone on Mars had a piece of data that they originally retrieved from Earth then another Mars user shouldn't have to wait to retrieve the same data from Earth the network should automatically figure out that there's another node on Mars willing to serve that data content addressing in the distributed web helps us unlock such a future on the network level transparently if any of this presentation has sparked your imagination or gotten any gears turning then please come join our ecosystem to learn and build we have an awesome Community comprised of Builders who help us Foster a positive and productive environment I highly encourage you to check out a resource we compiled of several tutorials currently available at tinyurl.com learn ipfs filecoin I'm also available in these communities particularly on our Discord but also our forums in stack Overflow you'll find myself other devrels and tons of knowledgeable people inside these communities so please don't hesitate to join in and say hi all right so when you say local do you mean geographical physical proximity Is geographical location the primary determination of the proximity of nodes um sorry right now I don't think there's any geolocation done whatsoever and local really depends on the context that I said it so when I'm talking about like Network outages I'm talking about like countries where um they might uh cut or sometimes there'll be an issue connecting to the uh greater internet so in those instances local nodes can still communicate with each other just because they have the literal ability to address and find each other um where otherwise if we're talking about like uh publishing something to the DHT local is determined by key space not uh Geographic um and then when we're talking about the instance of Mars to Earth um I guess that would be sort of geographical but it's mostly based on the fact that a Mars node will begin initially serving blocks theoretically nearly immediately where communicating with Earth would take so much longer that you would you would know which one's closer just based on the time to first block um so how does using ipns to store Dynamic data different than using ceramic are there trade-offs so I'm not super familiar with using Ceramics specifically directly but I believe a ceramic does leverage ipfs so that would make me think it does leverage ipns as well so I think that's um like a case-by-case thing like if you're using ipns you're using um like probably more like Bare Bones low level type stuff where ceramic is another layer built on top of ipfs to try to help you out give you extra apis and sdks to make things easier for you um so I guess yeah the trade-offs are totally totally up to you one might be better than another but it all depends on what you're trying to build and who you are no problem so I hope to see you all around um I'm also available at many hackathons so please ping me or send me a DM even if you're not in a hackathon I'd love to hear from you I'm discording on related Discord servers and the follow coins lock so aside from answering any unanswered questions that's it from me and I sincerely hope I helped Inspire or teach you something and I hope you all have a lovely day and happy hacking awesome um that's it for discordians uh recording um uh his ipfs file account file coin Workshop um if you have any questions Don from um ipfs filecoin is here to answer you're you're more than welcome to come off mute and ask your question live or continue um asking your questions in the zoom chat um but we do have another like two three minutes if you do have any more questions hey I'm just looking at the zoom chat there were questions about making the slides available um I put a message out to discordian to find out if they are available somewhere that those can be shared so I'll follow up with you on that for folks that are looking for those and then we did have a couple questions in the chat they were asking about let me just scroll back up here let's see so the question that I got was centralized systems also have underlying distributed systems to make sure that no single node failure will take the service down what makes a distributed system better in this case or is it just more resilient and yeah I do agree with that that it does become more resilient just by Nature being distributed but we did also talk about how you also want to be thinking about censorship resistance and not having vendor lock-in as other reasons and the one more thing I think worth mentioning is you can use your CID or content address and store that on any provider that you want to use whether that's going on to file coin our weave AWS Google wherever you like to store your data it's um platform agnostic I have I've got a question thanks Don for that for the answer um it sounds like with ipns they were saying that you could uh basically get a new CID for example you needed to update the content that the previous CID pointed to what does it look like to in the event that like like let's say that's a typo in a a piece of text for example it's that previous um CID is it just there and it's no longer pointed to you directly from that interface or is it not is there really is there a way to remove that sure sure thank you uh so when you're using ipns you're more working with creating a pointer that then points to cids so your original CID still exists you would just have to repoint your ipns back at it if you wanted to change where it was where it was going or what it was displaying got it so basically it's like the in the web two terms the URLs there is just not the hot link from the web page it's in there IPS you're just creating a pointer so your old CID still lives you just have to go point at it again and then you'd be back back at square one if that makes sense yeah totally I appreciate it hey well I guess that's all the questions we have for now uh well just like discordian said in the recording um the ipfs filecoin team is available through almost all forms of platforms um but specifically on equal Discord they are available in the ipfs file coin um Discord channel for you to reach out to um team is super available and willing to help with your hack so definitely reach out if you have any questions um Don thank you so much for taking the time to answer questions for today's Workshop um and otherwise uh thank you everyone else for tuning in today and I hope everyone has a great rest of your day
