{"_id":"560e4066ad6b200d00ff471e","version":{"_id":"56000f0e8c0c9d0d00dcad24","project":"56000f0d8c0c9d0d00dcad21","__v":13,"createdAt":"2015-09-21T14:07:10.176Z","releaseDate":"2015-09-21T14:07:10.176Z","categories":["56000f0e8c0c9d0d00dcad25","56008f2497f69f1700f21a36","560091601503430d007cc936","560e0d8054af2b0d005bbe92","560e3ce7ad6b200d00ff471c","560e3cf2c4e4ae0d00b42ed1","561c81d0e822e12b00e1fe00","561c81e9e822e12b00e1fe01","561c823d20b4a92b007d5147","56257f8951bf1c0d001f660a","562d5f165bd25e0d0054dbd4","562d68d5d38b650d0044472a","56421aebb0dc090d00f88438"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"560e3ce7ad6b200d00ff471c","pages":["560e403bc4e4ae0d00b42ed7","560e4066ad6b200d00ff471e","5615e7f2a6767c0d0016699b","56a44cd75fb2530d00421b6f"],"project":"56000f0d8c0c9d0d00dcad21","__v":4,"version":"56000f0e8c0c9d0d00dcad24","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-02T08:14:31.057Z","from_sync":false,"order":2,"slug":"architecture-foundations","title":"Architecture Foundations"},"githubsync":"","__v":15,"user":"5600910981a9670d006d144f","project":"56000f0d8c0c9d0d00dcad21","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-02T08:29:26.703Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Introduction\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"You have likely been exposed to the same concepts as almost all database systems use a log for storing changes applied to the database, such as the [MongoDB Oplog](http://docs.mongodb.org/manual/core/replica-set-oplog/). The current state of the database can be recreated from this transaction log is needed, which is kind of an _event store_. Event sourcing is the application of this concept as the foundation for your system's state.\",\n  \"title\": \"Why haven't I heard of storing events before?\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Advantages\"\n}\n[/block]\nHistory: Having a true history of the system. Gives further benefits such as audit and traceability.\nAnswers: You never know which questions about your system/users you will ask in one year.\nTime travel: Ability to put the system in any prior state. (I.e. what did the system look like last week?)\nFlexibility: By storing all events your can create arbitrary read-model projections at any time in the project. This enables you to present your data in any number of ways and optimize it for the client-side.\nSpeed: Events are always appended, never updated or deleted which makes storing them blazing fast.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Further Reading\"\n}\n[/block]\n\n* [Martin Fowler - Event Sourcing](http://www.martinfowler.com/eaaDev/EventSourcing.html)\n* [Greg Young - Event Sourcing](http://docs.geteventstore.com/introduction/event-sourcing-basics/)\n* [Microsoft - Event Sourcing](https://msdn.microsoft.com/en-us/library/dn589792.aspx)","excerpt":"Current state is determined by history of changes","slug":"event-sourcing","type":"basic","title":"Event Sourcing"}

Event Sourcing

Current state is determined by history of changes

[block:api-header] { "type": "basic", "title": "Introduction" } [/block] [block:callout] { "type": "info", "body": "You have likely been exposed to the same concepts as almost all database systems use a log for storing changes applied to the database, such as the [MongoDB Oplog](http://docs.mongodb.org/manual/core/replica-set-oplog/). The current state of the database can be recreated from this transaction log is needed, which is kind of an _event store_. Event sourcing is the application of this concept as the foundation for your system's state.", "title": "Why haven't I heard of storing events before?" } [/block] [block:api-header] { "type": "basic", "title": "Advantages" } [/block] History: Having a true history of the system. Gives further benefits such as audit and traceability. Answers: You never know which questions about your system/users you will ask in one year. Time travel: Ability to put the system in any prior state. (I.e. what did the system look like last week?) Flexibility: By storing all events your can create arbitrary read-model projections at any time in the project. This enables you to present your data in any number of ways and optimize it for the client-side. Speed: Events are always appended, never updated or deleted which makes storing them blazing fast. [block:api-header] { "type": "basic", "title": "Further Reading" } [/block] * [Martin Fowler - Event Sourcing](http://www.martinfowler.com/eaaDev/EventSourcing.html) * [Greg Young - Event Sourcing](http://docs.geteventstore.com/introduction/event-sourcing-basics/) * [Microsoft - Event Sourcing](https://msdn.microsoft.com/en-us/library/dn589792.aspx)