⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbisnot.so

📁 berkeley db 4.6.21的源码。berkeley db是一个简单的数据库管理系统
💻 SO
字号:
m4_comment([$Id: dbisnot.so,v 10.8 2002/08/23 20:36:50 bostic Exp $])m4_ref_title(Introduction, What m4_db is not,, intro/dbis, intro/need)m4_p([dnlIn contrast to most other database systems, m4_db provides relativelysimple data access services.])m4_p([dnlRecords in m4_db are (m4_italic([key]), m4_italic([value])) pairs. m4_dbsupports only a few logical operations on records. They are:])m4_bulletbeginm4_bullet([Insert a record in a table.])m4_bullet([Delete a record from a table.])m4_bullet([Find a record in a table by looking up its key.])m4_bullet([Update a record that has already been found.])m4_bulletendm4_p([dnlNotice that m4_db never operates on the value part of a record.Values are simply payload, to bestored with keys and reliably delivered back to the application ondemand.])m4_p([dnlBoth keys and values can be arbitrary byte strings, either fixed-lengthor variable-length. As a result, programmers can put native programminglanguage data structures into the database without converting them toa foreign record format first. Storage and retrieval are very simple,but the application needs to know what the structure of a key and avalue is in advance. It cannot ask m4_db, because m4_db doesn't know.])m4_p([dnlThis is an important feature of m4_db, and one worth considering morecarefully.  On the one hand, m4_db cannot provide the programmer withany information on the contents or structure of the values that itstores.  The application must understand the keys and values that ituses.  On the other hand, there is literally no limit to the data typesthat can be store in a m4_db database. The application never needs toconvert its own program data into the data types that m4_db supports.m4_db is able to operate on any data type the application uses, nomatter how complex.])m4_p([dnlBecause both keys and values can be up to four gigabytes in length, asingle record can store images, audio streams, or other large datavalues.  Large values are not treated specially in m4_db. They aresimply broken into page-sized chunks, and reassembled on demand whenthe application needs them. Unlike some other database systems, m4_dboffers no special support for binary large objects (BLOBs).])m4_section([Not a relational database])m4_p([dnlm4_db is not a relational database.])m4_p([dnlFirst, m4_db does not support SQL queries. All access to data is throughthe m4_db API. Developers must learn a new set of interfaces in orderto work with m4_db. Although the interfaces are fairly simple, they arenon-standard.])m4_p([dnlSQL support is a double-edged sword. One big advantage of relationaldatabases is that they allow users to write simple declarative queriesin a high-level language. The database system knows everything aboutthe data and can carry out the command. This means that it's simple tosearch for data in new ways, and to ask new questions of the database.No programming is required.])m4_p([dnlOn the other hand, if a programmer can predict in advance how anapplication will access data, then writing a low-level program to getand store records can be faster. It eliminates the overhead of queryparsing, optimization, and execution. The programmer must understandthe data representation, and must write the code to do the work, butonce that's done, the application can be very fast.])m4_p([dnlSecond, m4_db has no notion of m4_italic([schema]) and data types inthe way that relational systems do. Schema is the structure of recordsin tables, and the relationships among the tables in the database. Forexample, in a relational system the programmer can create a record froma fixed menu of data types. Because the record types are declared tothe system, the relational engine can reach inside records and examineindividual values in them. In addition, programmers can use SQL todeclare relationships among tables, and to create indices on tables.Relational engines usually maintain these relationships and indicesautomatically.])m4_p([dnlIn m4_db, the key and value in a record are opaque to m4_db. They mayhave a rich internal structure, but the library is unaware of it. As aresult, m4_db cannot decompose the value part of a record into itsconstituent parts, and cannot use those parts to find values ofinterest. Only the application, which knows the data structure, can dothat.  m4_db does support indices on tables and automatically maintainthose indices as their associated tables are modified.])m4_p([dnlm4_db is not a relational system. Relational database systems aresemantically rich and offer high-level database access. Compared to suchsystems, m4_db is a high-performance, transactional library for recordstorage. It's possible to build a relational system on top of m4_db. Infact, the popular MySQL relational system uses m4_db fortransaction-protected table management, and takes care of all the SQLparsing and execution. It uses m4_db for the storage level, and providesthe semantics and access tools.])m4_section([Not an object-oriented database])m4_p([dnlObject-oriented databases are designed for very tight integration withobject-oriented programming languages. m4_db is written entirely in theC programming language. It includes language bindings for C++, Java,and other languages, but the library has no information about theobjects created in any object-oriented application. m4_db never makesmethod calls on any application object. It has no idea what methods aredefined on user objects, and cannot see the public or private membersof any instance.  The key and value part of all records are opaque tom4_db.])m4_p([dnlm4_db cannot automatically page in objects as they are accessed, as someobject-oriented databases do. The object-oriented application programmermust decide what records are required, and must fetch them by makingmethod calls on m4_db objects.])m4_section([Not a network database])m4_p([dnlm4_db does not support network-style navigation among records, asnetwork databases do. Records in a m4_db table may move around overtime, as new records are added to the table and old ones are deleted.m4_db is able to do fast searches for records based on keys, but thereis no way to create a persistent physical pointer to a record.Applications can only refer to records by key, not by address.])m4_section([Not a database server])m4_p([dnlm4_db is not a standalone database server. It is a library, and runs inthe address space of the application that uses it. If more than oneapplication links in m4_db, then all can use the same database at thesame time; the library handles coordination among the applications, andguarantees that they do not interfere with one another.])m4_p([dnlRecent releases of m4_db allow programmers to compile the library as astandalone process, and to use RPC stubs to connect to it and to carryout operations. However, there are some important limitations to thisfeature.  The RPC stubs provide exactly the same API that the libraryitself does.  There is no higher-level access provided by the standaloneprocess. Tuning the standalone process is difficult, since m4_db doesno threading in the library (applications can be threaded, but thelibrary never creates a thread on its own).])m4_p([dnlIt is possible to build a server application that uses m4_db for datamanagement. For example, many commercial and open source LightweightDirectory Access Protocol (LDAP) servers use m4_db for record storage.LDAP clients connect to these servers over the network. Individualservers make calls through the m4_db API to find records and return themto clients. On its own, however, m4_db is not a server.])m4_page_footer

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -