 Okay, that's okay, so Beer net is actually a peer-to-peer System that allows you to build peer-to-peer applications on top of it It is the result of a pretty cool self-man and we are going to try to use it in a pretty cool mancosi now which I want to tell you a little bit later and So I'm going to what is the motivation of our peer-to-peer system the idea is to build scalable distributed applications with robust Storage that means that we don't want to work with a classical Client server architecture because you have a central point of congestion So it doesn't scale and it also have a single point of failure This is what we don't want to have so this is why we want to have something which is decentralized But if you go decentralized, there are more complex things to do and so we need some self-management for the system It means that we want to have self organizations of the participants of the network and also self healing So if some nodes fail you can replace them very easily or at least you don't have to do it manually have to be done by the system itself So with self management we deal with the complexity of the decentralization So what we want to do is actually peer-to-peer and I will tell you later on what we call it beer-to-peer so The most known way of doing peer-to-peer is actually file sharing where you have an unstructured overlay network Which work on top of the internet and allows you to Share your files. You just connect randomly to some of your nodes And work pretty well when the files do not change so the files of the music They just stay the same or the movies to stay the same you don't update them and the things that if it is very popular Because you try to find us You search as much as possible and you find it good luck in if you don't find it Okay, doesn't matter so for popular things like I don't know bringing spears or Metallica You can find it very easily But if this guy in green is searching for something close to what back about which is that this guy here in red The algorithm is not going to be able to find it even if it is in the network So we want to add some structure to the network which is done in the academia with one ring to rule the mode and The rule is actually to assign an identifier to every peer and to put them into a ring The identifier is going to allow you to connect to your predecessor and your successor following the order of the numbers, of course and This ring is also one ring to find them because you can have some special connections to jump Significantly into your ring. So it's efficient for routine so you can find every peer in your network in a logarithmic Logo time it means that if you double the size of your network You only need one extra step to find every node over there The fingers can be done like this like dividing half of the half and half of half or you can put them in a different way It is independent of the ring. Okay, but because it isn't realized You don't have control about things you have to deal with peers that are failing Those peers there peers that are leaving because they want to leave or peers that are joining all they join when appears Failing to all this kind of stuff is why you need some self-management and Also, as in the previous steps, they were saying that there's some problems with communication between peers If this guy can talk to that guy, it doesn't mean that he can talk to this guy So you can have some problems with the Connection between successor and predecessor. This is why we have the relax ring So we don't want to have a perfect ring have something that which is more relaxed So we will allow some peers that can talk only to the successor and just know about the predecessor So they can share their responsibility of the space very easy So this is a relax ring in the last ring We build a distributed hash table as in the other rings, but that's me that you can do Storage by putting something with a key and a value and retrieving something with the key Or you can search for the responsible of the key with a high operation lookup Okay, and the responsibility of this hash table goes from the predecessor Excluding the predecessor and including the peer itself So this peer here, which is have the identifier zero and this one which is seven It means that the responsibility of this guy is to store all the hash keys that goes from one to seven Okay, it's very simple idea. It's not invented by me, but from the commit and the fingers here will allow you to Reach any point in the network as I said in logarithmic Number of steps plus a bee here, which is what we call a branch in the relax ring Which are these notes that are here, which are Experimentally like less than two in a network of 10,000 nodes. So it doesn't really affect the routing stuff Okay, so there's no SQL language here. You just do put and get From the information with key value pairs. This is not For tolerance because if the responsible of the key dies, you don't get the value. So this is why we need some Replication, but I'm going to do that a little bit later to build a network what you do This is implemented in a language called most of us and You do an import of the library. You just say I want to create a new peer With some arguments With this peer you join one network just using a URL you build your own network or you can join existing network If it's allowed to do that and then to send messages to the peer You can do it reliably with our send to using one of the ID and then you just send one message You can usually do this for building your protocols and all the stuff You just not say lonely post them even though it's a good message you do something else When you broadcast a stuff you can do it with a range Which means send it to all of them all but me or from this node to that note It means you can do multicast And as I said for storing you can put things with key value So here I'm putting a beer and then you put whatever you want So the beat this beer with a key bink is called Adelardus is a double beer is from Limburg burger and then when you retrieve it You just do get bink with available x and x is going to get the value with this description as I said This is not for tolerance. So we need transactions over peer-to-peer with isolation, which is our layer called trapeze Trapeze is a symmetric replication It means that you have here for instance two items one with color green the other one with color gray Which is symmetrically replicated on the ring. So it has four replicas of every item This client here wants to modify some of the items. So how it's going to do it with a transaction manager The most common thing to do transactions in a decentralized way is to do two-phase commit the two-phase commit Relies on that guy to not fail during the transaction You cannot do reliable things on nodes and appear to peer because you cannot rely on peers. So what you have to do is to also replicate the transaction manager and To have a consensus and to work only with the majority of the peers that have the replica not with all of them because if one Failed during the transaction is going to be too bad So just work with the majority and with the replication of the transaction manager So it is a little bit slower than two-phase commit, but it's more robust. So you gain a lot actually So when the transaction is done you keep your new values on replicated and the transaction managers disappear we also have an update for a Notification on every update so you can build something like public subscribe systems very easily with this layer Okay, so I'm going to show a little bit the architecture of beer to beer so On the bottom you have the relax ring Which just organize the peers doing self organization self killing then on top of this you do the reliable message sending to build the DHT on top of that to have the Replication you have this trapeze transaction layer and we have developed several Protocols for doing taxes consensus algorithm also doing eager taxes mean that you get the lock in a pessimistic way This is for doing synchronous collaborative applications And you have your notification layer which is all working with the replication This architecture score looks better with a background picture that tells you more or less how the architecture evolves So which kind of application have we developed in beer net? Pepino is a peer-to-peer network inspector. This is an example of a Simulation of a network because we try to create problems between the communications of some nodes So you get some branches for instance here, and then you can have the fingers in between and also you can follow the successor pointers or the predecessor pointers so you can Actually debug your applications you can see the messages exchange from the between the peers here with different colors You see at which level they were sending messages either for the organization of the ring or for the transactions for instance So we have another application called syndata which is sharing idols and discussing about common addictions the ideas that you just have a Community driven recommendation system. This is done with the taxes consensus algorithm. You just simply provide some links Like say I like this video on YouTube. We don't put the the video itself because we can have some problems with a Copyright and all that stuff so we just put the links and the people can say instead of stars course no beer for that one two beers later and Then every time that you vote on the stuff or you provide a new recommendation. This is stored replic a with a Replication on this data system and then you can retrieve all the stuff and this is all done with transactions So there's a set of peers we use 42 for the server Which are actually a form of server. So this is a peer-to-peer network, which is behind the web server okay We have another application called the trans draw which is decentralized transactional drawing because everything is on transactions again This one is using the eager locking It means that every time that you want to modify some of the items that are on the network You're going to get the lock specifically because you don't want anybody to try to modify the stuff at the same time as you because this is synchronous communication Not asynchronous as the previous one. So these guys modifying two items all the locks are got here So here I'm mixing two applications the trans draw and papino to investigate what is going on When you finish your modification the locks are released and the update is sent to the other users We managed to make a client for g-phones. It's very slow, but it's working. So at least we did something Just for the effects Okay, so we have another experiment the idea was not to develop ourselves our own application We try the students to do the stuff so we could see whether it's a valid and Programming framework and he was here. There are some students a bit a nice job. They have to do a Small Wikipedia where the articles are stored with key value pairs Every paragraph is a key value and every article is a set of Paragraphs so you can have two people working on the same article but modifying different paragraphs and then when you run your transactions All the paragraph are going to commit be committed or all are going to be refused and then you avoid and then you have to solve your components again This is some code you see this is for updating an article You receive a list of Paragraphs to update and a list of paragraph to delete a transaction what it is it is a procedure goes from here to here Which does a certain amount of read write or remove in this case? I'm just doing two loops one loop here to write all the paragraph that want to update and One loop here to remove all the paragraph that have to delete once I've done everything Physically now I'm going to take all the locks for doing the boxes and I would say to the transaction manager Please commit my transaction and this transaction is going to say yes everything is committed or sorry You have to redo it again. How are you going to know this when you run your transaction? You say? Execute my transaction which is called trans the name of the procedure here with this client and using this Protocol so you can use dynamically which protocol you want to use for your transaction and the client is going to receive the message commit or abort okay, so There's not that much of code for doing an update with transaction and replication and all this stuff So to summarize beer to beer network So it mixes the word peer and beer because it's peer to peer Using beers because beer are a known mean for achieving relaxation. Why relaxation because we use a topology Which is called the relax ring? So it's one relax ring to rule them all that provides self-organization and self-healing with transactional DHT The transactional DC is done with symmetric replication as I said a lot of time already With different protocols using optimistic or pessimistic locking We will like to do something avoiding locks because we know that locks are not so good for distribution This is why actually we end up having the relax ring here, but we need to investigate this in the part of the transactions We are not sure how to do it. So if you want to if you have some idea, please contact us and We'll be happy working with you and Well, I already show you some of the applications We already developed a small wiki done by the students to prove that it was a valid programming framework Distributed transactional drawing Sindac a pepino and for the future work what we would like to do to contribute to the protocol Mancosi Is to have something similar to depth torrents the idea that you can have your files of your package for the distribution Of your package distributed in a peer-to-peer network where you have the key value pairs would be the package and a set of Files so when you upgrade your version of your package you just upgrade some of the files You can retrieve only the files that you need from the different the two steps There are some other stuff that are more interesting about Mancosi that you can see tomorrow in the distro step room They have several presentation, which are really cool Yeah, so that's it for Mancosi so to end up my talk Remember the lightning talk you need to have our last message to give to the people so you remember your talk And my message to you is a beer a day keeps the doctor away Thank you very much