[wp-hackers] Plugins and network activations
mikeschinkel at newclarity.net
Tue Jun 28 17:05:19 UTC 2011
On Jun 28, 2011, at 8:48 AM, Peter Westwood wrote:
> The correct solution is to not have a table per blog in a Multisite install.
> Your plugin should either work with the existing table structure or introduce a global table because it needs to do something fundamentally different or not expect to work on any reasonably sized multisite install when network activated without manual work to create the tables.
> Running through a table creation for every blog on a large multisite install is not scalable and is probably not what you need :)
I've been thinking about this a lot lately as we're exploring building a SaaS using WordPress as a base.
I definitely agree that the current process does not scale to have to add tables when a plugin needs tables to all sites. So you proposed one option to create a shared table that has blog_id as a field so only one table needs to be added. But doesn't that effectively create a hybrid architecture where parts of the data are sharded and parts are not?
My understanding is that WordPress uses a sharding approach to enable scalability, yet it is recommending to not use sharding for extensions; isn't that contradictory? If sharding is the appropriate architecture for WordPress' tables why is it not the appropriate architecture for plugin's tables?
Or is this simple a case of "Yes, it's not a great situation but it's all we got at the moment?" And if that is the case, maybe it would make sense to come up with a better solution (i.e. a way that it is possible to add new tables to other blogs without timeout?)
More information about the wp-hackers