📄 faq.so
字号:
m4_comment([$Id: faq.so,v 1.12 2006/09/07 19:26:44 alanb Exp $])m4_ref_title(m4_db Replication, Replication FAQ,, rep/partition, rep/ex)m4_nlistbeginm4_nlist([dnlm4_bold([Does m4_db provide support for forwarding write queries fromclients to masters?])m4_p([dnlNo, it does not. The m4_db RPC server code could be modified to supportthis functionality, but in general this protocol is left entirely to theapplication. Note, there is no reason not to use the communicationschannels the application establishes for replication support to forwarddatabase update messages to the master, since m4_db does not requirethose channels to be used exclusively for replication messages.Replication Manager does not currently offer this service to theapplication.])])m4_nlist([dnlm4_bold([Can I use replication to partition my environment acrossmultiple sites?])m4_p([dnlNo, this is not possible. All replicated databases must be equallyshared by all environments in the replication group.])])m4_nlist([dnlm4_bold([I'm running with replication but I don't see my databaseson the client.])m4_p([dnlThis problem may be the result of the application using absolute pathnames for its databases, and the pathnames are not valid on the clientsystem.])])m4_nlist([dnlm4_bold([How can I distinguish m4_db messages from application messages?])m4_p([dnlThere is no way to distinguish m4_db messages from application-specificmessages, nor does m4_db offer any way to wrap application messagesinside of m4_db messages. Distributed applications exchanging theirown messages should either enclose m4_db messages in their own wrappers,or use separate network connections to send and receive m4_db messages.The one exception to this rule is connection information for new sites;m4_db offers a simple method for sites joining replication groups tosend connection information to the other database environments in thegroup (see m4_link(M4RELDIR/ref/rep/newsite, Connecting to a new site)for more information).])])m4_nlist([dnlm4_bold([How should I build my m4_arg(send) function?])m4_p([dnlThis depends on the specifics of the application. One common way is towrite the m4_arg(rec) and m4_arg(control) arguments' sizes and data toa socket connected to each remote site. On a fast, local area net, thesimplest method is likely to be to construct broadcast messages. Eachm4_db message would be encapsulated inside an application specificmessage, with header information specifying the intended recipient(s)for the message. This will likely require a global numbering scheme,however, as the m4_db library has to be able to send specific logrecords to clients apart from the general broadcast of new log recordsintended for all members of a replication group.])])m4_nlist([dnlm4_bold([Does every one of my threads of control on the master have toset up its own connection to every client? And, does every one of mythreads of control on the client have to set up its own connection toevery master?])m4_p([dnlThis is not always necessary. In the m4_db replication model, anythread of control which modifies a database in the master environmentmust be prepared to send a message to the client environments, and anythread of control which delivers a message to a client environment mustbe prepared to send a message to the master. There are many ways inwhich these requirements can be satisfied.])m4_p([dnlThe simplest case is probably a single, multithreaded process runningon the master and clients. The process running on the master wouldrequire a single write connection to each client and a single readconnection from each client. A process running on each client wouldrequire a single read connection from the master and a single writeconnection to the master. Threads running in these processes on themaster and clients would use the same network connections to passmessages back and forth.])m4_p([dnlA common complication is when there are multiple processes running onthe master and clients. A straight-forward solution is to increase thenumbers of connections on the master -- each process running on themaster has its own write connection to each client. However, thisrequires only one additional connection for each possible client in themaster process. The master environment still requires only a singleread connection from each client (this can be done by allocating aseparate thread of control which does nothing other than receive clientmessages and forward them into the database). Similarly, each clientstill only requires a single thread of control that receives mastermessages and forwards them into the database, and which also takesdatabase messages and forwards them back to the master. This modelrequires the networking infrastructure support many-to-onewriters-to-readers, of course.])m4_p([dnlIf the number of network connections is a problem in the multiprocessmodel, and inter-process communication on the system is inexpensiveenough, an alternative is have a single process which communicatesbetween the master the each client, and whenever a process'm4_bold(send) function is called, the process passes the message to thecommunications process which is responsible for forwarding the messageto the appropriate client. Alternatively, a broadcast mechanism willsimplify the entire networking infrastructure, as processes will likelyno longer have to maintain their own specific network connections.])])m4_nlistendm4_page_footer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -