Code Monkey home page Code Monkey logo

akkacqrs's Introduction

Hi there ๐Ÿ‘‹

My name is Bartosz Sypytkowski. I'm one of the core team members behind Yjs/Yrs ecosystem. If you need help with them (or have any other problems in Conflict-free Replicated Data Types domain), I'm available as a contractor. Feel free to DM me at Twitter or via email.

I'm a passionate about data management, distributed & concurrent systems, their internals, protocols and algorithms driving them. You can see some of the recent topics of my interest on my blog post. Some of my personal favourites:

While I look at the platform/runtime as a tool to achieve the goal, my personal weapons of choice include: Rust (which I had pleasure to work with when implementing JSON-like CRDT document database at ditto.live), Scala, F#, Go.

From time to time I manage to speak at user groups and conferences. Your can see some of my presentations on youtube and slideshare. Feel free to contact me (you can see e-email in my github profile).

Hall of fame

Some of the open source projects I contributed to:

  • Yrs - it's a Rust implementation of Yjs library (one of the most performant CRDT libraries for building rich collaborative documents), targetting multi-platform systems and serving as foundation for multiple language bindings including Web Assembly, C FFI, Python or Ruby.
  • Akka.NET - for over 5 years I was member of core-team, where I helped building a various parts of this distributed actor framework, including:
    • Akka.Streams, which is a reactive streaming library build on top of akka actors, that allows programmers to build a rich dataflow graphs with backpressure support. This also included building a direct API for safe and composable socker server and client as well as StreamRefs - surrogate objects used to transport and join Akka.Streams graph nodes over the network, allowing users to build a distributed, backpressured dataflows.
    • Akka.Persistence which is a plugin, that introduces support to actor state persistence by using eventsourcing techniques. Later on I also introduced Akka.Streams support to it as well as SQL database adapters.
    • Akka.DistributedData which introduced a decentralized, replicated in-memory key-value store build into akka cluster, based on Conflict-free Replicated Data Types. Later on it was extended to use optimized delta-state CRDTs and durable storage.
    • Akka.Cluster.Sharding which enabled automatic shard-based actor placement, with rebalancing strategy that enabled efficient cluster resource utilization.
    • Cluster split brain resolution strategy, which was reverse engineered from canonical Akka JVM documentation (it was not open-sourced back then).
    • Akka.Persistence.Reminders which extended eventsourced capabilities of Akka.Persistence to support long-running timers. It also included support to cron expressions.
    • Akka.Cluster.Discovery which is a node-discovery service, that enables to use 3rd party systems (like Hashicorp Consul) to mediate in akka cluster initialization.
    • F# pluggin for Akka
    • Support for mutli-datacenter aware clusters
    • Second shot to eventsourcing with support to replicated partially ordered event log - based on eventuate Akka library.
  • FSharp.Data.GraphQL which is Bazinga Inc. sponsored project, where I implemented a server-side part of GraphQL standard specification. Memorable challenge was to implement GraphQL-to-LINQ converter, that was using not only GraphQL query AST, but actually tracked usage of data members in underlying F# code used in field resolvers.
  • Hyperion which is a very efficient binary serializer, aiming to provide a wide features support eg. serialization of object graphs with cycles, serialization of expressions and delegates, version tolerance.
  • A growing collection of various Conflict-free Replicated Data Types, including state-, delta-state and operation-based ones (with example replication protocol support).
  • A F# utility library, with various extensions like high performance persistent vectors, hybrid-logical clocks, reentrant user-space read/write locks, set of operators over IAsyncEnumerable interaface or high performance actor implementation.

akkacqrs's People

Contributors

horusiath 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akkacqrs's Issues

ReceiveRecover and IEvent

First of all, I want to say that this is an awesome example that I have seen in the area of CQRS with AKKA.NET.

In lines 64 to 67 in the ReceiveRecover method, I see that ReceiveRecover can get an event other than the SnapshotOffer and it will update the state. I don't see a case that can happen other than it receives an event like RecoveryCompleted which should not update the state.

Could you please clarify when it is necessary to update the state in a ReceiveRecover method?

Router Vs Coordinator

In the extension.cs, a router has been used for userindex actor. Is there a reason why the other coordinators like account and user have not been used in a router but as an actor only?

Checking for termination

In the line 74 of AggregateCoordinator, there is a check for the terminated message. I can presume why there is a check, because the actor has to be removed from the list.

But I don't know why there is a check for pending commands from line 81 that done inside the block. Shouldn't the actor be recreated anytime there is a command for an actor and if it does not exist? In that case, shouldn't the code be from 81 to 91 outside of the if block as shown below?

     protected override bool Receive(object message) 
     { 
         var terminated = message as Terminated; 
         if (terminated != null) 
         { 
             // if Terminated message was received, remove terminated actor from terminating children list 
             _terminatingChildren.ExceptWith(new[] { terminated.ActorRef }); 
          }
         else 
         {
             // if there were pending commands waiting to be sent to terminated actor, recreate it 
             var groups = _pendingCommands.GroupBy(cmd => cmd.PersistenceId == terminated.ActorRef.Path.Name).ToArray(); 
             _pendingCommands = groups.First(x => !x.Key).ToList(); 
             var commands = groups.First(x => x.Key); 
             foreach (var pendingCommand in commands) 
             { 
                 var child = Recreate(pendingCommand.AggregateId, pendingCommand.PersistenceId); 
                 child.Tell(pendingCommand.Command, pendingCommand.Sender); 
             } 

             return true; 
         } 

         return false; 
     } 

Extension

I have seen the pattern of extending a class through inheritance by deriving the class from a base class of similar type. For example, in WebAPI a CustomerController is derived from APIController. The class Extension and ExtensionProvider has confused me. To me, it is more like configuring a run time object but the name Configure would have been more appropriate?

Could you please explain the CqrsExtension achieved with InjectTopLevelFallback?

Monitoring

While I'm running the application locally, I don't see any response after this line

child.Forward(command);

The sign up page returns with a 500 Internal Server Error and simply don't proceed from there.

I noticed that monitoring is integrated with the application. But I don't see any logs in the Visual Studio output window neither any logs in the BIN or OBJ folder.

Could you please let me know if I have to install any special software like Kamon and Stasd to see the logs?

akkacqrslog

I updated the HOCON to the following. I still don't see any logs in the output window:

  <akka>
    <hocon>
      <![CDATA[
        akka {
          loglevel = DEBUG
          loggers = [ "Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog" ]
          actor {
            autoreceive = on
            lifecycle = on
            fsm = on
          }
        }
      ]]>
    </hocon>
  </akka>

Withdrawal method

I think the method PatchWithdrawal should return an object which should contain the account and balance. Or another GET method to return an account which shows the balance.

Code snippet: public async Task PatchWithdrawal(Withdraw request)

Do you have any thoughts on where to incorporate this?

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.