Detailed explanation by combining the file system to slim down the database

Source: Internet
Author: User

By slimming the database through the file system, it is to serialize the big data in the database and the data not involved in the search to a certain location on the hard disk through the file stream. The storage location uses the hash path, that is to say, a hashcode is generated through the primary key of the database table, and a hash path is implemented by splitting them in two ways. This ensures a maximum of 198 subfiles and files under a directory, ensuring the system's retrieval speed.

Big Data here is an example. For example, in company tables, there are generally company profiles, but the internal capacity of the company profile column is larger than the size of the entire data, the company profile does not participate in operations such as search and list. We can introduce the data and put it in the file system. When necessary, we can read it again, save the modification again.

This is the purpose and purpose of the program.

Since the company uses Ibatis as the processing framework of the database layer, the next task is to modify the Ibatis source code to achieve the above objectives.

As for how to modify Ibatis, I will write an article later to introduce it. here we will first discuss the feasibility of this solution.

For a more direct impression, first look at the specific effect

 

Database fields


Here, we can see that there are only four data fields, two fewer fields than the object.

The two fields will be stored in the file system.

 


The insert operation is performed. The following are log files.

 

Files in the corresponding File System

 

Open the file in binary mode.


Read a single piece of data


Read results


Although the program is written in java, Ibatis also has a. net version that should be similar, and I like the activity of the blog garden more. I will post it here to discuss whether it is helpful to do so.

  1. Introduction to Oracle database development experience
  2. Compares different index mechanisms in a database horizontally
  3. Is the end of the relational database ever approaching?

Related Article

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.