News for hackers. Stuff that matters.
Re:A minimalistic site to vent and see others doing the same... by VentScape on Wednesday January 27, 2021 @02:34AM (#25925355)
Hey, creator of the site here, thank you so much for the tip!

Unfortunately I'm quite new to full stack. ~1.5 months ago I didn't know a lick of HTML (let alone CSS, JS, any backend framework, AWS, etc), and I'm making lots of mistakes along the way. Currently trying to figure out how to improve my DB performance as Spring's default pagination seems to be quite slow and my site is getting hugged to death at the moment. If anyone has any tips for that especially I'm all ears.

At any rate, your suggestion seems easy enough to put in, so I'll put it in ASAP! Thanks again

Re:A minimalistic site to vent and see others doing the same... by jlis on Wednesday January 27, 2021 @07:02AM (#25927181)
You could also benefit from using websockets instead of sending the message to a DB and fetching it from there. This way, you'd have instant communication between the users and there's no need to store anything.
Re:A minimalistic site to vent and see others doing the same... by C4stor on Wednesday January 27, 2021 @04:59AM (#25926272)
Reduce the refresh rate drastically, augment the number of messages fetched at once (let's say 200), and display them slowly. Should reduce 20 times the load on DB while making no sensible difference for end users anyway.
Re:A minimalistic site to vent and see others doing the same... by VentScape on Wednesday January 27, 2021 @06:51AM (#25927106)
Ok interesting idea. My one fret here would be that it would decrease interactivity on the site. Sometimes people send messages in response to each other, right? But nonetheless I'll experiment with increasing the refresh rate and maybe strike a nicer balance
Re:A minimalistic site to vent and see others doing the same... by corobo on Wednesday January 27, 2021 @08:57AM (#25928304)
I agree with you. Realtime is the key intrigue after the site itself, people will go off it when they realise it's not live.
Re:A minimalistic site to vent and see others doing the same... by nmeta on Wednesday January 27, 2021 @10:39AM (#25929513)
second this, I managed a brief conversation with someone when trying this out and it was great, a few other messages seemed to chime in as well. perf/eff can be improved as mentioned above but would lose the fun, imo
Re:A minimalistic site to vent and see others doing the same... by eindiran on Wednesday January 27, 2021 @02:36AM (#25925365)
Congratulations on getting to the front page of HN and Reddit / mostly surviving the hug of death!
Re:A minimalistic site to vent and see others doing the same... by andreareina on Wednesday January 27, 2021 @02:59AM (#25925499)
Sounds like you're using offset for pagination.

https://use-the-index-luke.com/no-offset

Re:A minimalistic site to vent and see others doing the same... by VentScape on Wednesday January 27, 2021 @04:23AM (#25926020)
A bit more explanation for you or any other helpful people reading, I'm using Spring's PagingAndSortingRepository.findAll(Pageable) function, and then passing in sort=id,desc&size=10 via the API request params (but no explicit offset AFAIK).

Found one potentially good stackoverflow to dig into so far https://stackoverflow.com/questions/44021665/why-is-a-pagina...

Re:A minimalistic site to vent and see others doing the same... by simply_sam on Thursday January 28, 2021 @05:33AM (#25940286)
Hi, is there any way to contact you privately?

I would like to use this idea on a project of mine.

Re:A minimalistic site to vent and see others doing the same... by VentScape on Thursday January 28, 2021 @12:59PM (#25945868)
Sure. Feel free to DM me on Reddit (u/VentScape). Eventually I'll set up some @ventscape.life emails to use but I haven't gone through the effort yet