Guys I have one doubt.as per my knowledge if I create service action then it will create week dependency and it will follow microservice architecture.but if I expose rest API for same server action is it follow the microservice architecture.because I think service action method will not calculate the ao count but if I expose rest API method from CS module and that API I am consuming in end-user module then all method will calculate the ao count.
Tell me one thing service action back end is also rest API.if I create rest API and call the rest API method through out end user module is it following microservice architecture.both are rest API.only can see the ao count disadvantage for rest API implementation.
Basically I have core module(service module) in core application.what is the best approach for microservice architecture.
1)in same service module I can create service action and all service I can consume from end user
2)in same module I can expose rest API and that API method I can consume in end user(I know ao count will increase but can I tell both concepts are following microservice architecture)
Hi @Arkyadeep Bharadwaj ,
This is an article about the subject, that suggests using API, not service actions.
I don't know enough about microservices to know if service actions would also be acceptable, maybe someone else can chime in on that one.
Dorine
If you use a rest API it counts 1 AO per method. If you use service actions it doesn't.
Under the hood service actions generate API calls.
Only ao count and weak dependency are the main difference, otherwise both are following microservice architecture, am I right?
Yes you could say that. But Service Actions have many benefit over REST API, see this abstract from the official documentation:
When making a remote call to a Service Action, OutSystems passes the following information from the client session: UserId, TenantId, Locale, Request Key.
Service Actions mix the advantages of loosely-coupled REST API methods with the Rapid Application Delivery (RAD) capabilities of tightly-coupled Server Actions, for more benefits see:
https://success.outsystems.com/documentation/11/developing_an_application/reuse_and_refactor/use_services_to_expose_functionality/
When working within the same OutSystems environment, are there specific scenarios where choosing to use an API would be more advantageous than making a direct service call ?
No, only disadvantages, especially with the new licensing where unlimited AO's are no longer available. Please read my previous reply on all the benefits of Service actions versus REST API.
Let me add that the Communication Styles are NOT what defines your "microservices" architecture. You could use smoke signals between your services and still have a microservices architecture pattern. Alas, "REST" is bad for microservices designs - but that's another story.
I would focus on using the proper drivers to isolate your domains (Scalability, Domain, Teams, Sponsors, etc) and having loose Applications with well defined bounded contexts and no side effects or dependencies, and not fight the platform - i.e, do use Service actions.
Keep in mind that true REST APIs, you can call from outside the OutSystems platform, while service actions you can only use from within OutSystems applications on the same environment.