Mysql – what would be the primary disadvantages of splitting the tables into table spaces and/or separate schemata

MySQL

I would like to organize the MySQL tables of a complex application into some groups, to avoid looking at a one big bin of tables. One big bin is harder to administrate when e.g. I would like to reset certain groups of related tables, or if I'd later wish to move a group of related tables to a different MySQL server altogether, and it is also more error prone when developing new DDL code.

I can apply a sense of grouping with my own table name prefixing "convention", but thought about using table spaces or even separate schemata. What would be the primary disadvantages of using separate table spaces or schemata for applying a sense of grouping upon my tables?

Best Answer

DISADVANTAGE #1

InnoDB only has one Buffer Pool. The benefits of partitioning or compartmentalizing database tables for different clients can still be bottlenecked by database buffers (log buffer, InnoDB Buffer Pool)

DISADVANTAGE #2

Scaling becomes dependent on manual operation. This applies to scaling up disks, hardware (disk controllers), and memory.

DISADVANTAGE #3

More tables means more open file handles to cache distinct tables. Requires more flush to disk.

DISADVANTAGE #4

Introducing new groups of related tables regurgitates the first three(3) disadvantages and exacerbates the overall design.

See my other posts on such setups and other drawbacks

SUGGESTIONS

You might have to compensate these deficiencies with lots of RAM with the InnoDB Buffer Pool and the Log Buffer getting the lion's share.

You could create a hybrid setup where InnoDB Log Files are on one disk and InnoDB System Tablespace is on another, and all the data on a third disk. This concept is well expressed in YOSHINORI MATSUNOBU'S BLOG (FaceBook DB Engineer).