Site icon Hip-Hop Website Design and Development

CPT or Custom Table for Repository of Serial Numbers

My app allows users to purchase products from a WooCommerce store. But I need to attach a serial number (cannot be generated on the fly) to each product, depending on type, size and design.

The serial numbers are selected from a pre-generated repository, and there are 20,000+

I’m thinking that I want to create a custom table just for these serial numbers and then connect the product with the serial using a custom field. There are two options that I see:

1) Create a Custom Post Type as serial_number

My main concern with creating a CPT is based on the massive number of posts that will need to be created to house all of the needed serial numbers. It may cause a huge bloat in the wp_posts and wp_postmeta tables…

2) Create a custom table, outside of the typical WP framework

My main concern with creating a custom table is that it is outside of the WP framework and it will make interacting with it a bit of a challenge.

I’m looking for guidance on this, because I need to ensure that I’m not going to need to make drastic changes to the database in the future as the data increases.