README.md in sandthorn-1.2.0 vs README.md in sandthorn-1.3.0

- old
+ new

@@ -256,13 +256,10 @@ If there is a lot of events saved to an aggregate it can take some time to reload the current state of the aggregate via the `.find` method. This is because all events belonging to the aggregate has to be fetched and iterated one by one to build its current state. The snapshot functionality makes it possible to store the current aggregate state and re-use it when loading the aggregate. The snapshot is used as a cache where only the events that has occurred after the snapshot has to be fetched and used to build the current state of the aggregate. There is one global snapshot store where all snapshots are stored independent on aggregate_type. To enable snapshot on a aggregate_type the Class has to be added to the `snapshot_types` Array when configuring Sandthorn. The aggregate will now be stored to the snapshot_store on every `.save` and when using `.find` it will look for a snapshot of the requested aggregate. -Currently its only possible to store the snapshots in memory, so be careful not draining your applications memory space. - - ```ruby class Board include Sandthorn::AggregateRoot end @@ -270,11 +267,11 @@ Sandthorn.configure do |c| c.snapshot_types = [Board] end ``` -Its also possible to take manual snapshots without enabling snapshots on the aggregate_type. +Its possible to take manual snapshots without enabling snapshots on the aggregate_type. ```ruby board = Board.new board.save @@ -282,9 +279,25 @@ Sandthorn.save_snapshot board # Get snapshot snapshot = Sandthorn.find_snapshot board.aggregate_id ``` + +### External snapshot store + +There is one external snapshot store available [sandthorn_snapshot_memcached](https://github.com/Sandthorn/sandthorn_snapshot_memcached) and it can be configured via `Sandthorn.configure` + +```ruby +require 'sandthorn_snapshot_memcached' + +snapshot_store = SandthornSnapshotMemcached.from_url "memcached_url" + +Sandthorn.configure do |conf| + conf.snapshot_store = snapshot_store +end +``` + +**If no external snapshot store is configured snapshots will be stored in the application memory (be careful not draining your application memory space).** ## Bounded Context A bounded context is a system divider that split large systems into smaller parts. [Bounded Context by Martin Fowler](http://martinfowler.com/bliki/BoundedContext.html)