Bloating dbs in the long run
-
I’ve had the chance to analyze many websites having issues because of this plugin and 2 huge problems come to my mind:
1) There’s no easy way to cleanup stuff, there’s an old topic here:
https://support.advancedcustomfields.com/forums/topic/flush-unused-custom-fields/page/4/(7 years old)
Where people, having waited for years for an easy way to clean orphaned fields – or modify/delete fields, ended up creating 2 plugins (at least).
Of course somebody with some experience will easily catch this and fix it, but as WP is meant to be easy and people don’t realize sometimes what they use, often they end up with bloated dbs.
2) There’s another issue that comes to my mind:
When you make a field, if you make a default value for it, it’s still going to store that default value to EACH of the data it’s set to. So if you have 400K posts, and you make a text field, it’s going to add 2 metas to each of them, ending up with 800K metas. Even if it’s a text field and that it’s going to be set for 10 posts only, you’re going to fill it for all.
Wanna add 10 acf fields? Here you go 400K * 10 * 2 entries in your DB. 8 Millions rows in your db because you wanted to add conditional things for 100 posts.
You keep 5 revisions? Here we go 40 millions, i hope your server can handle those.
Since it can easily bloat any site, IMHO it should avoid storing what is not necessary and help to cleanup and maintain the fields, if possible avoiding to store default values if they’re meant to be applied on the whole set (old ones too), or at least propose not to. Of course that requires extra work like changing queries when fetching/sorting and would mean it would have to reprocess everything on default value change, which may include deleting some and we’re back with issue 1) which is not implemented.
Right now people are abusing of this plugin and not realizing it. The number of websites consuming 5x more CPU and ram than they should might be alarming.
I think you have disregarded the issues and possibly made wrong design choices at the beginning but there’s still time to fix things. You’ll be saving some trees!
Good luck
- The topic ‘Bloating dbs in the long run’ is closed to new replies.