Need advice for a storage structure

Question

I’m developing blacklist plugin for Woocommerce. Can’t decide, which way is better for data storage without a custom database creation. Admin can add some user data to blacklist (for example email, name, IP, address). I need to store this data with ability to search. At this moment, I can store a data as:

1) wp_posts with wp_post_meta. Post title as blacklist value (blacklist@gmail.com), post meta as blacklist value type (email).

Pros: built-in search, built-in optimization

Cons: increasing wp_posts size (especially for woocommerce websites, where items are also in wp_posts)

2) Store data as taxonomy tree. For example, parent taxonomy term is value type (email), childs are blacklist value (blacklisted@gmail.com).

Pros: flexible structure, separation from wp_posts table

Cons: bad performance on search, no built-in search

3) Store data as option. For example, option name is {value_type}_{value_slug} and option value is value.

Pros: good performance

Cons: problem in search (you can get option by exact name)

4) Any advices?

0
, user3013494 3 years 2020-04-08T00:51:13-05:00 0 Answers 82 views 0

Leave an answer

Browse
Browse