How Peer to Peer (P2P) Network works | System Design Interview Basics

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 47

  • @subhajitadhikary-99
    @subhajitadhikary-99 3 месяца назад +1

    This was an amazing explanation. I can't think of a way better than this to explain such a complex concept in such a simple way. Truly appreciated, keep doing amazing work.

  • @anonymous........
    @anonymous........ 10 месяцев назад +2

    Very well explained 👍

  • @siyaram2855
    @siyaram2855 Год назад +2

    Peer to Peer is such an underrated architecture for building apps.
    It is so good to develop a messaging apps, file sharing, etc

  • @vanilla_bryce
    @vanilla_bryce Год назад +9

    I have always been intrigued by p2p because I know the internet was originally designed to be decentralized to improve its resilience during a nuclear war. Great video!

    • @yyyd6559
      @yyyd6559 28 дней назад

      P2p doesn't necessarily mean decentralized

  • @dhruvasahasrabudhe3159
    @dhruvasahasrabudhe3159 2 года назад +6

    Awesome visualisations, keep up the good work! You definitely earned a subscriber today. I would've loved some more discussion about different gossip protocols :)

    • @ByteMonk
      @ByteMonk  2 года назад +1

      Thank you 🙏. I agree, gossip protocol deep dive can be interesting, I avoided it discussing any further because that is not expected in FAANG/MAANG system design interviews. Please let me know if you have any tech topics in mind that I should cover. Thanks for subscribing!

  • @hemantkapila4317
    @hemantkapila4317 Год назад +2

    Really kickass explanation. Spot on!

  • @ecoholic84
    @ecoholic84 5 месяцев назад +1

    this blew my mind!
    thanks for making learning fun again,

  • @harshkaneria
    @harshkaneria Год назад +2

    Outstanding explanation and visualisation

  • @sde.mahesh.kasana
    @sde.mahesh.kasana Год назад +1

    Impressive video presentation featuring a highly informative exposition with meticulous elucidation and captivating graphical animations, especially for the intricate subject of peer-to-peer network protocols. Your adept simplification of this challenging topic is commendable.

    • @ByteMonk
      @ByteMonk  Год назад

      thank you for the support

  • @tanishq2766
    @tanishq2766 2 года назад +1

    You are doing really great, just do not stop making videos! Thank You So Much For This!

    • @ByteMonk
      @ByteMonk  2 года назад

      Thank you! Hope you checked the system design playlist (Links in description). More to come :)

  • @alberts6096
    @alberts6096 Год назад +2

    I have not much knowledge about networking but I can't believe the p2p solution is better in this case. Each peer needs the 999 pieces. That means for one client 999 downloads and 999 uploads. Also a little time extra: A server has to cut the videos and sent each piece to a client (even though this process will work in parallel to clients sending pieces to each other).
    I didn't checked your math, I don't say you are wrong, I just can't believe it.

  • @sonomiabyrd643
    @sonomiabyrd643 2 месяца назад

    It's reminds me of the difference between direct and alternating current...

  • @ArjunAnil93
    @ArjunAnil93 2 года назад +2

    Thank you for this amazing video with clear explanation ❤️

    • @ByteMonk
      @ByteMonk  2 года назад +1

      Thank you 🙏. Please check out my system design playlist for similar videos, more coming soon.

    • @ArjunAnil93
      @ArjunAnil93 2 года назад

      Sure, waiting for new videos 👍

  • @alonhalimi
    @alonhalimi 2 года назад +1

    Super-clear, thanks a lot !

    • @alonhalimi
      @alonhalimi 2 года назад

      I have a question
      In your example, why do you say step 2 takes 0.001 second?
      The Red server sends 5MB to node 1, but at the same time Node 1 sends 5BM to Node 2
      So this means that 10MB are simultaneously transmitted on the SAME 5GB/sec LAN, which should take 10/5000 = 0.002 second
      Same for step 3 - the following operation happen simultaneously:
      - Red sends 5MB to Node 1
      - Node 1 sends 5MB to Node 2
      - Node 2 sends 5MB to Node 3
      So this means that 30MB are simultaneously transmitted on the SAME 5GB/sec LAN, which should take 15/5000 = 0.003 second
      etc...
      Did I miss anything?
      Thanks in advance for your answer :)

  • @hexa345
    @hexa345 11 месяцев назад +1

    Great video 👍

  • @kashishchakarvarti8990
    @kashishchakarvarti8990 13 дней назад +1

    Amazing

  • @mukuljaitu
    @mukuljaitu Год назад +1

    Very helpful

  • @lightsupmedia739
    @lightsupmedia739 Год назад +1

    🔥

  • @shirish2005
    @shirish2005 Год назад +1

    Nice explanation keep it up .

  • @sameerkrbhardwaj7439
    @sameerkrbhardwaj7439 Год назад +3

    Hi I have one doubt here the time to send file from server to pear and pear to pear will same ? my understanding says that network throughput of server is much much higher than peer machine network through put.
    For eg peer machine 1 and peer machine 2 will not have same network throughput as big company infrastructure have.

    • @ByteMonk
      @ByteMonk  Год назад +2

      Great question, its a little long answer which I haven't covered in the video
      In a peer-to-peer (P2P) network, sending a file from a server to a peer and sending a file from one peer to another can be different processes, depending on the type of P2P network and the file-sharing application being used.
      In a decentralized P2P network, where there is no central server, files are shared directly between peers. In this case, sending a file from one peer to another is the same as sending a file from a server to a peer, as both involve transferring the file between two connected devices. The file is typically split into smaller pieces and distributed among multiple peers, allowing for faster and more efficient sharing.
      In a centralized P2P network, where there is a central server that facilitates file sharing, the process of sending a file from a server to a peer may be different from sending a file from one peer to another. In this case, the file may be first uploaded to the central server, which then distributes the file to the requesting peer. Sending a file from one peer to another may still involve splitting the file into smaller pieces and distributing them among multiple peers.
      Overall, the method of sending files in a P2P network depends on the specific network architecture and file-sharing application being used.
      Hope this helps!

    • @sameerkrbhardwaj7439
      @sameerkrbhardwaj7439 Год назад

      @@ByteMonk thanks

  • @govardhanreddy690
    @govardhanreddy690 Год назад +1

    Thank you 💖😊

  • @ahmetkarakartal9563
    @ahmetkarakartal9563 Год назад +1

    thank you so much

  • @ahmedshakeel17
    @ahmedshakeel17 10 месяцев назад

    Hi,
    I have a question.
    5 Giga bytes / second = 5 mega bytes / 0.001 second.
    So in other words the total network throughput is 5 mega bytes per 0.001 second.
    In that case how are we able to transfer more than one 5 mega byte chunk between the time interval 0.001 and 0.002?
    Does that mean that the throughput we are talking about is for each device and not the sum of all?
    PS: My apologies if I said something dumb, it's just that I have been really trying to get my head around this calculation.

    • @MrLeojrz
      @MrLeojrz 3 месяца назад

      I second this.. maybe someone could clarify?

  • @amanbhardwaj5318
    @amanbhardwaj5318 Год назад +1

    How do you make these animation videos?? I do have a youtube channel around system design as well and continuously strive to improve the quality with content and editing, i use final cut pro x. You videos seems high in quality in content and with cool animations as well.
    Your inputs will help me.

    • @ByteMonk
      @ByteMonk  Год назад

      Thank you and all the best! I use FCP and Adobe

  • @AbhiShake-pl3cf
    @AbhiShake-pl3cf 29 дней назад

    I didnt get how it takes 0.9s to get other chunks. The peers wouldnt have 5gbps bandwidth right?

  • @srawat1212
    @srawat1212 Год назад

    I believe 0.999 seconds calculation is wrong. The peers won't have the network bandwidth of 5GBps so they cannot download the 999 - 5MB files in ~1sec.

    • @ByteMonk
      @ByteMonk  Год назад

      The total network throughput of a data center typically depends on the size and scale of the data center, as well as the types of applications and workloads that are running.
      For example, Google's data centers have a total network capacity of over 100 Tbps. This means that all of the servers in Google's data centers can communicate with each other at a rate of over 100 Tbps.
      The total network throughput of a data center is not the same as the bandwidth of each individual server. The bandwidth of each server is the maximum rate at which that server can communicate with other devices on the network. However, the total network throughput is the sum of the bandwidth of all of the servers in the data center.

    • @ByteMonk
      @ByteMonk  Год назад

      To clarify further, the network throughput speed of a data center is not necessarily based on the number of machines in the network. The network throughput is the maximum rate at which data can be transferred between any two points in the network.
      Time taken = File size / Network throughput * Number of machines
      Time taken = 5 GB / 5 Gbps * 1000 machines
      Time taken = 1000 seconds
      To calculate the time it would take one machine to receive a 5MB file from a data center with a total network throughput of 5 Gbps, we can use the following formula:
      Time taken = File size / Network throughput
      Time taken = 5 MB / 5 Gbps
      Time taken = 0.0009765625 seconds
      To calculate the time it would take one machine to get all 1000 5MB files from a data center with a total network throughput of 5 Gbps, we can use the following formula:
      Time taken = Total file size / Network throughput
      Time taken = (1000 files * 5 MB/file) / 5 Gbps
      Time taken = 0.9765625 seconds
      This means that it would take one machine about one second to get all 1000 5MB files from a data center with a total network throughput of 5 Gbps.
      However, it is important to note that this is just a theoretical calculation. In practice, the actual time taken may be slightly longer due to factors such as network overhead and the performance of the machine.
      Hope this helps 🤘

    • @srawat1212
      @srawat1212 Год назад

      Thanks for the response. That makes sense but I believe in most practical scenarios P2P is a good choice when all the peer machines are not situated at the same data center. Thoughts ?

    • @ByteMonk
      @ByteMonk  Год назад +1

      @@srawat1212 Whether or not peer machines should be stored in different data centers depends on a number of factors, including the size of the file, the number of peers, and the location of the peers.
      If you are downloading a huge file from a large number of peers, it can be beneficial to have the peers stored in different data centers. This is because it will help to reduce the load on any one data center. Additionally, it can help to improve the performance of the download, as the peers will be able to access the file from multiple data centers.
      However, if you are downloading a smaller file from a small number of peers, it may not be necessary to have the peers stored in different data centers. In fact, it may be faster to download the file if the peers are all stored in the same data center.
      Here we have split the file into small chunks for the same reason. if you have peers in different parts of the world, you may want to choose a data center that is centrally located to minimize latency. This is especially important if you are downloading a file that is sensitive to latency, such as a streaming video file.

  • @Biggie-bq5bk
    @Biggie-bq5bk 11 месяцев назад

    I'm here after multiple payment processors sent me through tunnels just to transfer money to people

    • @ByteMonk
      @ByteMonk  10 месяцев назад +1

      Video on payment processors coming soon :)

    • @Biggie-bq5bk
      @Biggie-bq5bk 10 месяцев назад

      @@ByteMonk Need it got those notifications on 🔥

  • @AmanBawane-o9q
    @AmanBawane-o9q Месяц назад +1

    Thanks brthr

  • @siyaram2855
    @siyaram2855 2 года назад +1

    🔥