Giter Club home page Giter Club logo

xoom-symbio's Introduction

xoom-symbio

Javadocs Build Download Gitter chat

The VLINGO XOOM platform SDK delivering Reactive storage that is scalable, high-throughput, and resilient for CQRS, Event Sourcing, Key-Value, and Objects used by services and applications.

Docs: https://docs.vlingo.io/xoom-symbio

Name

The name "symbio" highlights the symbiotic relationship between domain models and persistence mechanisms. Domain models must be persisted and individual parts must be reconstituted to memory when needed. Persistence mechanisms crave data to store. Hence we can conclude that the two need and benefit from the other.

Interestingly too is that the name "symbio" ends with the letters, i and o, for input and output. The StateStorage, introduced next, produces domain model output to disk, and input from disk back to the domain model.

Journal Storage

The Journal and related protocols support simple-to-use Event Sourcing, including JournalReader for streaming across all entries in the journal, and StreamReader for reaching individual "sub-streams" belonging to entities/aggregates in your application. There is a growing number of implementations:

  • JDBC over Postgres: PostgresJournalActor and supporting asynchronous readers
  • FoundationDB support: FoundationDBJournalActor and supporting asynchronous readers

State Storage

The StateStore is a simple CQRS Key-Value (Key-CLOB/BLOB) storage mechanism that can be run against a number of persistence engines. Use it for both Command/Write Models and Query/Read Models. These are the available storage implementations:

  • In-memory binary: InMemoryBinaryStateStoreActor
  • In-memory text: InMemoryTextStateStoreActor
  • DynamoDB Text Store: DynamoDBTextStateActor
  • DynamoDB Binary Store: DynamoDBBinaryStateActor
  • General-purpose JDBC: JDBCTextStateStoreActor
  • Apache Geode: GeodeStateStoreActor

The JDBCTextStateStoreActor has these database delegate implementations:

  • HSQLDB: HSQLDBStorageDelegate
  • PostgresSQL: PostgresStorageDelegate

Adding additional JDBC storage delegates is a straightforward process requiring a few hours of work.

We welcome you to add support for your favorite database!

Object Storage

The ObjectStore is a simple object-relational mapped storage mechanism that can be run against a number of persistence engines. These are the available implementations:

  • Jdbi over JDBC: JdbiObjectStoreDelegate controlled under JDBCObjectStoreActor
  • JPA standard: JPAObjectStoreDelegate for JPA implementations, including EclipseLink, OpenJPA, and Hibernate

Installation

  <dependencies>
    <dependency>
      <groupId>io.vlingo.xoom</groupId>
      <artifactId>xoom-symbio</artifactId>
      <version>1.11.1</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
dependencies {
    compile 'io.vlingo.xoom:xoom-symbio:1.11.1'
}

License (See LICENSE file for full license)

Copyright © 2012-2023 VLINGO LABS. All rights reserved.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

xoom-symbio's People

Contributors

alanstrait avatar aleixmorgadas avatar alexguzun avatar buritos avatar d-led avatar danilo-ambrosio avatar davemuirhead avatar dependabot[bot] avatar hamzajg avatar jakzal avatar kmruiz avatar pflueras avatar vaughnvernon avatar vlingo-java avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xoom-symbio's Issues

The mapping registration should be moved outside ObjectStore

Curently the ObjectStore protocol defines a method used to register mapping for a given persistent type.

void registerMapper(final PersistentObjectMapper mapper);

Most of the stores simply proxy the call to their persistent delegates and do nothing more.
With the introduction of io.vlingo.symbio.store.dispatch.Dispatchable the store has to have the mapping for it. Also a copy of the store delegate is usually used by DispatcherControlActor actor. More details in this discussion: vlingo/xoom-symbio-jdbc#14 (comment)

It makes more sense to register the mapping directly with the persistent delegate.
The idea is to create an interface, for example ObjectStoreDelegate that defines the registerMapper implementation.

This will allow the clients to register all the necessary mappings, including the one for io.vlingo.symbio.store.dispatch.Dispatchable before creating the actor.

With the new Object store delegate interface, the following projects must also be changed:

JDBCJournalActor can no longer be initialised with the Journal factory

I stumbled upon this issue while upgrading from vlingo 1.3.0 to 1.4.0.

