I am building off of sim-eth-es … all is fine except for one question…
All the entities get loaded up in the server’s EntityData instance … thousands of them … now the problem is that each user also can have thousands of entities (researched parts, hull parts, etc…). What’s the best practice to manage the user’s entities separately? My thought is to have a separate EntityData instance for a logged in user under their session and then garbage collect it when they log off but I can’t find such a mechanism in the sim-eth-es code base.
I am worried about loading every possible entity into memory including every users inventory item, posible ship in bay, researched item, etc … with 30k users you can imaging it can get large quick. The user’s entities are really not used in shared space and only used by a logged in user so they can build ships they might launch later for example. I figured I would have one shared EntityData for all entities in sector space and only instantiate user entities when a user logs in and garbage collect them when they log out.
EDIT: so basically the user’s entities are private to the user and are not needed as public entities for other’s to get.
EDIT #2: I guess I can have a hollow “ReasearchedItems” component on the user’s entity and then lazy load the stuff from the database on the client’s side via RMI … but then I don’t get the benefits of an entity subsystem for those.
I never had time to look into the DB adapter code. You telling me that the DBAdapter is a lazy loading mechanism that dynamically applies Filters so that I don’t need the world in memory on the server? … Now THAT would be cool!
Yes. Where possible, the filters are translated into queries. Only what is needed in memory is loaded into memory.
So the performance profile will change but likely in ways not important to a networked app that may have already had to deal with those same types of resident issues.
Edit: note that also only components marked as persistent components will be stored and anything else will be memory-only just like you have now. So for things you only use at runtime you still get the same performance.