this post was submitted on 15 Jun 2023
159 points (94.9% liked)
Programming
17374 readers
253 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I would say that it's extremely unlikely.
Websites in general are never limited by raw code execution, they are mostly limited by IO. Be that disk IO as files are read and written, database IO as you need to execute complex queries to gather all the data to build the user timeline, and network IO to transfer data to and from the user. For decentralized social media like Kbin or Lemmy its even more IO limited as each instance needs to go back and forth to other instances to keep up-to-date data.
Websites usually benefit much more from caching and in-memory databases to keep frequently used data in fast storage.
This is why simple, high level, object oriented, garbage collected languages have become so common. All the CPU performance penalties they incur don't actually affect the website performance.
In lemmy's case, my perusal of the DB didn't really suggest that the queries would be that complex and I suspect that moving it to a higher performance NoSQL DB might be possible, but I'd have to take a look at a few more queries to be sure.
I wonder if this could be made to work with Aerospike Community Edition...
Obviously it could be more effort than it's worth though.
There's no need to migrate the database, that shouldn't be an issue at this size. Caching should be implemented as another comment suggested.
Would you be so kind as to recommend some resources about caching? I've read the basics, but have yet to dive deep on it
The basic idea is to keep data as close to the processor as possible, so with a database that means storing the result of commonly used queries in memory.
Good resources.