{"id":3605,"date":"2014-03-29T06:45:39","date_gmt":"2014-03-29T06:45:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/should-i-use-flat-tables-or-a-normalized-database-collection-of-common-programming-errors\/"},"modified":"2014-03-29T06:45:39","modified_gmt":"2014-03-29T06:45:39","slug":"should-i-use-flat-tables-or-a-normalized-database-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/should-i-use-flat-tables-or-a-normalized-database-collection-of-common-programming-errors\/","title":{"rendered":"Should I use flat tables or a normalized database?-Collection of common programming errors"},"content":{"rendered":"<p>I have a web application that I am currently working on that uses a MySQL database for the back-end, and I need to know what is better for my situation before I continue any further.<\/p>\n<p>Simply put, in this application users will be able to construct their own forms with any number fields (they decide) and right now I have it all stored in a couple tables linked by foreign keys. A friend of mine suggests that to keep things &#8220;easy\/fast&#8221; that I should convert each user&#8217;s form to a flat table so that querying data from them stays fast (in case of large growth).<\/p>\n<p>Should I keep the database normalized with everything pooled into relational tables with foreign keys (indexes, etc) or should I construct flat tables for every new form that a user creates?<\/p>\n<p>Obviously some positives of creating flat tables is data separation (security) and query speeds would be cut down. But seriously how much gain would I get from this? I really don&#8217;t want 10000 tables and to be dropping, altering, and adding all of the time, but if it will be better than I will do it&#8230; I just need some input.<\/p>\n<p>Thank you<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a web application that I am currently working on that uses a MySQL database for the back-end, and I need to know what is better for my situation before I continue any further. Simply put, in this application users will be able to construct their own forms with any number fields (they decide) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3605","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3605"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3605\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}