Skip to main content

3 posts tagged with "eigr-functions"

View All Tags

· 9 min read
Adriano Santos
Marcel Lanz

Recently a article launched by the Amazon Prime team reactivated the Monoliths versus Microservices discussion. It is remarkable, and often reproachable, how many fervent feelings there are around this already old discussion. I've always wondered what the point really was between these two conflicting worldviews. And I could never understand why so much energy is expended on this type of discussion.

In this article we intend to introduce you to why it's time to move forward and how our Spawn technology can help developers let go of these age-old issues, and that do not add much value to the business.

Monoliths

Monoliths

Monolithic architecture is given by a single, undivided system that runs in a single process, a software application in which different components are linked to a single program within a single platform. As the entire system is in a single block, its initial development can be more agile, making it possible to develop an application in less time and with less initial complexity, notice the initial word.

As a monolithic application evolves, several classes, modules, methods or functions are added to this same code and process. Another point is that monolithic applications tend not to scale horizontally well, since all the general functionality of a system is tied to a single process it is expected that this type of application scales better vertically than horizontally. This particular characteristic also makes it difficult to implement this type of system in environments such as Kubernetes or other types of Cloud environments, notice that I said difficult and not unfeasible.

And this is where the problems with this type of architecture usually start to appear. In other words, the issue with monoliths seems to be directly related to the scale of the system in question. The more complexity you add, the harder it gets to maintain, which requires more complexity to mitigate the problem, which makes it harder to maintain.... well, you get the point. To get around these effects, there are many software engineering patterns that help to mitigate such failures (facades, ports, adapters, interface programming and so on), all this additional complexity turns out to be a good price to pay for its defenders, to a certain extent.

Microservices

Microservices

What differentiates the microservices architecture from more traditional monolithic approaches is how it decomposes the application into smaller units. Each unit in turn is called a service and can be created and deployed independently. In other words, each individual service can work or fail without compromising the others. This helps you embrace the technology side of DevOps and make constant iteration and constant delivery (CI/CD) more streamlined and feasible (at least in theory). In terms of scaling microservices tend to scale better horizontally than vertically and this in turn is better for infrastructures powered by Kubernetes, Serververless, or even other types of Cloud environments.

But not everything is flowers with microservices. Microservices, generally, increase the complexity in managing failures and in the control of expenses with infrastructure. Developers had to become experts in distributed and large-scale systems. To deal with it all, over the years several techniques have emerged to avoid various problems of distributed systems, as well as the advent of Observability and FinOps techniques that helped to control infrastructure costs, allowed the architecture of microservices to become extremely popular.

Spawn and Beyond

I could write dozens of pros and cons of each of these architectures and, at least for us, I would never come up with an outright winner. The undeniable fact is that both have great strengths and equally great flaws. We are without a winner and therefore we need to let go and go further.

In simple terms, what we here in the Eigr community believe is that developers, in general, need a platform that is, among other things, be simpler, dynamic, vendor lock free, focused on the business domain and not on precious technicalities, and that adapts well to the granularity your business requirements demand.

Now let's introduce our Spawn technology and try to explore a little bit of how it can help us go further.

Spawn is primarily based on three very powerful abstractions, the Sidecar Pattern, the Actor Model and the Serverless. The former allows you to deploy an application's components in a separate process or container providing isolation and encapsulation. This pattern enables applications to be composed of heterogeneous technologies and components, while allowing this separate process to handle the infrastructure layers without affecting the evolution of your business code. In turn, the second is a fascinating and relatively simple alternative for the development of distributed and concurrent systems. This model allows you to decompose your system into small units, called actors, that communicate only by passing messages. Actors encapsulate state and behavior in a single unit, and are lock-free, that is, when programming with actors you are free of semaphore, mutex and any type of synchronizing code. And finally Serverless lets developers focus on their code without worrying about the infrastructure. Using Kubernetes as an orchestrator for our serverless workloads we can provide a self managed platform without forcing the developer to be tied to any existing public cloud offerings. Free from blockages!

However, it goes beyond the basics of the Actor Model by exposing several software patterns in a simplified way for the developer. Spawn is also domain oriented to your business, allowing you to focus directly on the business problem, while the Spawn runtime handles things like state management and persistence, caching, inter-process calls, scalability, cluster management, scaling up and down, integration with external middleware, among many other non-functional requirements that software usually needs to achieve its final goals.

Spawn is also a polyglot platform, allowing you to write Actors in different languages and allowing them to communicate with each other in a totally transparent way without the need to define REST or RPC interfaces between your components. Being based on the powerful Erlang technology you get the best of what the, battle tested, Erlang Virtual Machine is capable of providing without giving up your natural domain language, be it Java, Typescript, Elixir, or another.

