Structuring Akka Serverless Projects?

Howdy All,

I would like some guidance please on how best to structure our planned system in Akka Serverless. The system includes a number (8-10) of subsystems / separate applications with their own ubiquitous language / bounded contexts from DDD. Of course, each bounded context will have a number of different aggregate roots implemented using services in Akka Serverless.

What is a good way to organise such a project (focussing on development speed and ease at this time)? Having all the subsystems in one Akka Serverless project or a separate project for each subsystem? If just one project how do we organise all the services so they are grouped according to which subsystem they are in? Subsystems will also be driven by events from other subsystems.

It’s interesting to me that the separation of subsystems, at least as far as I understand, now becomes somewhat of a logical separation in deployment, i.e. deployment is just in essence a collection of services. It would be good and I think important though to be able to group services together and manage (e.g. start, stop, restart, deploy) these groups / subsystems independently.

I’m also thinking about how this would translate into the development side of things, and I am considering using Yarn or NPM Workspaces to hold the subsystems / collections of services in one repo. It would seem to be useful to be able to publish an application / package / collection of services in a workspace to a groups / collections of services within an Akka Serverless project or subproject.

Sorry for the long description and thanks in advance for any thoughts / suggestions.


Ok, I see the akkaserver-ecommerce-javascript example has three entities / services in subfolders, with each being a package.

I wonder if we should make that a monorepo (with something like Lerna / Yarn Workspaces) to automate development.

Then we would need to perhaps have a monorepo for each subsytem / bounded context or combine the monorepos?

Hi Ashley!

I happen to be the author of the akkaserverless-ecommerce-javascript app, and I’d be more than happy to share the thoughts around my structure.

With that sample, I tried to break up my eCommerce application into separate logical units (I’d almost call them business units) that would make it easier for me to deploy them separately. In my case, each logical unit has only one entity associated with it, but I could definitely have created those logical units with multiple entities. My structure, focusing on the ease of development from my side, was mostly following the ideas of Martin Fowler’s Microservices and Bounded Contexts.

In the case of the eCommerce sample app, I could indeed speed things up a bit more by using tools like Lerna or Yarn Workspaces. I appreciate your ideas :slight_smile:

1 Like

Is this app contained in one Akka Serverless project?

Yup, I deploy the four services (cart, orders, users, and warehouse) into one single Akka Serverless project. The services are unique and focus on one individual thing, but together they form the eCommerce shop.

1 Like

I’d like to do something like this in Java, in fact I am. Right now I have a new sample I’m working on with numerous entities, views and actions. I would like to working on them together as a single unit at development time, but have them deploy as separate units according to best practices for runtime.

1 Like