Mcpie
Mcpie
TTCTheo's Typesafe Cult
Created by johnny the fifth on 3/2/2025 in #questions
should i use a database to store online users
if users on your chat app are generated by using for example a simple form just to pick a nickname then store only array. if they have to persist throughout sessions (aka "log back in") then you'll need some sort of database assuming you end up with array option, you can have it sorted and that way you'll be able to access every single one in O(logn) time by using binary search or you could use a HashSet for even faster access.
5 replies