{"action":"created","issue":{"url":"https://api.github.com/repos/prooph/event-store-mongodb-adapter/issues/12","labels_url":"https://api.github.com/repos/prooph/event-store-mongodb-adapter/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/prooph/event-store-mongodb-adapter/issues/12/comments","events_url":"https://api.github.com/repos/prooph/event-store-mongodb-adapter/issues/12/events","html_url":"https://github.com/prooph/event-store-mongodb-adapter/issues/12","id":101716006,"number":12,"title":"Question: Write Concern Levels","user":{"login":"prolic","id":394428,"avatar_url":"https://avatars.githubusercontent.com/u/394428?v=3","gravatar_id":"","url":"https://api.github.com/users/prolic","html_url":"https://github.com/prolic","followers_url":"https://api.github.com/users/prolic/followers","following_url":"https://api.github.com/users/prolic/following{/other_user}","gists_url":"https://api.github.com/users/prolic/gists{/gist_id}","starred_url":"https://api.github.com/users/prolic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prolic/subscriptions","organizations_url":"https://api.github.com/users/prolic/orgs","repos_url":"https://api.github.com/users/prolic/repos","events_url":"https://api.github.com/users/prolic/events{/privacy}","received_events_url":"https://api.github.com/users/prolic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-18T18:09:00Z","updated_at":"2015-08-18T18:34:04Z","closed_at":null,"body":"Currently we use acknowledged write concern, which does not confirm that the write operation has persisted to the disk system.\r\n\r\nWe could switch to journaled.\r\nWith a journaled write concern, the MongoDB acknowledges the write operation only after committing the data to the journal. This write concern ensures that MongoDB can recover the data following a shutdown or power interruption.\r\n\r\nAdditonally: We can ack for replica sets.\r\nWith replica acknowledged write concern, you can guarantee that the write operation propagates to additional members of the replica set (not only the primary server).\r\n\r\nIf we want to use replica acknowleged write concern, we could need additional options for the mongo adapter in the constructor (how many replicates and timeout).\r\n\r\nFor more information about this see:\r\n\r\nhttp://docs.mongodb.org/v3.0/core/write-concern/\r\nhttp://docs.mongodb.org/v3.0/core/replica-set-write-concern/\r\n\r\nImho the journaled acknowlegement makes sence, since we don't want to lose information when there is a server crash following microseconds after we persisted an event when it's not yet written to disk. But do we need to have acks for distributing them across replicas?"},"comment":{"url":"https://api.github.com/repos/prooph/event-store-mongodb-adapter/issues/comments/132311357","html_url":"https://github.com/prooph/event-store-mongodb-adapter/issues/12#issuecomment-132311357","issue_url":"https://api.github.com/repos/prooph/event-store-mongodb-adapter/issues/12","id":132311357,"user":{"login":"codeliner","id":5131987,"avatar_url":"https://avatars.githubusercontent.com/u/5131987?v=3","gravatar_id":"","url":"https://api.github.com/users/codeliner","html_url":"https://github.com/codeliner","followers_url":"https://api.github.com/users/codeliner/followers","following_url":"https://api.github.com/users/codeliner/following{/other_user}","gists_url":"https://api.github.com/users/codeliner/gists{/gist_id}","starred_url":"https://api.github.com/users/codeliner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeliner/subscriptions","organizations_url":"https://api.github.com/users/codeliner/orgs","repos_url":"https://api.github.com/users/codeliner/repos","events_url":"https://api.github.com/users/codeliner/events{/privacy}","received_events_url":"https://api.github.com/users/codeliner/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T18:34:04Z","updated_at":"2015-08-18T18:34:04Z","body":"yeah, sounds like `journaled` is the best default. But would be great to allow the user to configure the writeConcern. Can we pass a `WriteConcernOptions` object as optional parameter to the constructor?\r\nSupporting all options defined here: http://docs.mongodb.org/v3.0/reference/connection-string/#write-concern-options\r\nIn this case setting the `WriteConcernOptions` via a setter would also be ok because the adapter does not need them to function correctly.\r\n\r\nEvents are the only source of truth so I can imagine that some users want to use the replica set write concern."}}