Async or not - Recommandations

Hi,

I’m reading the section ServiceStack’s API design

The doc says that Sync endpoints are ignored if an Async endpoint exists, and the main benefit of having the sync version is for backward compatibility. So, do you recommend implementing everything as Async by default for new services?

Thanks

Unless you have other considerations for your own application/situation, creating services as async by default is generally a good approach. OrmLite and Redis have async methods to also make the most of creating/switching async services straight forward.

The main sticking point for me personally was stacktraces and troubleshooting logs, there are some packages to improve this, and hopefully they will continue to be improved in .NET itself. But in general I think they are a good default, and you can always have a mixture if your situation needs it.

1 Like