The opinion you have is correct.
opinions are constructed based on your past, what you are thinking is true, you define your own truth based on your past experiences.
@heygandharva the whole plan of WFO is to get these metro cities more and more populated so that the govt can benefit from the cost
thats why in some areas the govt makes the decision that if you want "this" incentive then you have to make these many days wfo.
Q) How does TikTok feed your micro interaction metrics back into its recommendation engine to alter your next video choice instantly without lagging the feed?
so usually if you take platforms like Netflix or Youtube, they process recommendations using a batch processing system -
so its kinda done hourly bases on youtube likes, comments (engagements) or netflix clicks etc etc
but if you follow this same thing in tiktok, it fails, because users want their feed to change the next second their mood changes!, imagine if you use batch processing here, if TikTok relied on batch processing, the app would not react to your changing mood in real time. The core challenge is capturing high throughput user interactions (swipes, watch duration, rewatches) and updating individual user profile vectors within a sub second window, all while serving millions of concurrent users.
The moment you interact with a video, the TikTok client sends an event payload containing highly granular metrics. Instead of hitting a traditional database, these events are split into two streams and pushed to Kafka.
A low latency stream processing engine, like Apache Flink, processes these raw clickstream events in micro windows. It calculates advanced derived featuresβsuch as whether you watched a video past its completion loop threshold in under 50 ms.
TikTok maintains a split feature store to balance realtime responsiveness with heavy model training. Flink writes the computed real time features into an Online Feature Store (using Redis or Aerospike) for microsecond retrievals. Simultaneously, the raw event stream is archived into an Offline Feature Store (Data Lake / Hudi). This offline layer runs massive deep learning training pipelines to update the global model weights daily, while the online store updates individual user profile vectors continuously.
When a user swipes for a new video, the system doesn't score all millions of available videos. It runs a highly optimized three-stage pipeline:
Retrieval (Candidate Generation): Multiple distributed worker nodes pull a few thousand candidate videos using fast vector indexing (like Milvus or FAISS) based on the user's current interests.
Ranking (Heavy Scoring): The system feeds the candidates into a massive deep learning model. This model pulls the user's fresh real-time interaction vector from the Online Feature Store and scores each candidate based on predicted watch time and engagement.
Re ranking: A final fast rules engine ensures the feed isn't repetitive, injecting diversity constraints (e.g., preventing three dance videos in a row) before sending the final list back to the device.
Q) How does Discord route high quality, real time voice chat for millions of concurrent gamers globally with sub second latency and zero server side echo?
so the same problem as in online games, you need more speed over consistent voice data packet delivery, naturally what would you choose? yes UDP is the way, traditional webRTC protocols which use TCP ensure packet delivery and are slow asf when even ONE packet drops, but in such a application where you want speed delivery of voice data packets, discord uses custom webrtc protocols over UDP
now there is another problem -
how does discord handle clubbing all the audio streams inside the voice channel? does it let the sever do it?
The answer is no, it doesnt let the server do the audio stream clubbing, the server only acts as a Selective Forwarding Units (SFUs) which only route audio channels inside them, all the audio streams come to your client and the client does the heavy lifting of mixing all of them in one single audio stream and streaming it to you
and now there is another problem, how can you ensure sub second voice delivery when a person is in japan and germany, the answer is we cannot. so there is definetly gonna be latency cause it is physically impossible for network packets to travel in sub second times for that long distances
but if you wanna deliver a voice packet in the same region, you can do it!, Discord deploys thousands of independent Voice Regional Gateways across the planet. When a server channel opens, a central control plane dynamically allocates the closest physical data center node to the majority of the active callers, keeping the physical data travel distance as short as possible.
To keep audio streams perfectly smooth, Discord completely separates connection management from the actual voice transmission. Actions like joining a room, updating your green speaking ring, or muting your microphone run through a permanent WebSocket Signaling Connection routed to a cloud server. This ensures that even if a massive wave of users mute themselves at the exact same millisecond, the background control data never interferes with the raw audio packet stream.
@CodeWithSravya LC - 400
CF - 150
CC - ~100
built a scalable project which actually helps people for my college students which gained 4k users on the first week of launch, everything done on vercel's free tier, no AI era