#Extending ItemType vs @JdbcTypeCode(SqlTypes.JSON) - JPA/Hibernate
1 messages · Page 1 of 1 (latest)
<@&987246584574140416> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
better by what metric
Well thats a good question, i suppose whenever you wanna Query for a table, it requires be an entity. so in any sense where it doesn't require to be a table?
what is more verbose? i.e. overkill in computational cost? time?
It depends on the context of the entity are. Querying a json field is ... doable but harder, often slower, than chasing entity references; it generally ties you to a specific DB, too, but eh.
But than again, for complex objects chasing an Entity reference still requires converting right? which is also quite heavy? in the case of extending ItemType for example?
I'd have to measure for the case. "quite heavy" needs a lot of context, and JPA engines generally do that stuff quite well.
Are you talking to a relational database?
yeah, basically its for a game. a very big game actually so alot is loaded into memory on login.
so queries doesn't often happen, however i might for specific cases extend it to the website. ItemInventories for example.
Well, what's the SLA
and the thing is, if speed is important then you've already kinda poured it down the drain for high throughput
what are your access requirements: N entities within M ms with user load of X ...
"I am accessing a database every four seconds, and it's okay if it takes 500ms to respond for that user" ... well... why bother optimizing? You'll waste more time optimizing than you'll ever care about
Right.
very true.
so yeah in my case only on login, so that would be depended on players logging in and out, which only happen every couple minutes
I'm not saying NOT to optimize, but you probably shoudl focus on what you NEED to focus on before fapping away your time tuning a specific entity if it doesn't matter
right
if it doesn't matter, do what you want, it'll work out
my pleasure, hope it helps