Permalink
Browse files

readme formatting

  • Loading branch information...
1 parent feed899 commit b1b2c3099b2a1ecff1aa2fbaa2601ba1d081a118 @SergejJurecko committed Mar 29, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 README.rdoc
View
@@ -19,8 +19,10 @@ Connections are always single:
- master/slave - read and write from master
- master/master - pick a master at random and use it for everything
- replica pairs - find out which is master and connect to it
-If your usage pattern is read heavy and want to use slaves for reading, connect to them with singleServer call. Don't write to slave connections or bad things will happen.
+If your usage pattern is read heavy and want to use slaves for reading, connect to them with singleServer call. Don't write to slave connections or bad things will happen.
+
Always use an atom for naming connections. The connection process will register itself on that name.
+
Connection info is saved in an application variable (erlmongo,connections) and updated with every call to: singleServer, masterSlave, replicaPairs, masterMaster and deleteConnection. If mongodb process crashes for some reason, connections will be restarted. Also if the application itself is stopped and started. You can add a connections variable to erlmongo.app file:
% def is name of connection, types can be: masterSlave,masterMaster or replicaPairs. This is how singleServer info is saved:
{env, [{def,{masterSlave,{"localhost",27017},{"localhost",27017}}}]},

0 comments on commit b1b2c30

Please sign in to comment.