level51/silverstripe-data-documents

A CQRS-style approach for managing data redundancy "the good way"

Installs: 22

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

0.1.0 2023-09-18 16:46 UTC

This package is auto-updated.

Last update: 2024-10-18 19:20:38 UTC


README

Low-effort approach for syncing your DataObject with document-based payload stores such Firestore, Elasticsearch, Redis, ...

Inspired by the CQRS pattern, you can think of this module as a headless approach without any public API exposed by your Silverstripe app.

Installation

Make sure to require the base module...

composer require level51/silverstripe-data-documents

...and the payload store adapter of your choice.

  • Firestore: composer require level51/silverstripe-data-documents-firestore
  • (adapter library in the making)

It is faily easy to create your own adapter. Just create a class and make it implement the DataDocumentStore interface.

Recipe

  1. Install or create a document store adapter
  2. Make your DataObject implement the DataDocument interface
  3. Start manipulating your DataObject and check your document store

What is CQRS?

CQRS is an architectural pattern that separates the concerns of reading (query) and writing (command) operations in your application. This separation provides several benefits, including improved performance, code organization, and maintainability.