Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with external/remote Services #93

Open
sleipnir opened this issue Oct 26, 2022 Discussed in #92 · 6 comments
Open

Integration with external/remote Services #93

sleipnir opened this issue Oct 26, 2022 Discussed in #92 · 6 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed protocol Specification of protocol proxy sdks Support languages
Milestone

Comments

@sleipnir
Copy link
Member

Discussed in #92

Originally posted by sleipnir October 26, 2022
One of the mainstays of what we do with Eigr, inherited from the Cloudstate days and discussed later on Massa (a discussion was opened but the ideas were never properly recorded here, and which Marcel and I discussed a few times), is the idea of that we should abstract the infrastructure, and by infrastructure I don't just mean the state, from the developer. So that he can think only in terms of Business Domain and not so much in infrastructure code. We know, of course, that this is an almost utopian goal because, no matter what we do, the developer will always want to do more or another way. However, I think it is healthy to give him the tools possible so that he can at least greatly reduce his need to touch the infrastructure.

This is how I present the idea of ​​Actors acting as a proxy for remote services or APIs. So that it continues to use the current way of invoking actors to also access remote services.

We could call these special actors ProxyActors or BindingActors. They in turn could be registered in the traditional way that actors are registered but we would create a new category of Commandos (today we have Commands and TimerCommands) that we would use to map remote services to Spawn actions. It would probably also be necessary to create additional attributes in the ActorSettings of the Actor so that the proxy knows that it is an actor that only acts as a proxy for a service. So that it can perform the necessary request based on the configurations of the given commands.

I think each SDK could have good ways of declaring this new Actor type. In Java they would probably just be an annotated Interface, in Elixir they could be behaviors and etc...

One thing we must take into account is the types of formats we will support. At first I find it easy to support HTTP+Json since protobuf types can be easily transformed into Json types. gRPC would be more complicated as we would have to dynamically generate a grpc client and I think this is quite complicated to do at first. Once the user defines the types in the usual Protobuf-based way we could transcode this to Json types easily I think.

It would not be possible to have actors of this type persistently, but we can certainly investigate that option as well. Maybe it's not smart to mix these concepts, maybe it is, the fact is that I don't know the best approach for this case.

Wdyt?

@sleipnir sleipnir added enhancement New feature or request help wanted Extra attention is needed protocol Specification of protocol proxy sdks Support languages labels Oct 26, 2022
@sleipnir sleipnir added this to the v1.0.0 milestone Oct 26, 2022
@sleipnir
Copy link
Member Author

Any thoughts here guys?

@sleipnir
Copy link
Member Author

sleipnir commented Nov 2, 2022

ping @marcellanz @eliasdarruda

@sleipnir
Copy link
Member Author

sleipnir commented Nov 3, 2022

Guys, I'm going to follow with a PR. So we can discuss with something concrete

@sleipnir
Copy link
Member Author

sleipnir commented Jan 13, 2023

@eliasdarruda @marcellanz Perhaps we can start this off by making use of the Worflows API by including this in Forward and SideEffects. Instead of trying to start with a complete entity like the Actor, we can just use the Forward feature and implement remote invocation through it.

@marcellanz
Copy link
Member

Great idea, like that a lot. From spawns point of view a forward fits well with an external remote service invocation.

@sleipnir
Copy link
Member Author

Great idea, like that a lot. From spawns point of view a forward fits well with an external remote service invocation.

I think the big difficulty to implement this is the types. Spawn knows very little about users' data types, types for Spawn are nothing more than a byte array and some information coming from Any of type protobuf. Serializing and deserializing without the proxy having the actual compiled types can be a problem.
This is actually something of a boon and a curse for the proxy. The fact that user types are opaque to the proxy is good for security, but it prevents the proxy from doing some things that Massa was possible to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed protocol Specification of protocol proxy sdks Support languages
Projects
None yet
Development

No branches or pull requests

3 participants