A summary of Jira Database Design

Source: Internet
Author: User

I was bored today. I imported the Jira database (MySQL version) and checked it in navicat. Summarize the following points:

I. Various types:

Tables: N

Views: 0

Functions: 0

Trigger: 0

Ii. Foreign Key Usage:

Foreign keys are rarely used in table design. Except for a set of tables that appear to be automatically generated, there are basically no foreign keys.

There is a lot of debate over the use of foreign keys on the Internet:

Http://www.itpub.net/thread-1313696-1-1.html

Http://www.itpub.net/thread-1312844-1-1.html

Iii. Table data type selection:

Basically only the following types are used

Decimal: 18

Decimal: 9

Varchar (255)

Char (x) as needed

Longtext

Datetime

Iv. Table Name and field naming rules

Mainly in full English, such as author

There are no underlines available for multiple words, such as projectlevel and password_hash. I feel that this one is not very standard.

Each table contains a primary key. Most tables with IDS as the primary key also use multiple primary keys.

Summary:

To be compatible with multiple databases, select as few data types as possible to improve compatibility in various databases and introduce as few database features as possible.

If you have no comments on the foreign key, see the two links.

Id. Generally, decimal (18) is used to guarantee large data volumes (bigint is supported in MySQL, But Oracle is not. For the sake of universality), why is it 18? Corresponding to Java. Lang. Long.

Decimal (18) can be mapped to long (JIRA is written in Java). If it is 19 BITs, it may exceed the maximum number of long 9223372036854775807.

Generally, varchar uses more than varchar (255) and databases. Multi-point loss is better than the length.

The following is a preview:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.