Hello! I'm trying to make sure I understand the difference and the use cases for both of these.
Let's say I'm making a game that has a character with a bunch of attributes and an inventory. All the changes to the character object happen on the server (so that there is no cheating). This means that I need to get the character from the database after every interaction (such as buying or selling an item) and also once a minute on a timer. The object is going to be small, so it makes sense to re-fetch the entire thing every time.
Now, would every component, that displays this constantly updated data, need to be a client component? Or is it find to have server components handle this?
My original thinking was that only static data (like the layout of the page) would need to be server components, while any component that displays any character data (name, inventory, inventory items) would be a client component, but now I am beginning to doubt that. Would it be bad to handle all of that on the server and just keep having the server push those via dynamic APIs?
As you can see, I'm getting pretty confused. Could someone please help me gain some clarity? 😖 Also, and not sure if this is at all relevant, but I'm using Mongo for this.
Thank you!
P.S. — Here's what a sample character looks like:
type TCharacter = {
name: string;
location: string;
gold: number;
inventory: { id: string, amount: number }[];
}```