How to replicate data storage and querying using WordPress. Custom posts/fields or Custom db tables?

This question is too broad for a concise answer but generally speaking I’d recommend:

You can query by both the taxonomy & custom fields using tax & meta queries. There’s a premium 3rd party addition for ACF that converts custom fields to real tables if you’re working with huge amounts of data.