Kiki's Bytes
Kiki's Bytes
  • 25
  • 983 141
How Discord Reduced Traffic Bandwidth by 40%
In this video we are going to learn how Discord managed to reduce their traffic bandwidth by 40%.
Edit:
- at 00:02:20 - the encoding for a and c are swapped. A was supposed to be 01 and c just 1. Thank you @fgardt for catching this.
References:
- Original discord article - discord.com/blog/how-discord-reduced-websocket-traffic-by-40-percent
- LZ77 Compression - learn.microsoft.com/en-us/openspecs/windows_protocols/ms-wusp/fb98aa28-5cd7-407f-8869-a6cef1ff1ccb
- Huffman coding - www.geeksforgeeks.org/huffman-coding-greedy-algo-3/
- zlib - github.com/madler/zlib
- zstandards - facebook.github.io/zstd/
- dictionary compression - en.wikibooks.org/wiki/Data_Compression/Dictionary_compression
Timeline:
- 00:00:00 - intro
- 00:00:16 - Discord comm service intro
- 00:00:26 - What is Zlib
- 00:00:44 - LZ77 Compression
- 00:01:47 - Huffman coding
- 00:02:38 - zstandard
- 00:03:05 - Dictionary compression
- 00:03:40 - Initial experiment
- 00:04:40 - Streaming compression
- 00:05:46 - passive_update_v2
- 00:06:35 - further optimization attempts
- 00:07:34 - Implementation and rollout
- 00:07:55 - Ending
Video credits:
Video by Pressmaster from Pexels: www.pexels.com/video/digital-projection-of-the-earth-mass-in-blue-lights-3129957/
Deploying code - Video by olia danilevich from Pexels: www.pexels.com/video/a-man-using-laptop-4974708/
ptsd - Video by MART PRODUCTION from Pexels: www.pexels.com/video/a-woman-in-a-therapy-session-7698472/
forgetting someone' name - th-cam.com/video/UJVW-DkSgOc/w-d-xo.html
Music credit:
- ♪ [non copyright music] Lofi Type Beat - Saturday Morning | aesthetic lofi music / Lofiru Link : [![](www.gstatic.com/youtube/img/watch/yt_favicon.png) • [non copyright music] Lofi Type Beat ...](th-cam.com/video/LEMZctXCN7Q/w-d-xo.html)
มุมมอง: 85 736

วีดีโอ

