Which one has lower latency server actions or Rest API?

I'm trying to improve the performance of the core app communication between it's services so I would like to hear about whether latency between core app and server action is faster or not.

Solution

Hi,

Server action will be faster then REST API.

But a more important difference is that the REST API has a different transaction which can have a major impact on your software architecture in terms of unit-of-work (commit/rollback) and exception handling.

Regards,

Daniel

Solution

Daniël Kuhlmann wrote:

Hi,

Server action will be faster then REST API.

But a more important difference is that the REST API has a different transaction which can have a major impact on your software architecture in terms of unit-of-work (commit/rollback) and exception handling.

Regards,

Daniel


Would be great if you can share some sort of benchmark with actual numbers

I don't have any benchmark numbers. I base my reaction on the fact that a server action calling anothe server action runs in the same transaction and is C# code compiled to .DLLs. Calling an REST API requires a http call and thus network latency, that is compared to calling another method in a dll,  slower.

When you add complexity to code, it will run slower. Introducing a REST service if it's not required will slow the execution down as the system is doing more.