WordPress.org

Ready to get started?Download WordPress

Forums

When to use custom DB tables or add_option? (2 posts)

  1. MatthewRuddy
    Member
    Posted 2 years ago #

    Hey everyone. I've got a pretty straight forward question. When does it become too much data to use add_option, update_option, etc, and instead use a custom DB table?

    For example, if a plugin stores thousands and thousands of characters of data using add_option, etc, is there a maximum it can handle before it starts to create problems?

    A plugin of mine used to create its own DB table, but it created a lot of issues in which some users setups wouldn't work (especially on Microsoft based hosting servers), and many more users felt the need to contact me and advise me on using add_option instead. I followed their advise, and now the plugin uses these functions.

    However, I've come a long way in my coding abilities since then and in-turn have started redesigning the plugin. It now has much, much more data to be stored using add_option. Even up to over 10000+ characters worth, and I'm beginning to wonder if it will cause any problems.

  2. curtismchale
    Member
    Posted 2 years ago #

    It can handle it but it may not be fast. I'd set a transient with a long expire time and try to pull the information from that. If it's not there then go back to the option. Rebuild the transient when you update the option.

Topic Closed

This topic has been closed to new replies.

About this Topic