WordPress.org

Ready to get started?Download WordPress

Forums

Multiple tables versus comma separated entries or searlization? (2 posts)

  1. chrismichaels84
    Member
    Posted 1 year ago #

    So, I am developing a project management plugin that allows for multiple projects, users, apps, etc. I've worked out my database schema to do what I need correctly I should really create 7 or more tables in the WordPress database and just use join statements to query the data I need.

    Or, I could do the same thing with about 3 tables if I store a lot of information in comma separated strings that I explode and implode or serialized arrays. Generally, I've been told to normalize my databases without regard to how many actual tables I need.

    What is the best practice here for WordPress? Is creating that many tables with a plugin a problem?

    Thanks for the input.

  2. Rebecca Schaefer
    Member
    Posted 1 year ago #

    I don't think there is a real "best practice." The rule I typically follow is clumping (generally, serializing) together data I will be retrieving at the same time.

    Example: How often do you retrieve first name without last name? Or website address without website name?

    So if the data will <i>in general</i> be retrieved at the same time, then I'd go with serializing. If it won't be, then make separate tables.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.