Ask HN: Techwise, how did TikTok get so good?
You may like or dislike Tiktok based on it's content and style of delivering that content but I think everyone has to admit that technically it is quite the achievement.
It's video based and delivers video really well. It rarely buffers or fails to load. Compare that to the Reddit video player or the Twitter video player or Vimeo. It's much better. Netflix loads poorly initially for me quite a bit (granted it's trying to load much higher quality).
How did they manage to get the engineering talent when seemingly FB, MS, Netflix, Amazon, Google are all fighting for that talent?
151 comments
[ 5.1 ms ] story [ 45.2 ms ] threadTikTok is a Chinese company. The source code is mostly written in China. I'd say that TikTok is the Chinese equivalent of a FAANG company.
They get the talent because the fight is happening in the FAANG space, they are not there.
Chinese FAANG is probably geared more towards hardware, things like Xiaomi and Huawei.
Click the link for "Careers in China" in the footer and filter by R&D: 6526 job openings.
https://jobs.bytedance.com/experienced/position?category=670...
I think Twitter's video servers are also just slow.
As they say, "Good artists copy, great artists steal"...
Being headquartered in a jurisdiction that doesn't care for intellectual property sure must be convenient.
Like… YouTube with their shorts?
A continuous, infinite scroll stream of $media is everything but an original invention, and most likely not protected by any IP law.
1. They only have a queue of videos. That means there is one video playing and they know exactly what the next N videos are going to be, so they can start buffering them early
2. The video plays are high intent. If you launch TikTok, you are 100% going to watch videos. This is not true for Reddit or Twitter, making it harder for them to preemptively buffer content or over-optimize their architecture just for video playback.
3. As you noted, the videos are lower quality and shorter than YouTube or Netflix videos. They also are exclusively optimized for mobile, so don’t need to worry about streaming videos larger than a phone screen.
4. Most videos in your feed might be a similar style. This one is a stretch but I wouldn’t be shocked if TikTok uses some ML to extrapolate highly compressed videos early in the buffer.
5. Depending on who you believe, ByteDance might have financial backing and motivations that make it easier to throw more money at this problem than its American competitors.
Checkout this example:
https://quackquackgo.net/?q=hacker+news&lr=&qqg-date=&qqg-ra...
If so send me an offer, frankly it'd be an improvement.
Also young people scroll for hours (and adults, the average age is above 25 afaik) so watch-time isn't less than on YT, probably even more.
Lastly but most importantly, many people scroll through a huge pile of videos before watching even 10 seconds of an "interesting one" before doing the same thing over and over again, so in effect you are buffering a lot more video than on YT.
They must have absolutely massive infrastructure.
I believe the videos are actually 720p, that may only be on mobile devices though.
I have strong and complicated feelings about how good UX/UI needs to be in software. It often gets ignored especially in B2B settings, but there are certain times where it's so clear how crucial it was to get something right. I think about Spotify compared to Apple Music and how Spotify had a way of preloading songs so they played immediately that Apple Music never quite captured. TikTok definitely had the chops.
The one big technical issue I have noticed with TikTok as a user though, is that their comments go down a lot. It's clear that comments are handled by a different service and it seems way less stable. It's somewhat common to be able to load videos but trying to load the comments leaves you with an endless spinner.
I think Reddit is just especially terrible. They had to write custom code for handling the viewport autoplay, and ... I guess didn't implement everything else correctly.
YouTube has been fine for ages, though, and have great keyboard shortcuts that no PM would ever think to ask people to add. They just added them in 2008 and kept them all working through 5 versions of HTML. Not bad.
American VC can provide almost unlimited money. What it can't do is focus its spending on things that actually work.
The original question frames this in terms of technical talent, but it's not that at all. There are all sorts of US firms and even HN posters who could, given the right spec, come up with as good a solution for the problem of low latency smooth delivery of various videos.
No, the problem is choosing to make the right product. TikTok is good for the same reason that original Whatsapp was good: it had to succeed on its merits, rather than being part of a giant tech company. Whereas how many products has Google launched and then canned in that time? Was Stadia great technologically? Doesn't matter, it's dead.
Conversely, the Reddit video player on web is bad for the same reason that all the rest of the web app is bad: it's supposed to be, because of the dark pattern monetization that's supposed to force you into using the app.
[0]...or at least until being bought out by the big players you mentioned
I also think that for the public feed, people so see similar videos based on demographic etc so there is a form of caching that is likely applied.
Videos are all small clips as well and they're being loaded from TikToks content servers. With reddit and twitter you are often watching a video linked from another website.
I agree, Reddits video player is garbage.
IIRC TikTok for a long time wasn't even using TLS encryption for client-server traffic, which is rare. Whoever is cutting corners like that is very focused on just making the thing work and fixing the issues later, which has its pros and cons. In a US big tech company, experienced devs would throw a fit over things like this and slow down the project to catch those details. I work with people like that. I'm guessing (as not a TikTok employee) that TikTok is more top-down, plus video is its main focus. Maybe they're preloading aggressively, user's battery and data plan be darned.
You still see opt-in proxies, which are at least better in the sense of the user being able to see the config & trust relationship when something breaks.
So it's not hard for me to guess how they do it...
(Yes, background data is now disabled for TikTok on my phone... I learned my lesson)
Are you saying instagram got "massive direct assistance from Uncle Sam and other government entities"? How would you even come up with that opinion?
If you search arxiv.org for bytedance you can see some of the work they have published. I’m sure there is lots more they haven’t.
I suspect a lot of learnings from other products went into the product design of tik tok as well in terms of how to balance exploiting a users knon interests with showing them novel stuff, how to give anything the chance to go viral etc.
This is worthy of it's own question. Why is Reddit's player so uniquely bad? It's worse than any other video player on the entire internet.
Severless often gets touted as being the best way of doing things rather than just a way. My comment was a dig at that.
But it seems like my comment somehow exposes multiple levels of ignorance, would love to know what they all are!
think a "like count" database, it needs to increment and persist. Both very simple, and its implementation is entirely decoupled from the client implementation. Firebase would manage that for you, youd just call firebase functions instead of updating a database yourself.
note: i dont know if this is how tiktok works
Without fail, my experience is:
Play video. Usually works.
Try to replay video. It stops at 4 seconds.
Refresh browser. Now the video is half the size? But it now plays, though tiny.
I don't know who wrote Reddit's video player, but it's obvious they are a masochist. That they still haven't fixed it speaks volumes of their eng org to an end user like myself.
It's why on the Desktop, at least, I always have a https://redditsave.com/ tab opened. It's just way faster (and less frustrating). There's an FF extension that automates this : https://addons.mozilla.org/en-US/firefox/addon/downloader-4-... : which I haven't tested.
*update, a few minutes later: decided to install extension. Looks useful. Now the testing phase...
The various ol., old., and i. subdomains, which still allow access to a functional reddit with a functional video player, are there to keep the old-school power users from revolting, for now, anyway.
I think there were a few things for the business where tech was important:
- being good at serving/storing videos
- the recommendation engine. There are two parts, one is taking user preferences as a strong signal (not a tech decision) and another is recommendation algorithms which produce this effect (I think they’re rote a paper that suggested things about how this worked)
- being an app people wanted to use (weakly tech but mostly not)
I think a some of the explosive growth came from the app having been iterated on a bunch in China first so it seemed more polished when it reached the west. But I could be pretty wrong there.
To answer the question about engineering talent:
- Chinese people will go to the US, get great educations at US universities, some get denied work visas or otherwise choose to return to China. TikTok can employ them in a less competitive labour market and not fight companies like Google which don’t operate in China.
The history of TikTok is actually murkier than that. I listened to a podcast about this, I wish I could find it again. The narrative that seems to be popular is that ByteDance launched this app called Douyin in China and it was so successful they decided to launch it globally, and thus TikTok was born and hit the ground running.
But the podcast I listened to told the story from the perspective of the founders of Musical.ly - which was an app that was started by two Chinese software engineers that were living and working in silicon valley. Originally it was supposed to be a video app about teaching (?) but pivoted and gained a lot of traction with teenagers in the U.S. This is where the origins of TikTok being thought of as a "teen dancing/lip syncing app" came from. Musical.ly got acquired by ByteDance.
- Douyin launched in September 2016 - Musical.ly launched in 2014 and by June 2016 had over 90 million registered users. Around 2016-2017 is when I first remembered seeing videos with the Musically watermark (very similar to the TikTok mark) usually on r/cringe on Reddit. Here's an example: https://www.youtube.com/watch?v=rfT0jRYaovE - ByteDance acquired Musical.ly for almost 1 billion dollars a year after launching Douyin and merged them to create TikTok.
I never used Douyin or Musical.ly, but I think that a lot of Musical.ly's DNA was injected into TikTok and the idea that TikTok was a purely Chinese invention is a little revisionist.
The thing that really cements this to me is that Alex Zhu, one of the Musical.ly founders was the first CEO of TikTok. Also, looking at the type of content in those compilation videos definitely gives me the same vibe. So TikTok actually has roots in silicon valley way more than people think it does.
I think that noting this history is interesting because TikTok is touted as being so purely Chinese, and it's certainly owned entirely by a Chinese company now so I'm not saying any concerns about the Chinese government having access are unfounded. But I think part of the fear around TikTok comes from "How did they create this app that is beating our apps and seems to have the product/market fit of a glove in our society? Have they been planning this?"
But a lot of the iteration and pivoting happened with Musical.ly, in the U.S. and a Chinese company paid through the nose for it.
And I actually think it benefits the Chinese government for this revisionist history of the app to be the story that "wins" - because it portrays China as this mysterious force with previously unknown insight, power, and plans. When in reality the bones of TikTok came directly out of the same place as most new social apps do.
If you look at the Wikipedia article for Musical.ly - it goes through great effort to talk about how it was a Chinese company that happened to have a "Santa Monica office" but if you look at the Crunchbase profile for Musical.ly - the story is different. https://www.crunchbase.com/organization/musical-ly/company_f...
The companies that participated in those funding rounds are not blue chip VCs and do have foreign ties - but they are specifically focused on investing in US startups.
I would love to see a journalist at The Verge or somewhere that writes about tech in the same way tackle this topic. I think it's a missing piece in a lot of the discourse around TikTok.
Is this really true though? I imagine the market for SDEs in china is much more competitive and cut throat. There are only so many locals/immigrants to choose from in the US, hence the higher salaries. A lot of top talent in Silicon Valley have almost worked at all FAANG companies.
Any FAANG engineer or someone who looks at job postings in those areas would know this. The comments I see about TikTok on Hacker News in general are so much more low effort, low knowledge/low research than other areas it is genuinely concerning to me. There's so many blanket assumptions that go unresearched, unchallenged. It's bizarre.
Americans are very proud of their "process". ... Americans love their processes. In their jobs they rarely express their creativity. Conversely, they expend a lot of energy and time adhering to their processes.
Maybe?
You find a video, with a song, that you vibe with. Now, click on the bottom right sound graphic and you can watch ALL the videos produced with that sound and vibe.
It is part of the core product!
So good it's hard to describe :)
i definitely wouldn’t call this evidence that their tech is good though.
1. I thought flash was deprecated by the browser and
2. I thought the industry has moved onto HLS/Dash or stream via websockets for live streaming.
Industry consensus doesn't mean best performance, unfortunately. Maybe it means works well enough for existing participants, but going your own way can be more efficient or less efficient, or a waste of time. Industry solutions tend to take more round trips in search of flexibility, and number of round trips is a big factor in download time if the round trip time is large, as is common on mobile.
- request top level playlist (choice of bitrates, etc)
- request playlist for a particular bitrate
- actually request a segment with some frames in
If you compare this to YouTube, you can tell they've resorted their algorithm back to a more curated list of recommended videos. This blocks new content creators out and keeps the recommended list stale. You can also tell they've weighted videos with the highest ad revenue, so you're more likely to get frustrating long ads with vapid click bait style content. It's no wonder why YouTube lost the top spot of video sites, as they've put advertising ahead of content creators and viewers.
I've bought several products from TikTok ads. I usually never buy things based on online ads. Because their ads are skippable, and have to demonstrate their use instantly, they're very effective. Again, compared to YouTube, their ads tend to focus on long droning corporate agendas and visions. These don't make me want to use the platform.
Systems research people are not valued enough .. my understanding is a bunch (not sure about number) of ex-MSR folks went to ByteDance .. sizable pay bumps.
From what I can recall, TikTok was the first one to let you to swipe to watch/switch videos, so users can easily be stuck on it, no matter the short video's quality is good or bad, interesting or boring. Since one single swipe, you changed to another, the cost is very low for user even the video quality is not good.