This is how Google Analytics works.

This is how Google Analytics works.

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI

Оглавление (1 сегментов)

Segment 1 (00:00 - 01:00)

This is how Google Analytics works under the hood. An incoming query like: “Get me the sales from my website” is first sent to the Query Manager, which routes the query to a route according to the load balancing algorithm. This query is then sent to relevant child shards According to the key ranges being served by them. who further propagate the query all the way down to the leaf nodes. The leaf nodes are directly connected to disk, where all data is stored in a columnar format optimized for aggregation queries. In most databases, the data is stored in row-wise fashion. For example, a user’s name, country and age is stored as a row. And the next user’s record will also have a name, country and age. To find the average age of users, You have to do a complete scan of all records. Which can be time-consuming. Instead, if you keep all the ages together, Then a much shorter scan will give us all of the relevant data. And finding the avg age here is much easier. In fact, this is improved further with Data Compression. Where NZRLE squeezes the age records into much smaller values resulting in an even faster read. The results are sent upwards all the way to the root, which then returns a response to the client. Popular queries are cached on the root or shard level, reducing the number of hits on the leaves, and in the worst case, they hit the Google File System. One major optimization here is the use of approximations. When an incoming query is propagated onto the leaf nodes, But if any leaf is slow or dead, Google does not wait for the result to come through. Instead, it takes the remaining results, aggregates them, and sends the approximate response. For most use cases, this is good enough. Where a small percentage error doesn’t change the overall business conclusion. This system is called Dremel, and it has been actively used by Google for the past 15 years. You can learn more about this using the link in the description. Thanks for watching! Cheers!

Другие видео автора — Gaurav Sen

Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник