Linux File System Design and Java System JDBC database interface design

Source: Internet
Author: User
Tags ibm db2
Linux File System Design and Java System JDBC database interface design-general Linux technology-Linux programming and kernel information. The following is a detailed description. Why are these two seemingly unrelated questions taken together? Because, I think the designers of the two systems face the same problems when designing the system.

For the Linux operating system designer, he/she is faced with the problem of how to make Linux support all existing file systems (ext2, ext3, FAT32, msdos, etc. It wants to: From the Perspective of the operating system, all file systems it wants to see are the same (that is, it does not care about what file systems it is connected to or is called a cross-File System ). Linux defines a set of file system interfaces, which define the attributes and executable operations of the file system. For specific file systems, such as fat32 and ext2, Linux provides an implementation that complies with the preceding interfaces for each file system. The specific implementation is responsible for the operations of the specific file system. If you have invented a new file System, for example, FlyFile System. If you want Linux to support this file system, you only need to compile an implementation program that complies with the Linux interface.

For the Java system designer, he/she is faced with how to support a variety of databases (Oracle, Sybase, MySQL, IBM DB2, etc. It hopes to: From the Perspective of the Java program accessing the database, the methods it wants to access the database are the same (that is, it does not care about the database to be connected or is called a cross-database platform ). The Java designer also defines a set of interfaces for accessing the database called JDBC. This interface defines how Java programs access the database. For specific database systems, such as Oracle and Sybase, each vendor provides its own database with a set of implementations that comply with the preceding interfaces. The specific implementation is responsible for the specific database operations on the data. Similarly, if you have designed a new database called SuperManDB and want to be accessed by the Java system through JDBC, You need to compile an implementation that complies with the JDBC interface.

Although the two systems use different implementation languages (Linux uses C, while JDBC is used in Java), the idea is the same: Provide an abstraction layer, then different systems provide specific implementations. But it is not easy to do this. For example, can an abstract layer be provided to cover all interfaces that operate on file systems or database systems? Because the designers of different systems (file systems or database systems) have different ideas. I think this is a process of de-counterfeiting. It requires the designer to make efforts to analyze every detail of the design. This is a place where a good designer reflects the design level.

My failure example:

We want to use the same application system in two customers, but each customer has what they want and what they don't want. Later, the system was full

If (customer = 1) then {
// Do something like 1
} Else if (customer = 2 ){
// Do something like 2
}

The code is painful. Although the application is in the same field and on the same issue, can we use the same method to meet the needs of different users? I think it is difficult to have an answer. For colleagues, I think everyone has some experience. It is also invoice management. This user hopes to do so, and that user wants to do so. How can this problem be solved? Sometimes developing a program for every user is the final choice.

Example: Open Source Code System slide

Slide is a content management system that stores information such as the file itself, file-related information such as the file name, file size, and index information. Because of the file system, database system storage has its own expertise. You can configure Slide as needed:

1. Use a file system to store the file itself, and use a database to store the file-related information (MetaData) and index information.

2. All information is stored in the file system.

3. fully use the data system to store all information.

Slide provides a storage abstraction layer and specific storage implementation (file storage implementation, Oracle database storage implementation, and MySQL database storage implementation). You can configure files based on your needs (performance, backup solution.

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.