The database is only used for persistence. What I'm asking about is persisting navigational data.
This is totally unclear from your posts, unfortunately.
There are two basic situations in which you would use persistent navigational data:
- Static geometry
- Dynamic geometry
In the former case, you will only need to load the data once and then never modify it or otherwise do anything with it besides searches. This is the optimal case for using a simple data structure that is serialized to disk at build time, and then loaded at runtime once and used indefinitely for navigation queries. That's the solution most games have because most games don't need much in the way of
truly dynamic navigation.
For the record, you can fake dynamic navigation in a method similar to what you suggested yourself: store the "fully connected" world in memory, and simply score some edges of the navigation graph as impassable if the situation calls for it. An example would be a door that is only big enough for hobbits to crawl through. If an ogre makes a navigation search, he can use the exact same navigation
data as the hobbit, but the ogre's score for the door will be impassable/blocked whereas the hobbit will perceive an edge that he can traverse.
Truly dynamic navigation is another beast and based on the logical assumptions most people would make from the thread, it isn't something you actually need. You haven't described any design goals that specifically require it. However, the typical solution is to store a hierarchical navigation data structure: one structure per "room" or "area" or whatever, and another high-level structure that describes how those smaller elements interconnect. When the navigation structure of the world changes, you simply rebuild the data structure for the affected regions. The hierarchical approach helps limit the knock-on effects of localized changes.
Note that both approaches involve custom data structures (graphs or navmeshes usually) and no relational DBs at all. Persistence does not inherently imply storage in a relational DB, that's all I was trying to say :-)
I can only work with what I know, and what I know is databases. I literally can not speak to any other method of storage when it comes to this because I'm not fully aware how it would work. If you have another suggestion, great. I would love to hear about it and learn. That's why I'm here.
I've described better solutions as has almost every other post in the thread. I responded because you were still talking about relational DBs even after all the suggested superior alternatives were available for you to analyze on your own. Also because I work on an MMORPG and I wanted to correct a misconception that we use relational data for navigation.
Nobody's asking you to speak to anything you don't know. We're giving you options to learn about and broaden your skill sets. If you don't know the tools for the job, learn them! There's nothing wrong with that and no reason to feel slighted by being told that you're missing a useful piece of knowledge.
Not to mention the fact that I've already admitted to not really knowing the performance outcome, and believing im being overly conservative. I feel like, had you read my posts, you would have seen that.
As I explicitly said, I don't even think performance is the real problem with relational DBs for this situation. I think the misuse of the tool is far more important on a conceptual level than a speed level. I remarked on performance merely for cohesion with the rest of the discussion but my real point was here:
It isn't really a performance or efficiency concern in my mind, though. It's an appropriateness of abstraction concern. The more you cram into your DB without reason, the more awkward things are going to get.
Trust your gut. Your gut says it would suck to store your navigation data in your database. So listen.
Anyways, I'm sorry if that all came off as a bit harsh or insensitive. I think we were simply operating under different sets of assumptions about what the subject of the thread is and where things stand with regards to finding a solution.