- 25
- 983 141
Kiki's Bytes
เข้าร่วมเมื่อ 20 มี.ค. 2023
I want to be like ThePrimeagen when I grow up.
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)
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...
Is Bun's runtime performance better than NodeJs?
มุมมอง 2.2Kปีที่แล้ว
Is Bun's runtime performance better than NodeJs?
What Happend To HATEOAS in RESTful API? | Pre HTMX
มุมมอง 9Kปีที่แล้ว
What Happend To HATEOAS in RESTful API? | Pre HTMX
Web dev without using Javascript??? | HTMX
มุมมอง 11Kปีที่แล้ว
Web dev without using Javascript??? | HTMX
The TRUTH About Landing Your First Software Engineering Job
มุมมอง 3.3Kปีที่แล้ว
The TRUTH About Landing Your First Software Engineering Job
I really like those videos, very informative and interesting. You got a new subscriber.
The animations look awesome!
Common zstd W
HEEELLL YEAHH got me rolling for some reason
Sick graphics !
Such an amazing Video! Thanks
40% reduction in traffic huh? Can I have my 25mb upload limit back discord?
Bc Discord banned in Turkey and Russia 😢
5:18 company of culture with no linux support ;-;
first time I hear about htmx
tldr: They switched libraries and removed unnecessary payload.
Lambdas could have been used .. nowadays every cloudprovider offers this kind of functionality.. Use k8s to autoscale pods amd autoscale worker nodes
Interesting
It's a shame discord is crap now, especially the android app
I get so many glitches during voice calls it's ridiculous. UI buggy as hell
discord lost all of its turkish users that can also skew data
This is cool, but I’m still upset. I can’t upload 25 MB files anymore.
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.
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!
amazing video, probably my favorite beginner system design video that I've watched
Imagine being the new guy on the DB team at Notion...
They got a pizza party and a nice work pal🎉
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
They banned PDF files? 🤔
Wait, people still optimize their electron apps? Truly a company of cuture.
My understanding is that they are using Scylla now instead of Cassandra since longer than this video was released.
how do you know?
Having a record for each block of the document is crazy, I wonder what was the reason behind this decision.
Can you make another 10 minutes video for each approach you mentioned? More into depth , so it’s easier to remember
Why not noSQL?
yo what software you made this with (icons, animations)?
Wonderful video, please make a video series on system design
thank you for this good explanation
Currently building product with postgres this gives me nightmares 😢
what do you think about CockroachDB?
why not just use cockroachdb instead of manually sharding
Pure gold!
Anyone complaining about the engineers not getting their share... Go start your own company or accept that you're owned by someone else.
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.
By getting banned in Russia, haha!
I was expecting some amazing compression, but this works too
1. use gleam 2. Use Gleam 3. USE GLEAM
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.
This was my takeaway as well lol
You sound salty
@@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.
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.
Good video. But, I thought youll would talk more than the compression algorithms, aren't they only used for the files? Just a question.
3:18
6:06 yeah i realized that years before. i was like, "why?"
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
Great video, thank you
I wish I could improve by 40%
Yeah, engineers won’t be getting bonuses for doing their job.
Really nice video! big bonuses -> large pizza party hahaha