What is a row-type database and what is a column database

Source: Internet
Author: User

A database stores data in a two-dimensional table of rows and columns, but is stored in a one-dimensional string, such as one of the following tables:

EmpId Lastname Firstname Salary
1 Smith Joe 40000
2 Jones Mary 50000
3 Johnson Cathy 44000

This simple table includes the employee code (EMPID), the Name field (Lastname and Firstname), and the salary (Salary).

This table is stored in the computer's memory (RAM) and storage (hard disk). Although the memory and the hard disk are different in mechanism, the computer's operating system is stored in the same way. The database must store the two-dimensional table in a series of one-dimensional "bytes" that are written by the operating system to memory or hard disk.

A row database stores data values in a row together, then stores the next row of data, and so on.

      1,smith,joe,40000;      2,jones,mary,50000;      3,johnson,cathy,44000;



A column database stores the data values in a column together , then stores the next column of data, and so on.

      ;      Smith,jones,johnson;      Joe,mary,cathy;      40000,50000,44000;

This is just a simplified statement.


In the field of relational database, in addition to the traditional database of Oracle, SQL Server and MySQL, the database of data warehouse is becoming more and more concerned.



Two-contrast1 rows are more suitable for OLTP, querying all columns of a record. columns are more suitable for OLAP, and are ideal for use in data warehousing, such as data analysis, mass storage, and business intelligence , involving infrequently updated numbers . because of the different design, the column database has advantages in parallel query processing and compression. And the data is listed as cell storage, regardless of the data modeling or modeling is simpler. To query the data on which columns are computed, directly read the columns on the row.
2 column in the storage area occupies a great advantage, can effectively improve the data compression ratio, save storage space.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

What is a row-type database and what is a column database

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.