Now that we have a basic idea about Spawn we can move on to how it can help us move beyond the discussion of Monoliths and Microservices.

Services, Applications, and Granularity

To understand how Spawn can help us move the discussion forward, we first need to understand how Spawn organizes its deployable components. The most basic unit of Spawn is the Actor, it is through Actors that developers can express their domain problems and as we said before the Actor is responsible for encapsulating the state and its associated behavior in itself.

Actors

That said, a Spawn application in a simplified way is nothing more than a series of Actors organized in an deployment unit that we can call service or application, but which in our terminology we call ActorHost. An ActorHost is the deployable unit which is made up of the host container (where the developer works) plus the proxy container which is where the actors actually perform their tasks.

ActorHost

You can have hundreds or even thousands of actors running on a single ActorHost and that in turn can have multiple replicas running on a cluster. As Spawn Actors are activated only when there is work to be done and are deactivated after a period of inactivity, the workloads are distributed among different replicas of the same ActorHost. From the developer's point of view, it doesn't matter because the only thing he needs to be able to send a message to an actor is his name. No complicated APIs with additional worries like service discovery, circuit breakers or anything else.

Replicas

And finally your ActorHost are grouped within a more general system that we call ActorSystem. All ActorHost applications within the same actor system actively communicate with each other forming a real cluster of nodes. Think of an ActorSystem as a distributed container. An actor within an actor system can still communicate with another actor within another actor system in a transparent way for the developer, but the difference is that this communication is done across different networks. That is, ActorSystem provides the network isolation of a set of ActorHost, allowing even very large systems to maintain a high level of isolation and allowing better resource management and avoiding non-essential communication overhead.

ActorSystem

As seen above through Spawn you can talk to different grain sizes to achieve your goals without having to think too hard about how to connect the parts. You can group all your actors within a single application or break it into smaller parts, but the way you interact between these components will not change, this type of architecture has become an industry trend and we proud to say that Spawn thought of all this a long time ago and has leveraged this initiative with our Spawn technology.

Conclusion

This whole discussion around Microservices vs Monoliths is a lot of fun and a excellent mental exercise, but we as software engineers must remember that at the end of the day, it is our deliveries of value to the business that will make the difference. Spawn with its polyglot serverless experience, using the full potential of Cloud's open standards can help you take big steps in that direction. Without you having to waste precious hours around such warm discussions and far from the big goal. Solve your business problems!

In this post we demonstrate that our Spawn technology based on important industry standards and focused on bringing agility to developers' day-to-day is a valuable tool for you to achieve your business goals without having to give up the scalability and resiliency that the today's world demands. We could talk a lot more about Spawn (Activators, Workflows, exposing APIs in a declarative way and much more) but that will be for other posts, today we focus on how Spawn will help you get out of this discussion about Monolithics and Microservices. See you again soon!

· 3 min read
Adriano Santos
Marcel Lanz

Lately we decided to promote Spawn from eigr-labs to the main eigr github organization: https://github.com/eigr/spawn. At the same time we archived the massa proxy repository and explained our motivation behind it.

It has been three years ago when we met in a new open source community while we tried to make a then shiny new project successful–https://cloudstate.io/. While we've discovered and also implemented a communications procotol for a multitude of programming languages, we constantly iterated on ideas how to build a system that is able to scale and also being usable on many places not only on backend services. At the time we discovered the serverless space, having also solved the stateful aspect of it by using a then promising new procotol and concept called Cloudstate. After some re-priorization with the project as a whole, the core OSS community moved on to build eigr.io and discover our ideas under this new umbrella organization https://eigr.io/.

The Actor Mesh

The Actor Mesh

Over the last couple of months, Spawn has been shaped by our vision to have a simpler and more focused way to bring an actor system to a polyglot environment, where the way of how components can interact like Actors and Processes do, is not that well known in other languages. eigr/Massa always was about to solve the challenge of stateful serverless, like it took the vision from its originating project. But at the same time Massa also tried always to solve two things at the same time. Building a polyglot serverless runtime and also solve the aspect of statefull serverless has been sometimes being too much at the same time. Spawn is a focused effort to solve one problem first, and then, being enabled to build the stateful aspect of serverless on top of it. In this regard, we focus now on something that is that enabler and perhaps one for other problems to solve.

This has been the work of ours lead by Adriano with help from Wesley and Elias; beside that I was able to participate a bit in discussions and presenting our project a two occasions over the last year. I'm looking forward to see Spawn growing into something really cool, special and useful. There is still a lot of work ahead of us and we're very exited to see how we can collaborate and grow as a project.

