Skip to content

DRAFT: Stream API vs Typed responses

j82w edited this page Sep 27, 2019 · 3 revisions

Stream API vs Typed responses

TLDR: Stream APIs for performance. Typed APIs for simple and clean .NET development experience.

Stream APIs

  1. Does not throw service exceptions. Instead returns it as part of the response. This avoids the c# overhead of throwing and catching the exceptions. This helps improve the performance. Argument exceptions are still thrown such as passing a null on a required parameter.
  2. Stream APIs do not serialize the responses. This allows middle tiered applications to avoid the overhead of deserializing and then re-serializing the response.

Typed APIs

  1. Converts the stream to a c# object which makes it easy to program against.
  2. Follows the .NET guideline and throws exceptions
  3. No need to dispose or wrap responses in using statements. All of the disposed types are handled by the SDK.