Database Design--Study Notes (2)

What physical design involves

  • Define naming conventions for databases, tables, and fields
  • Choose the right storage engine
  • Choose the appropriate data type for the fields in the table
  • Build database structure
    1. Define naming conventions for databases, tables and fields
  • Databases, tables, and fields should be named according to the principles of readability
  • The naming of databases, tables and fields should follow the ideographic principle
  • The naming of databases, tables and fields should follow the long naming principle (balance)

    2. Choose the right storage engine

    Innodb supports transaction storage engine, supports MVCC rows and locks, main application: transaction processing

    MyISAM does not support transactions that support concurrent insertion of tables and locks

    3. How to store date data

    datetime is timezone independent and occupies 8 bytes of storage.

    TIMESRAMP stores the seconds from January 1, 1970 GMT to the current time, occupying 4 bytes. The time range is from 1970-01-01 to 2038-01-19. The display depends on the specified time zone, and the value of the timestamp column can be automatically modified when the data of the row is modified.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325569772&siteId=291194637