Quantcast
Channel: Database design to create tables on the fly - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Ben Burns for Database design to create tables on the fly

$
0
0

I'm not sure what the real problem you're having is, but the solution you proposed is the "database within a database" antipattern which makes so many people cringe.

Depending on how you're querying your data, if you were to structure things like you're planning, you'd either need a bunch of piece-wise queries which are joined in the middleware (slow) or one monster monolithic query (either slow or creates massive index bloat), if one is even possible.

If you must create tables on the fly, learn the CREATE TABLEALTER TABLE and DROP TABLE DDL statements for the particular database engine you're using. Better yet, find an ORM that will do this for you. If your real problem is that you need to store unstructured data, check out MongoDB, Redis, or some of the other NoSQL variants.

My final advice is to write up the actual problem you're trying to solve as a separate question, and you'll probably learn a lot more.


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>