is having millions of tables and millions of rows within them a common practice in MySQL database design?

前端 未结 7 595
死守一世寂寞
死守一世寂寞 2021-01-05 20:27

I am doing database design for an upcoming web app, and I was wondering from anybody profusely using mysql in their current web apps if this sort of design is efficient for

相关标签:
7条回答
  • 2021-01-05 21:09

    1] Look up dimensions and facts tables in database design. You can start with http://en.wikipedia.org/wiki/Database_model#Dimensional_model.

    2] Be careful about indexing too much: for high write/update you don't want to index too much because that gets very expensive (think average case or worst case of balancing a b-tree). For high read tables, index only the fields you search by. for example in

    select * from mutable where A ='' and B='';
    

    you may want to index A and B

    3] It may not be necessary to start thinking about replication. but since you are talking about 10^6 entries and tables, maybe you should.

    So, instead of me telling you a flat no for the millions of tables question (and yes my answer is NO), I think a little research will serve you better. As far as millions of records, it hints that you need to start thinking about "scaling out" -- as opposed to "scaling up."

    0 讨论(0)
提交回复
热议问题