I have something that completely confuses me and I have no idea how to store this much data in a database. Below I’ll explain exactly what I think I need to store in the database and how I plan to use that data (to store it efficiently).
Okay, so. I have a around 40 points on a grid. I’ll call them “objects”. They have information associated with them such as coordinates (x,y), ID, number, resources, and then a lot of other objects and an amount that “defends” that point on the grid. There are over 100 different types of units that can defend the point. These units can be owned by any number of players. ID and number can be derived from each other easily (so both may not need to be stored).
What I need to do, is store all this information every time I scan these points with the time I’m scanning them. I’ll need to then take this information out of the database to create graphs of a player’s units over time to see if it is increasing or decreasing. I’d also like to plot the objects total defense over time to track how that is changing overall.
The frequency I scan these objects can vary, to even be at most once a minute. I can’t even conceive how I’ll store all this information in a database.
Any help is appreciated! Ask any and all questions you need.. I know it’s a wall of text, but please read it!
Edit: The number of objects on the grid can change at any instant. We can gain one or we can lose one.
The starting point is really to understand Entity Relationship Modeling. Although your requirements look very unique to you, in terms on an entity relationship model they are old hat. Basically
is all about the types of relationships between objects that matter. Learn about one-one, one-to-many, and many-to-many relationships. The entity model is the place to start, and some tools even let you generate the tables off this. Once you understand how a given relationship translates to relational database model you are on your way. For example, one team has many baseball players. So this is a one-to-many relationship. Once you get this it will be a lot easier to understand why you need foreign keys in tables, and also unique id per row etc. As you build out your tables remember to model the relationships first and all the attributes later.
The other approach is to design your object model first, using say UML. Still its about relationships, inheritance, composition etc which will also translate into a database design. But if you want to design off database, then entity relationship modeling is the way to go.