Join us

How Tik Tok’s Engineering Works


Tik tok is one of the most popular social media platforms amongst generation Z. With over 2.3 billion all-time downloads and over 1.5 billion active monthly users, how does it work?

The tik tok algorithm prides in itself at keeping the users on the app for over 10 minutes. This impressive number is three times longer than Instagram. The algorithm works in two ways. One for the content creator and the other for the millions of viewers.

Content Creators

When a content creator uploads a video, it is evaluated by a computer vison algorithm. This algorithm analyses everything in the video, to rate it in the correct category.

Then there is the NLP algorithm which analyses the metadata of the video and transcribes the audio of the video, to get a better understanding of the content.

Once the machine learning algorithms have collected the little information about you, it will boost your video to a small number of users in the platform.

Source: Tik Tok Marketing

Once the video is boosted to a small audience, its performance will be evaluated. The performance is tracked on a matric score:

Rewatch Rate = 10 points

Completion Rate = 8 points

Shares = 6 points

Comments = 4 points

Likes = 2 points

Unlike other social media platforms that rate follows, likes and comments higher. The tik tok algorithm prioritizes the rewatch rate assigning 10 points to it, followed by completion rate with 8 points, then the rest follows. The more people who rewatch your video and complete it, the higher your rating.

However you cannot fool your video by letting it play in an endless loop, the algorithms will only count once as the metrices are calculated per user.

Tik Tok Content Flow

Source: booster

  • User posts a video
  • Video is analyzed by the machine learning algorithms, which leave no stone unturned, and assesses everything from the meta-data, audio and images.
  • Once the analyses is complete, the video is approved and gets pushed to a small audience.
  • The machine learning algorithm decides which audience will be best suited for the video.
  • The video is then pushed to the users. The users interact with the video and the metric score then does an evaluation, based on this. Depending on the score, the video is then rated as successful or unsuccessful, if the video is unsuccessful then the life cycle of the video ends. If the video had a successful performance, it is then pushed back to a bigger audience, and go through the whole process again.

New Users/Viewers

As a viewer you are not responsible for creating content, you just want to watch the content. The machine learning algorithms have to learn as much as they can about you as a viewer, so that they can recommend videos appropriately.

When you open the mobile application, you land into tic toks for you video feed, without needing to sign up. At this point tic tok is learning as much as it can about you. The first batch of videos are meant to keep you in the app for as long as possible and understand what type of content you like. This is done by showing you videos that are classified as having a high engagement rate and a low exit rate.

Of the videos you interact with, attention is paid to which videos you rewatch, complete, hashtags, trends. The score for viewers is as follows:

  • Rewatch Rate = 10
  • Completion Rate = 8
  • Shares = 6
  • Comments = 4
  • Likes = 2

Data Flow

Source: DataSadak

tik tok is a read heavy system, the amount of viewers is more than that of the content creators. This could equate to a ratio of 1:100.

The video initially goes through the upload API and then moves to the feature engineering part. This feature engineering part takes care of the categorization of the video, verification, analyses of the metadata, images, sound basically, this is the machine learning algorithms, assessing the video as best as they can.

The entire video processing is done at this stage. Depending on the video, two things will happen. A 30 second video is broken down into 4 parts, a 10 second video just goes through all stages of the video. For the 30 seconds video the video file is then broken down into various chunks, these need to be converted into 4 different processes.

  • The first process is converting the file into different formats.
  • Second is to convert the chunks into different resolutions
  • What is stored as one file will be 8 to 16 copies of that file.
  • Now these are uploaded into Amazon S3 buckets

The Amazon S3 buckets form the first part of the storage process; One video will have different files according to the supported resolutions and formats. The files are uploaded to the S3 buckets according to region and demographics of users, if the file is not accessible in one region then it can be accessed in the other region.

To achieve this we have the Amazon S3 and the tic toks CDN (Akamai) is used, A CDN ensures the videos are always available, even if a a regional node may be down.

So when a user wants to view a specific video, the feature engineering service checks the user database for the video as well as the video meta data database. The algorithm then combines this with user details, to deliver the video through their nearest region and if their region is down, the other region next to them.

Additional Reading:

Only registered users can post comments. Please, login or signup.

Start blogging about your favorite technologies, reach more readers and earn rewards!

Join other developers and claim your FAUN account now!


The Maths Geek 🤓

Mathematician | Software Engineer | Amazonian| Open Source | Blogger | Ban Killer Robots
User Popularity



Total Hits



Mentioned tools