The trick Elite likely uses is that they don’t pre-generate the whole galaxy and store it in a database. They likely generate most of the galaxy at runtime when it is needed.
I would do this using a pseudorandom but deterministic algorithm which can generate the properties of every object in the galaxy at runtime just from its position.
So when a player zooms into a section of the galaxy, then the galaxy chunk generation algorithm is run, which takes the chunk coordinates as input and outputs a list of stars with position, color and size. Same input always results in the same output, so when another player zooms into the same chunk later, they get the same results. You might have different algorithms for different zoom levels which each take the output of the previous algorithm into account and add more detail to it. So the algorithm on the lowest zoom factor only generates the largest stars (so you can quickly generate a view which shows the whole galaxy at once), and the closer the player zooms into any part of the galaxy, the more additional small stars get generated in that area.
Then, when the player clicks on any of these stars to zoom into its star system, the star system generation algorithm is run. Its input are color, size and galactic position of the star. Its output is a list of planets with their types, sizes and orbital parameters. It too is a deterministic algorithm so it always generates the same planets for the same star.
And then you can do the same thing with planet surfaces, cities on the planet surfaces, houses in those cities and rooms in those houses. So you end up with a galaxy with a level of detail which would take an exorbitant amount of data to store all at once. But you don’t need to store it all, because any of that data can be re-calculated on demand.
A really neat tool for procedural generation algorithms like that are noise pattern algorithms like Simplex Noise or Worley Noise. You can sample them at arbitrary locations to get reproducible results. Another are standard pseudorandom number generators which can be initialized with a seed value and then always generate the same sequence of numbers for the same seed value.
All you really need to store in a database is data which can not actually be re-generated on demand:
- Parts of the galaxy which you want to design by hand
- Changes to the galaxy which are the result of player actions
First you check if any such datasets exist in your database for the requested data, and when they don’t, you generate the data using the algorithms.
Now you just need to come up with algorithms which generate interesting and varied results and then with game mechanics which provide an engaging and interesting game experience which benefits from all that content variety. I am looking forward to playing what you will come up with.