upvote
Telegram's servers are far from "distributed worldwide": In fact, it currently has only 5 logical "data center"s, and while DC3 is still on, clues [0] seem to suggest DC3 doesn't actually carry user data at all now, and both DC2 and 4 are in Amsterdam, so essentially they just need to serve 3 locations.

Also, Telegram's protocol design only allows for connecting to user's home DC for any write interactions (except media, which in most cases still is home DC, or a "media DC" alongside the home DC). Bots are based on the same DC of the user, so almost all meaningful interactions will happen only on one DC for any specific bot.

[0]: https://dev.moe/en/3025

reply
My first guess would be replicaton isn't that critical, because a user would mostly interact with an instance that's nearby, and this instance has their data. But the page mentions:

> Games and Tools — including leaderboards, quizzes and more.

A leaderboard that's globally consistent, huh, that's not trivial.

Maybe they just propagate the SQL commands to all their servers...

reply
"My first guess would be replicaton isn't that critical, because a user would mostly interact with an instance that's nearby, and this instance has their data. But the page mentions"

Apparently not

"Each account is associated with a DC upon registration and does not change with the user’s phone number or geographic location. Users cannot freely choose a DC—if connected to the wrong DC, the server returns an error message, requiring the client to connect to the correct DC associated with the account."

according to this source: https://dev.moe/en/3025

Also on the frontpage now:

https://news.ycombinator.com/item?id=48920475

reply
I think there is no replication and each bot runs on a certain server.
reply
I guess the v8 isolate is heavily restricted and sandboxed and can't be used to access the local filesystem
reply