How Notion Scaled to 100 Million Users Without Their Database Exploding
มุมมอง 243Kหลายเดือนก่อน
In this video, we will explore how Notion managed to scale to 100 million users without exploding their database. References: - Data Model - www.notion.so/blog/data-model-behind-notion - When they first sharded - www.notion.so/blog/sharding-postgres-at-notion - re-shard - www.notion.so/blog/the-great-re-shard Credits: - Video by Tima Miroshnichenko from Pexels: www.pexels.com/video/tired-man-us...
I ACED my Technical Interviews knowing these System Design Basics
มุมมอง 19K2 หลายเดือนก่อน
In this video, we're going to see how we can take a basic single server setup to a full blown scalable system. We'll take a look at key concepts that you need to know - like load balancing, caching and databases - in a way that's easy to understand. Whether you're prepping for interviews or just curious about how big tech works, this video's got you covered Resources: Distributed System - www.s...
This 10x Engineer built an MVP that scaled to process BILLIONS of events
มุมมอง 12K2 หลายเดือนก่อน
PostHog is 100% free to try out, no credit card required. Visit posthog.com/kikisbytes to learn more. In this video we will explore how PostHog built an mvp to allow users to be able to add and customize their event data. We will start with what they built for an mvp, the challenges they faced and the solution that they came up with to resolve the issues. Timeline: - 00:00:00 - Intro - 00:00:11...
How DoorDash Uses AI in Their Architecture to Handle Millions of Data
มุมมอง 7K3 หลายเดือนก่อน
THANK YOU for 15k subs!!! I really appreciate everyone taking the time out of their day to watch my videos. I'm so excited to share more videos with you all! In this video we will explore how DoorDash used AI to enhance millions of products. DoorDash article reference: doordash.engineering/2024/04/23/building-doordashs-product-knowledge-graph-with-large-language-models/ Credits: Videos 📺: - New...
How Canva Saved Millions in AWS S3 Costs
มุมมอง 196K3 หลายเดือนก่อน
In this video we will explore how Canva managed to save million of dollars from their AWS bills. References: Canva Article: www.canva.dev/blog/engineering/optimising-s3-savings/ Videos: - Video by Pressmaster from Pexels: www.pexels.com/video/digital-projection-of-the-earth-s-mass-in-orange-lights-3129902/ - Video by Produtora Midtrack from Pexels: www.pexels.com/video/a-person-using-a-laptop-1...
How Does ReactJs Stay Fast? Virtual DOM in 3 Minutes!
มุมมอง 3.7K4 หลายเดือนก่อน
In this short video, we will explore how React efficiently updates your UI without slowing down your app using Virtual DOM. Timeline: 00:00:00 - Intro 00:00:08 - React's Component 00:00:43 - Dom vs VDom 00:01:21 - Fiber Tree 00:01:55 - Reconciliation 00:02:49 - Ending Reference: - pomb.us/build-your-own-react/ - react.dev/
A Closer Look At Docker | The Basics
มุมมอง 4.7K5 หลายเดือนก่อน
Hello and welcome back!! 👋 In this video we will take a look at what docker is, the history of docker, how to set up docker and a demo on how to actually build something like docker container from scratch. I hope that this video is useful for those trying to better understand this technology that most of us use on a daily basic. Github: github.com/kikisbytes/container-from-scratch Timeline: - 0...
Inside Uber's Software Engineering: Scaling Request Handling
มุมมอง 4.4K7 หลายเดือนก่อน
Original Article: www.uber.com/en-SG/blog/better-load-balancing-real-time-dynamic-subsetting/ Hi!! 👋 Welcome to my channel and thank you for taking the time to watch this video. In this video, we will be exploring how Uber managed to serve millions of requests using their service mesh architecture. The service mesh architecture is used to power their mission critical services since 2016. I hope...
How Instagram Scaled to 14 Million Users With Only 3 Engineers
มุมมอง 79K7 หลายเดือนก่อน
In this video, we will explore how Instagram managed to scale so well with only 3 engineers in their early days. Corrections: - th-cam.com/video/TdhXPsDXdAI/w-d-xo.html , I meant to say "not to be confused sql schema of a table" As requested description of each technology has been added below. Timelines: - 00:00:00 - Intro - 00:00:14 - Webservers - 00:00:50 - Postgres - 00:02:27 - Sharding (uni...
This single line of code cost AT&T $60,000,000!
มุมมอง 15K8 หลายเดือนก่อน
In this video we are going to explore an issue that caused AT&T to lose over $60 million dollars. Original Article: - users.csc.calpoly.edu/~jdalbey/SWE/Papers/att_collapse Timeline: 00:00:00 - Intro 00:00:20 - AT&T Network walkthrough 00:01:10 - The issue 00:02:18 - Root cause 00:03:14 - Takeaways 00:04:05 - Ending Credits: 1. Frustrated person video by Tima Miroshnichenko: www.pexels.com/vide...
How Pinterest Scaled to 11 Million Users With Only 6 Engineers
มุมมอง 110K9 หลายเดือนก่อน
In this video, we will be exploring how Pinterest managed to scale to 11 million users with only 6 engineers. We are going to explore their early tech stacks, issues they ran into with scaling and how they overcame those obstacles. Original article link: highscalability.com/blog/2013/4/15/scaling-pinterest-from-0-to-10s-of-billions-of-page-views-a.html Timeline: 00:00:00 - Intro 00:00:10 - Back...
This single query costs $1,000,000 a month!
มุมมอง 124K10 หลายเดือนก่อน
Intro style inspiration from @kevinfaang . Happy new year everyone! In this video, we'll explore how a single query would have cost Shopify almost $1mill dollars USD per month. This just goes to show how important it is to understand the system that you're using to avoid accruing unnecessary costs. Article: shopify.engineering/reducing-bigquery-costs Timeline: - 00:00:00 - Intro - 00:00:16 - Da...
How Discord Managed To Store BILLIONS Of Messages With This Database
มุมมอง 22K11 หลายเดือนก่อน
In this video we will be going over the blog post by discord on how they were able to store billions of messages. You can expect to learn about the process of transitioning from MongoDB to Cassandra and all the different issues that they ran into. Article by Discord: discord.com/blog/how-discord-stores-billions-of-messages Timeline: 00:00:00 - Intro 00:00:20 - Why Mongo started to see issues 00...
Svelte Runes - A Good or Bad Update?
มุมมอง 3.8Kปีที่แล้ว
Svelte Runes - A Good or Bad Update?
Is Bun's runtime performance better than NodeJs?
มุมมอง 2.2Kปีที่แล้ว
Is Bun's runtime performance better than NodeJs?
Is Bun Worth The Hype?
มุมมอง 2.6Kปีที่แล้ว
Is Bun Worth The Hype?
What Happend To HATEOAS in RESTful API? | Pre HTMX
มุมมอง 9Kปีที่แล้ว
What Happend To HATEOAS in RESTful API? | Pre HTMX
Stop Using Mocks In Unit Tests
มุมมอง 1.5Kปีที่แล้ว
Stop Using Mocks In Unit Tests
Web dev without using Javascript??? | HTMX
มุมมอง 11Kปีที่แล้ว
Web dev without using Javascript??? | HTMX
Is Svelte Worth The Hype?
มุมมอง 13Kปีที่แล้ว
Is Svelte Worth The Hype?
Escaped Another Tutorial Hell | Neovim
มุมมอง 5Kปีที่แล้ว
Escaped Another Tutorial Hell | Neovim
The TRUTH About Landing Your First Software Engineering Job
มุมมอง 3.3Kปีที่แล้ว
The TRUTH About Landing Your First Software Engineering Job
Software Engineer Onboarding Like A Pro
มุมมอง 1.6Kปีที่แล้ว
Software Engineer Onboarding Like A Pro

ความคิดเห็น

  • @APDesignFXP
    @APDesignFXP 7 ชั่วโมงที่ผ่านมา

    I really like those videos, very informative and interesting. You got a new subscriber.

  • @vihaanthebot429
    @vihaanthebot429 21 ชั่วโมงที่ผ่านมา

    The animations look awesome!

  • @45545videos
    @45545videos วันที่ผ่านมา

    Common zstd W

  • @protogen_1414
    @protogen_1414 2 วันที่ผ่านมา

    HEEELLL YEAHH got me rolling for some reason

  • @pawanterdal2261
    @pawanterdal2261 2 วันที่ผ่านมา

    Sick graphics !

  • @arthurguedes2461
    @arthurguedes2461 3 วันที่ผ่านมา

    Such an amazing Video! Thanks

  • @TracyGal
    @TracyGal 4 วันที่ผ่านมา

    40% reduction in traffic huh? Can I have my 25mb upload limit back discord?

  • @Dactarium
    @Dactarium 4 วันที่ผ่านมา

    Bc Discord banned in Turkey and Russia 😢

  • @yofukashino_
    @yofukashino_ 4 วันที่ผ่านมา

    5:18 company of culture with no linux support ;-;

  • @pazaresosset6348
    @pazaresosset6348 4 วันที่ผ่านมา

    first time I hear about htmx

  • @Stefan-qk8sw
    @Stefan-qk8sw 4 วันที่ผ่านมา

    tldr: They switched libraries and removed unnecessary payload.

  • @dvskr1
    @dvskr1 5 วันที่ผ่านมา

    Lambdas could have been used .. nowadays every cloudprovider offers this kind of functionality.. Use k8s to autoscale pods amd autoscale worker nodes

  • @MAXderskibidirizzler
    @MAXderskibidirizzler 5 วันที่ผ่านมา

    Interesting

  • @MightyElemental
    @MightyElemental 6 วันที่ผ่านมา

    It's a shame discord is crap now, especially the android app

    • @eyepatchonmyear1318
      @eyepatchonmyear1318 วันที่ผ่านมา

      I get so many glitches during voice calls it's ridiculous. UI buggy as hell

  • @klazzera
    @klazzera 7 วันที่ผ่านมา

    discord lost all of its turkish users that can also skew data

  • @WillFuI
    @WillFuI 7 วันที่ผ่านมา

    This is cool, but I’m still upset. I can’t upload 25 MB files anymore.

  • @Treviath
    @Treviath 8 วันที่ผ่านมา

    One thing discord could do to save bandwidth would be to hash all files and checking the hash against a file database before actually sending the file to the server. Firstly it would reduce bandwidth usage and secondly it would reduce storage usage.

  • @OhhCrapGuy
    @OhhCrapGuy 8 วันที่ผ่านมา

    1:35 That's not exactly how it would compress, interestingly. The more efficient way is A B C (3, 6, EOF) This looks like "Write A, then B, then C. For the next 6 characters, copy the character that's 3 characters back from the position you're writing." (0 indexed) When you write the [3] letter, you're copying whatever letter is 3 positions back, [0]. Then for [4], [1] is 3 positions back. [5] is [2], and this is key: [6] is copied from [3], data that has not been written when we started copying!

  • @sambailor
    @sambailor 8 วันที่ผ่านมา

    amazing video, probably my favorite beginner system design video that I've watched

  • @taylorjohnsonct
    @taylorjohnsonct 9 วันที่ผ่านมา

    Imagine being the new guy on the DB team at Notion...

  • @graemepicataggio9814
    @graemepicataggio9814 9 วันที่ผ่านมา

    They got a pizza party and a nice work pal🎉

  • @Ktoyatakoiskazhimne
    @Ktoyatakoiskazhimne 9 วันที่ผ่านมา

    They could reduce traffic bandwidth by even further with p2p networking. Just send CRC of an image, and then force clients to find the image by themselves with a timeout, if there's no image among the other peers, send one from server. So in a large servers, the more people saw some image, the more you have peers for this image

  • @vlc-cosplayer
    @vlc-cosplayer 10 วันที่ผ่านมา

    They banned PDF files? 🤔

  • @lightning_11
    @lightning_11 10 วันที่ผ่านมา

    Wait, people still optimize their electron apps? Truly a company of cuture.

  • @ten8468
    @ten8468 11 วันที่ผ่านมา

    My understanding is that they are using Scylla now instead of Cassandra since longer than this video was released.

  • @yoursweetyguy
    @yoursweetyguy 12 วันที่ผ่านมา

    how do you know?

  • @mlocate
    @mlocate 14 วันที่ผ่านมา

    Having a record for each block of the document is crazy, I wonder what was the reason behind this decision.

  • @qwzr7083
    @qwzr7083 15 วันที่ผ่านมา

    Can you make another 10 minutes video for each approach you mentioned? More into depth , so it’s easier to remember

  • @tajniak0811
    @tajniak0811 16 วันที่ผ่านมา

    Why not noSQL?

  • @rlywhocares
    @rlywhocares 16 วันที่ผ่านมา

    yo what software you made this with (icons, animations)?

  • @yomanthunder
    @yomanthunder 17 วันที่ผ่านมา

    Wonderful video, please make a video series on system design

  • @blue_lobster_
    @blue_lobster_ 17 วันที่ผ่านมา

    thank you for this good explanation

  • @KrishnaDasPC
    @KrishnaDasPC 17 วันที่ผ่านมา

    Currently building product with postgres this gives me nightmares 😢

  • @Daniel-i8v2i
    @Daniel-i8v2i 17 วันที่ผ่านมา

    what do you think about CockroachDB?

  • @Daniel-i8v2i
    @Daniel-i8v2i 17 วันที่ผ่านมา

    why not just use cockroachdb instead of manually sharding

  • @tomaszbogusz7246
    @tomaszbogusz7246 18 วันที่ผ่านมา

    Pure gold!

  • @jaysonp9426
    @jaysonp9426 19 วันที่ผ่านมา

    Anyone complaining about the engineers not getting their share... Go start your own company or accept that you're owned by someone else.

    • @yunis5097
      @yunis5097 5 วันที่ผ่านมา

      Sure that’s how we solve problems, everybody should have their own company. That’s a great Idea, everybody should have their own country too, so they can make their own laws. At that point just have your own planet. That’s a stupid way to think. Just accepting obvious injustices and not unionising is the first mistake.

  • @annyone3293
    @annyone3293 19 วันที่ผ่านมา

    By getting banned in Russia, haha!

  • @wildtom
    @wildtom 20 วันที่ผ่านมา

    I was expecting some amazing compression, but this works too

  • @commandcracker42
    @commandcracker42 20 วันที่ผ่านมา

    1. use gleam 2. Use Gleam 3. USE GLEAM

  • @Jamesaepp
    @Jamesaepp 20 วันที่ผ่านมา

    5:48 Woooooow, almost like reducing the amount of data you send in the first place is more important than the compression you apply after the fact. Who could have guessed? Truly the most incredible engineering feat of all time.

    • @kronik907
      @kronik907 17 วันที่ผ่านมา

      This was my takeaway as well lol

    • @wormsquirm2707
      @wormsquirm2707 11 วันที่ผ่านมา

      You sound salty

    • @Jamesaepp
      @Jamesaepp 10 วันที่ผ่านมา

      @@wormsquirm2707 a little. I take issue with the likes of discord taking away what was once a popular paradigm - people self hosting their VCs with software like ventrillo or team speak. Now all of this user data is going to a company - who knows how it will be used against us long term.

  • @gibarel
    @gibarel 20 วันที่ผ่านมา

    Some day discord will managed to reduce their bandwidth usage by 100% by making their clients so bloated and with every feature behind a paywall so everyone will just use something else.

  • @radhithyarkondaveeti
    @radhithyarkondaveeti 21 วันที่ผ่านมา

    Good video. But, I thought youll would talk more than the compression algorithms, aren't they only used for the files? Just a question.

  • @poghuman8676
    @poghuman8676 21 วันที่ผ่านมา

    3:18

  • @nomadshiba
    @nomadshiba 21 วันที่ผ่านมา

    6:06 yeah i realized that years before. i was like, "why?"

  • @yasararafath3524
    @yasararafath3524 21 วันที่ผ่านมา

    we also faced same situation in MongoDB, We did successfully migration to sharded db using mongo sync tool, We had 3TB of production data and heavy read traff and minimal writes , we did without any downtime for read calls and for write 50s we had to stop the writes to sync all data b/w two clusters, it was long 6 months effort to do it successfull

  • @eliyahubasa9401
    @eliyahubasa9401 22 วันที่ผ่านมา

    Great video, thank you

  • @hill2750
    @hill2750 22 วันที่ผ่านมา

    I wish I could improve by 40%

  • @dacjames
    @dacjames 22 วันที่ผ่านมา

    Yeah, engineers won’t be getting bonuses for doing their job.

  • @nessitro
    @nessitro 22 วันที่ผ่านมา

    Really nice video! big bonuses -> large pizza party hahaha