Since vlingo/xoom-symbio-jdbc#43, the Journal factory no longer works:

Journal.using(stage, JDBCJournalActor.class, dispatcher, configuration);

The implementation assumes that dispatcher is part of argument list:

static <A extends Actor, T, RS extends State<?>> Journal<T> using(final Stage stage, final Class<A> implementor,
          final Dispatcher<Dispatchable<Entry<T>,RS>> dispatcher, final Object...additional) {
    return additional.length == 0 ?
             stage.actorFor(Journal.class, implementor, dispatcher) :
             stage.actorFor(Journal.class, implementor, dispatcher, additional);
  }

While it is still valid for some implementations (like InMemoryJournalActor) it is no longer the case for JDBCJournalActor.

/cc @pflueras

Implement Storage for DynamoDB

Hello!

I created this issue just to give you tracking about the implementation of the DynamoDB storage delegate. Suggestions are welcome because it will be my first contribution to vlingo!

Assumptions:

  • I need to write an Actor that implements TextStateStore (as in the JDBCTextStateStoreActor)
  • Interests are like promises

Questions:

  • What is the dispatcher doing actually? Where can I find some documentation? Do I need to implement it also in my TextStateStore?

Thanks for your time!

Make State Data Optional

Currently the State::metadata()::object() may or may not be available. The current contract is to check for null. Implement the means to check for presence/absence using Optional.

Need Clarity Around SourcedTypeRegistry and Sourced<T> and Defaulted Adapters

I migrated a very small PoC to vlingo-symbio to see how it works. I looked into vlingo-schemata for the setup. It works so far but I noticed a few things:

  • vlingo-symbio needs some 'ceremonial' code to register EntryAdapter (e.g. see https://github.com/vlingo/vlingo-schemata/blob/master/src/main/java/io/vlingo/schemata/infra/persistence/EntryAdapters.java)
    -- all the EntryAdapters are looking equal, so maybe it would be an option to have a factory in SourceTypeRegistry that could generate default EntryAdapters if not custom was found
    -- all EntryAdapters needs to be registered twice. Once in the in the Journal and once in the SourceTypeRegistry. This is somehow error prone, and won't be necessary if the journal would use the SourceTypeRegistry
    Somehow the generics do not work for me:
    -- SourcedTypeRegistry.Info<T> just works as you leave out the type parameter (see https://github.com/vlingo/vlingo-schemata/blob/master/src/main/java/io/vlingo/schemata/infra/persistence/EntryAdapters.java again). This is because Info expects a Journal<T> and a Class<Sourced<T>> as parameter. If using Journal<String> like for the Postgres journal, the Sourced actor needs to be Sourced<String> too. But that does not work, as EventSourced is Sourced<DomainEvent> ...
  • maybe just the signature of Info needs to be fixed e.g. to Info(final Journal<T> journal, final Class<Sourced<DomainEvent>> sourcedType, final String sourcedName)
    -- Every quick fix I could imagine would not work (e.g. to make PostgresJournal an Journal<DomainEvent>)
  • I'm not sure if this is the same for all other journal implementations, but Entry has an id property, that is used nowhere. This is somehow confusing.

Default Adapters

Adapters do more than just serialize and deserialize, but at the beginning in most cases you don't need these extra functions as your events have version 1 and upcasting, etc., is not necessary. Therefore, you could have a factory that could be either overridden to create customized Adapters or the factory just comes into play if no custom adapter has been registered.

Move Concrete Implementations to Implementation-Specific Repositories

The DynamoDB implementation is very heavyweight because its use requires the download of the local test environment dependencies for DynamoDB. On a non-optimal network that I had to use recently it required approximately 3 hours to get all the dependencies. (It's attributed to how Amazon has packaged the dependencies, which requires downloading all revisions and patches to the Java API that ever existed.) Although not a fault of the author/contributor, this is unacceptable and will hamstring adoption of vlingo-symbio for those not interested in a DynamoDB implementation. Moving this outside the vlingo-symbio core also sets a precedent for how other implementations will/can be provided.

-- @kmruiz Please move the DynamoDB support to vlingo-symbio-dynamodb
-- I will move the JDBC support to vlingo-symbio-jdbc

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.