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

📄 intro.so

📁 berkeley db 4.6.21的源码。berkeley db是一个简单的数据库管理系统
💻 SO
字号:
m4_comment([$Id: intro.so,v 1.11 2006/11/13 18:05:02 bostic Exp $])m4_ref_title(m4_db Replication, Replication introduction,    introduction to @replication, transapp/faq, rep/id)m4_p([dnlm4_db includes support for building highly available applications basedon replication.  m4_db replication groups consist of some number ofindependently configured database environments.  There is a singlem4_italic(master) database environment and one or more m4_italic(client)database environments.  Master environments support both database readsand writes; client environments support only database reads.  If themaster environment fails, applications may upgrade a client to be thenew master.  The database environments might be on separate computers,on separate hardware partitions in a non-uniform memory access (NUMA)system, or on separate disks in a single server.  The only constraintis that all the participants in a replication group all be on machinesof the same endianness.  (We expect this constraint to be removed in afuture release.)  As always with m4_db environments, any number ofconcurrent processes or threads may access a database environment.  Inthe case of a master environment, any number of threads of control mayread and write the environment, and in the case of a client environment,any number of threads of control may read the environment.])m4_p([dnlApplications may be written to provide various degrees of consistencybetween the master and clients.  The system can be run synchronouslysuch that replicas are guaranteed to be up-to-date with all committedtransactions, but doing so may incur a significant performance penalty.Higher performance solutions sacrifice total consistency, allowing theclients to be out of date for an application-controlled amount oftime.])m4_p([dnlThere are two ways to build replicated applications.  The simpler wayis to use the m4_db Replication Manager.  The Replication Managerprovides a standard communications infrastructure, and it creates andmanages the background threads needed for processing replicationmessages.  (Note that in Replication Manager applications, all updatesto databases at the master environment must be done through a singleDB_ENV environment handle, though they may occur in multiple threads.This of course means that only a single process may update data.)])m4_p([dnlThe Replication Manager implementation is based on TCP/IP sockets, anduses POSIX 1003.1 style networking and thread support.  (On Windowssystems, it uses standard Windows thread support.)  As a result, it isnot as portable as the rest of the m4_db library itself.])m4_p([dnlThe alternative is to use the lower-level "Base" replication API.  Thisapproach affords more flexibility, but requires the application toprovide some critical components:])m4_nlistbeginm4_nlist([dnlA communication infrastructure.  Applications may use whatever wireprotocol is appropriate for their application (for example, RPC, TCP/IP,UDP, VI or message-passing over the backplane).])m4_nlist([dnlThe application is responsible for naming.  m4_db refers to the membersof a replication group using an application-provided ID, andapplications must map that ID to a particular database environment orcommunication channel.])m4_nlist([dnlThe application is responsible for monitoring the status of the masterand clients, and identifying any unavailable database environments.])m4_nlist([dnlThe application must provide whatever security policies are needed.For example, the application may choose to encrypt data, use a securesocket layer, or do nothing at all.  The level of security is left tothe sole discretion of the application.])m4_nlistendm4_p([dnl(Note that Replication Manager does not provide wire security forreplication messages.)])m4_p([dnlThe following pages present various programming considerations, many ofwhich are directly relevant only for applications which use the Basereplication API.  However, even when using Replication Manager it isimportant to understand the concepts.])m4_p([dnlFinally, the m4_db replication implementation has one other additionalfeature to increase application reliability.  Replication in m4_db isimplemented to perform database updates using a different code path thanthe standard ones.  This means operations that manage to crash thereplication master due to a software bug will not necessarily also crashreplication clients.])include(rep/m4.methods)m4_page_footer

⌨️ 快捷键说明

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