简体   繁体   中英

Should I Split Tables Relevant to X Module Into Different DB? Mysql

I've inherited a rather large and somewhat messy codebase, and have been tasked with making it faster, less noodly and generally better.

Currently we use one big database to hold all data for all aspects of the site. As we need to plan for significant growth in the future, I'm considering splitting tables relevant to specific sections of the site into different databases, so if/when one gets too large for one server I can more easily migrate some user data to different mysql servers while retaining overall integrity.

I would still need to use joins on some tables across the new databases.

Is this a normal thing to do?

Would I incur a performance hit because of this?

If you're concerned with data volumes, then you're probably better off maintaining a single database and just ensuring that your server has adequate disk space/memory. If you're concerned with accesses/second, then look at running multiple copies of the database on separate servers for load balancing, using master-master replication to keep them synchronised.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM