Code Monkey home page Code Monkey logo

snapshot-mongodb-adapter's Introduction

snapshot-mongodb-adapter

MongoDB Adapter for the Snapshot Store

Build Status Coverage Status Gitter

#CAUTION: Support for the adapter will end at 31 December 2017. Use https://github.com/prooph/mongodb-snapshot-store instead!

Set Up

How to use the adapter is explained in the prooph/event-store docs.

Interop Factory

Some general notes about how to use interop factories shipped with prooph components can be found in the event store docs. Use the mongodb snapshot adapter factory to set up the adapter. If your IoC container supports callable factories you can register the factory under a service id of your choice and configure this service id as $config['prooph']['snapshot_store']['adpater']['type'] = <adapter_service_id>.

Requirements

  • MongoDB >= 4.0
  • MongoDB PHP Driver >= 1.5.2

Indexing

For faster access to the snapshots, it's recommended to index the metadata.

For example:

    db.[your snapshot collection].files.createIndex({"metadata.aggregate_type": 1, "metadata.aggregate_id": 1, "metadata.last_version": -1});

or use \Prooph\EventStore\Snapshot\Adapter\MongoDb\MongoDbSnapshotAdapter::createIndexes

Support

Contribute

Please feel free to fork and extend existing or add new features and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.

Dependencies

Please refer to the project composer.json for the list of dependencies.

License

Released under the New BSD License.

snapshot-mongodb-adapter's People

Contributors

basz avatar codeliner avatar prolic avatar sandrokeil avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

snapshot-mongodb-adapter's Issues

Add missing index to avoid slow queries/inserts

To avoid slow queries/inserts we have to add an compund index for aggregate_id, aggregate_type and last_version. We have to investigate if other indexes are useful.

We can update the README.md.

Improve README

  • Provide link to event-store docs explaining usage of snapshots
  • Add a short note about factory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.