Multi-language Database Design

Source: Internet
Author: User

Category:

  1. Database level
  2. Table Level
  3. Field level

At the database level, different languages use different databases. The database usually contains many tables that do not involve multiple languages and there will be redundant tables.

Focuses on the table and field level:

Field level (ID, description, description_en, description_fr ...)

ID is the primary key

Advantages:

  1. Simple operation, one record is done

Disadvantages:

  1. Not conducive to expansion, such as adding a new language, you need to add a field
  2. Load different fields in different languages

Table Level

Table 1 (ID) ID is the primary key

Table 2 (ID, languageid, description) ID and languageid are compound primary keys

Advantages:

  1. Reduce redundancy and add as needed
  2. Easy to load and filter by language
  3. Easy to expand. You do not need to adjust the table structure when adding a new language.

Disadvantages:

  1. Operate two tables

Appendix:

Id keyid langid title
--------------------------------
1 1 wide
2 1 2 bytes
3 1 3 wide

Keyid: indicates the topic that the content belongs to (for example, the news ID)
Langid: Current Language ID
Of course, title is the title and content.

I use a similar upstairs design in a software (winform) and work well.
I also use the above design on a large website.
What I want to say is that this is not "the most effective.
Speed, speed -- or speed problems. Splitting data tables.

 

Http://www.doc88.com/p-37337683250.html

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.