this post was submitted on 09 Jul 2023
7 points (100.0% liked)

Lemmy Support

4651 readers
1 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
 

I only know of two FOSS federated alternatives to reddit which is lemmy or kbin.

I think lemmy will scalebmore being written in rust were kbin is written in PHP.

And by scaling I am refering to high user count, high traffic, server resoures, server cost.

top 9 comments
sorted by: hot top controversial new old
[–] [email protected] 9 points 1 year ago (1 children)

They both hit the same challenges. The bottleneck with any web application is pretty much always the database, especially SQL ones where replication and sharding is not as easy as some other tech like MongoDB and ElasticSearch.

Both kbin and Lemmy use PostgreSQL, so they'll both hit similar bottlenecks.

Lemmy has the advantage of processing much faster thanks to its Rust backend, requiring less CPU, but PHP is also very easy to scale up to add more server and more compute to it. PHP has some advantages despite its reputation, in that it's pretty hard to have memory leaks like Lemmy experienced recently, because the whole process resets at a configurable amount of requests, and on the PHP side, each request is independent and starts over from scratch, making it hard to accumulate in-process state that doesn't get wiped out after each request. It also indirectly forces you to rely on external cache and queue services for synchronization, which can help prevent some gotchas that long running servers in Rust/C#/Go/NodeJS would. In a single process it's easy to turn to global state and hit gotchas when you have it running on two different servers.

But functionally, they're all capable of roughly the same, as the bottleneck will still be the database. Scaling databases is not easy, although not necessarily that crazy hard either.

[–] [email protected] 1 points 1 year ago (1 children)

Scaling databases, particularly the most used one, PostgreSQL, also seems to be an expertise somewhat lacking across the platforms.

Which I say only to highlight that anyone with experience and expertise on scaling and optimising PostgreSQL is likely to have something rather valuable to contribute to the fediverse if they are willing.

[–] [email protected] 2 points 1 year ago

Yep, there's a reason database admin is a career of its own. We use MySQL at work but same deal everytime: monitoring goes crazy and we poke the devs to fix their queries.

Been meaning to get familiar with Lemmy's code soon, just need to find some free time 😅

[–] [email protected] 5 points 1 year ago (2 children)

Without any knowledge on the details of both implementations: scalability has two dimensions, vertical where one server can handle more requests and horizontal where more servers can be added to serve requests. In recent years focus has been put more on the latter and for that the performance of a single node isn't as important as for the vertical scalability.

[–] [email protected] 3 points 1 year ago (1 children)

To my understanding vertical scaling has limits which is the servers limitations as horizontal scaling if infinite since unlimited servers can be added

[–] [email protected] 1 points 1 year ago

That's true but total horizontal scaling is very hard for systems that need some kind of consistency properties

[–] [email protected] 1 points 1 year ago (1 children)

Will rust be able to scale horizontally in the future?

[–] [email protected] 1 points 1 year ago

That isn't so much a question of the language. Horizontal scalability is a property of the system you are building. You need to engineer the communication between the individual nodes, you need to make choices on the CAP tryingle (https://en.wikipedia.org/wiki/CAP_theorem) and more.

So rust is already horizontally scalable, it's just hard to build horizontally, in any language.

(Sidenote, there is the language Erlang which seems to do a lot of this under the hood, but I have no experience with it so...)

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago)

Idk what the heck your talking about lol but lemmy is always up and for apps for it meanwhile kbin goes down and only has a PAW. I have an account in both but been using lemmy more. Using liftoff for iOS and its amazing!

load more comments
view more: next ›