The Future of Eigr is based on Spawn

We are 100% focused on making Spawn a robust, scalable, dynamic and expandable platform, taking us far beyond what we imagined we were capable of in the initial Cloudstate project and with our previous implementation of Massa. Massa has served us brilliantly as a means of experimentation, and now I feel deeply that we are ready to accomplish whatever we set out to do.

We invite everyone who is here to download and try Spawn and that we are ready to welcome those who want to contribute, whether with doubts, suggestions, a little code is also welcome, or a text review, any contribution is welcome. We greatly admire all of you who are interested in our project.

· 5 min read
Adriano Santos

My name is Adriano, I'm a software engineer, I'm 40 years old, I'm Brazilian, and I've been in the technology area for over 20 years on different fronts and having worked in a long list of companies, I'm also the co-founder of the Eigr project together with @marcellanz and @guyso, previously the three of us were core members of the Cloudstate project and mainly worked on the supporting SDKs, but we also participated in the central development of Cloudstate technology and collaborated a lot on the development mainly of its protocol.

I see that many of you have just arrived here and that's why I think it's important to give an overview of what we do and talk a little about the current status of the project.

Well, let's go!

Overview:

Our ecosystem is called Eigr, and we focus mainly on the following projects:

  • Eigr Functions Controller: it's our deployment brain in Kubernetes, it controls the entire lifecycle of our sidecar along with user functions.

  • Massa: is a Sidecar Proxy and part of the Eigr Functions offering that aims to provide a high-level abstraction for General Purpose Stateful Serverless application development.

Massa is responsible for managing the entire data access infrastructure for user functions, as well as other technical tasks such as providing the implementation of the user contract via gRPC to the outside world, transcoding HTTP requests to gRPC, caching, making requests to external sources when requested and other tasks that would once have to be performed by the developer directly in his application.

With Massa the developer only has to worry about their domain objects and their user service interface via a contract-first declarative approach. These two components together form Eigr Functions.

In addition to these projects, we also work on several other R&D projects that allow us to understand certain parts of the problem we are trying to solve and thus apply the acquired knowledge to the main projects. Research projects worth noting are the following:

  • Falco: A fork of the elixir-grpc project where we try to improve performance and provide a replacement for the original project that is not being updated by the community that created it. Its development continues in research status.

  • Steinadler: A high-level alternative to Erlang Distribution. While we are aware of the incredible capabilities of the Erlang Distribution, we also know that there are numerous deficiencies in this protocol that we are trying to address. Its development is currently at a standstill.

  • Spawn: The Actor Mesh Framework is based on the [sidecar proxy pattern] (https://dzone.com/articles/sidecar-design-pattern-in-your-microservices-ecosy-1) to provide the multi-language Actor Model framework. Spawns' technology-stack on top of the BEAM VM (the Erlang virtual machine) provides support for different languages from its native Actor model. Spawn is made up of the following components:

    1. A semantic protocol based on Protocol Buffers.

    2. A Sidecar Proxy written in Elixir that implements this protocol as well as persistent storage adapters.

    3. SDKs to support different programming languages.

    Spawn is currently in full development where its main parts will likely be incorporated into the core of Massa.

  • Astreu (https://github.com/eigr/Astreu): High-performance Messaging System based on a gRPC protocol written in Elixir. Your development is on hold (usable for testing).

info

In addition to these projects we have the Eigr Functions SDKs which are written in some programming languages ​​like Elixir, Go, Java and others. Each of these projects is in different phases of development but none are yet readily functional.

Eigr Functions!

Currently, the Massa project, where our greatest effort is concentrated, is capable of communicating with user functions that implement the Cloudstate protocol in version 0.5 and is capable of dealing only with Action-type entities, which are stateless entities.

In the next version of our proxy, we will probably no longer support the Cloudstate protocol because, once Cloudstate has been discontinued, we will adopt our own Protocol and entities.

We intend to support all the original project entity types, namely Action a.k.a. Stateless support, Event Sourcing, Value Entity (CRUD), and CRDTs (Conflict Free Replicated Data Types). We will just not bring the semantics of the previous protocol, and creating our own protocol to support these entities.

So we are in the process of a complete redesign of our protocol and therefore our proxy as well. We are doing this with proof of concepts in parallel projects and in project-specific branches within Massa.

This is a summary of what we have done and where we intend to go. I hope to be able to count on your collaboration in any way, with code, with good discussions, answering doubts, or just making small talk around here.

I'm curious to know a little more about you and what you expect from us.

Ah, I was forgetting, for those who want to know the reasons for the name Massa I suggest reading here.

Thanks for reading!