How to store metadata about a table?

I have a table. A large table with 25 columns, each of which contains atomic data about a specific object. Objects are, to be specific, real estate (for example, rooms and houses) for sale, and therefore the table is called a property .

Each property has a subclass (it is actually called a “type”, but we will call it a “subclass” to avoid confusion with data types), which is currently “already built and sold” or “under development”, but can invest in. "It also has many attributes, such as address, price, etc. Most of which are shared between subclasses, but some of them are not. Attributes have different data types:

  • Integer numbers
  • Floating point numbers
  • Short lines of text
  • Long chunks of text
  • Foreign keys to other tables

These "other tables" are intended for selection from a list of parameters edited by the moderator (for example, a list of city districts, a list of construction companies, etc.).

The moderator should be able to create new properties and edit them. The user should be able to view certain information about properties and search for properties that meet certain criteria, and then view them as a table, sort by one of the columns.

Depending on the subclass of the property, only a subset of the property attributes is available to the user and to the moderator for editing. In addition, depending on the type of data, various HTML codes must be executed in order to display these attributes to the user and provide the moderator with edit controls, as well as validate data validation.

The list of fields is not dynamic - it is unlikely that the list of columns and how they are displayed changes frequently, and the moderator should not change it.

, 25 - , : , , . (, ). :


1. PHP

PHP , , / .

:

  • .
  • .

:

  • , - PHP-.

2. MySQL

property_meta​​strong > . , , .. , .

:

  • .
  • .
  • , . . , , " " - . , .

:

  • . , , .
  • - . MySQL.

3.

, , property_attribute. property_data​​strong > property_attribute . , .

:

  • . , .

:

  • property_data​​strong > . TEXT BLOB, . .
  • , property. , , (, ? ).
  • . property_id - property_attribute_id - value trinities, .
  • , .
  • , .
  • , .

, . , -, . ?

+5
2

: , / ?

, , .
, , , . , .

PHP

, , . , , .

, - , :

  • POPO ( ole-php-) .
    , , ORM. Doctrine2, - .

  • , ... , , SRP i.m.o, . factory, / , POPO .

, . -ORM. №2 ORM, ...

. , :

  • ( getters/seters), , .
  • , , . ( , ... , .)
  • , , .
+2

, NoSQL MySQL, ,

  • Column Store/Column Families
  • ...

, NoSQL Relational Database , , , nosql

+1

All Articles