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.
- Introduction to Oracle database development experience
- Compares different index mechanisms in a database horizontally
- Is the end of the relational database ever approaching?