←back to thread

141 points winkywooster | 1 comments | | HN request time: 0s | source
Show context
metadat ◴[] No.40216826[source]
> Rama can build end-to-end backends at any scale on its own in a tiny fraction of the code. At its core is a new programming language implementing a new programming paradigm..

Grand claims, but where are the super powerful demo apps? The getting started docs are a trickle of info..

https://redplanetlabs.com/docs/~/operating-rama.html#_access...

The "demo gallery" has a few cherry picked examples, but I don't see how this fulfills the claim of a "new paradigm". I wanted to be blown.. but this ain't it.

https://github.com/redplanetlabs/rama-demo-gallery

Oof.

replies(6): >>40216866 #>>40217060 #>>40217183 #>>40217692 #>>40218913 #>>40220990 #
nathanmarz ◴[] No.40216866[source]
Check out twitter-scale-mastodon, which is an implementation of Mastodon's backend from scratch that scales to Twitter scale. It's more than 40% less code than Mastodon's backend and 100x less code than Twitter wrote to build the equivalent.

https://github.com/redplanetlabs/twitter-scale-mastodon

https://blog.redplanetlabs.com/2023/08/15/how-we-reduced-the...

replies(2): >>40216928 #>>40217001 #
finnh ◴[] No.40217001[source]
> These numbers are a bit better than Twitter’s numbers. Because of how unbalanced the social graph is, getting performance this good and this reliable is not easy. For example, when someone with 20M followers posts a status, that creates a huge burst of load which could delay other statuses from fanning out. How we handled this is described more below.

Huh. I haven't written myself a twitter, but I've always assumed that this problem is solved by a mix of fan-on-write and fan-on-read. Most people are fan-on-write, but those with a follower count > $THRESHOLD are fan-on-read.

The fan-on-read set is small enough to be easily cacheable, so the extra reads required to service a follower's feed are more than compensated for by the fact that the content is in RAM in a cache.

Sounds like RedPanda went exclusively with fan-on-write. I'd be surprised if Twitter does the same - but it sounds like OP has more knowledge about this than me, so I'm happy to be educated!

replies(1): >>40217181 #
nathanmarz ◴[] No.40217181[source]
The chronological timeline at Twitter fans out on write. This makes sense when you consider that the most important application metric is the latency to load the timeline. That latency is a lot lower when you only need one query on the materialized timeline rather than a ton of queries for everyone you follow.
replies(1): >>40217736 #
finnh ◴[] No.40217736[source]
Good to learn, thanks. "Everyone you follow" isn't quite what I was saying, but I also don't use twitter so I'm doubly in the dark here.

I'm surprised that someone with, say, a Twitter problem and tens of millions of followers - the two seem to go hand-in-hand - drives tens of millions of writes every time they post. But there you go, learned something today.

replies(2): >>40217769 #>>40217943 #
1. fizx ◴[] No.40217943[source]
I was tech lead on that subsystem for a little while in 2010. A lot of smart people thought about the hybrid approach, either by using the search index to drive the timeline or building a custom ring-buffer-based index of all tweets. Ultimately two systems are harder to maintain than one, custom indices are hard, and the low-complexity approach dominated a higher-performance approach.

Also, contrary to popular opinion, we didn't go down when Justin Bieber tweeted, but we did have elevated error rates when large quantities of Justin Bieber followings put pressure on the MySQL row lock of his following count. In retrospect, lock striping would have helped, but the migration would have been horrific.