ServiceStack vs NServiceBus

I just started learning ServiceStack and WOW, I could also throw WCF out of the window, but it can post messages using Redis as well.

I am familiar with NServiceBus and it is also used to send messages and have pub / subs. Since ServiceStack is a web service, you can expose it to external clients; I don't think NServiceBus can do this.

Also, what are the pros and cons of choosing one of these technologies over the other? What are some scenarios where one of the technologies might be preferred.

+4


source to share


2 answers


Having no idea how ServiceStack does Pub / sub with Redis beyond what is in the documentation , it seems like it just provides a pretty thin wrapper for the Redis pub / sub API.

NServiceBus (of which I am the author) has a deeper architectural philosophy with respect to pub / sub, including requiring the correct message contracts to be declared, clearly delineating commands from events, not allowing commands to be published, stricter deployment topology guidelines where each logical endpoint scales when scaling with physical hosts and much more.

If I had to summarize, it turns out that pub / sub in ServiceStack is more of a library, and NServiceBus is more of a framework. Once you enable the rest of the tools @ sean-farmer mentioned in his comment, the difference becomes even greater. Of course, this is my biased opinion based on minimal understanding of what's available in ServiceStack, and I'd love to hear comments from its author.



I would also suggest looking at fooobar.com/questions/84032 / ... answer about NServiceBus vs MassTransit .

One last comment: NServiceBus supports multiple transports like RabbitMQ, Azure Service Bus and even SQL tables - not just MSMQ. It looks like there is some community level action for Redis transport for NServiceBus: https://github.com/mackie1001/NServicebus.Redis

+6


source


I think it will be difficult for you to compare and contrast 2 quite different technology stacks with different goals / focuses. Never using NServiceBus, I will not be able to comment on its features / strengths - I suggest you evaluate how to determine which one is the most suitable for your use case and which one you like to develop with more - given that they have mostly different features , kits, another consideration would be to use both, for free together.

ServiceStack Core objectives and functions

As the lead project for the ServiceStack, I can only talk to the core tasks / tasks of the ServiceStack, which aim to simplify development and maximize end-to-end performance with a focus on reducing artificial complexity :

Reduce artificial complexity and increase utility

One way to reduce cognitive load is to promote a uniform flexible and flexible approach to Service development, promoting best practices for remote services with a message-based design , simply by building your Services around accepting and returning pure POCO data transfer objects (DTOs) (but can also return any custom media type or binary / image responses ).

By using well-defined POCOs to define your service contracts, ServiceStack is able to display more information about your Services and automatically provide a range of metadata features, including built-in Metadata Pages with links to XSD, WSDL and Plugins such as Postman and Swagger UI Support. ServiceStack can also enable RDBMS- enabled services using AutoQuery only from a query DTO definition, which is a stack API that can provide all of its search functionality using a single DTO query.

Ultimate performance



Having a clean DTO separation from your Service implementations is what allows you to share your DTO server with the client for an instant end-to-end typed API without a code-gen . Alternatively, if desired, clients can, using just a URL, Add a Remote ServiceStack Reference to create typed DTOs for C # , F # , VB.NET, and TypeScript clients.

Maximize reuse

ServiceStack is capable of maximizing the reuse and usefulness of your Services, where ServiceStack services can be consumed via an array of built-in fast data formats (including JSON , XML, CSV , JSV , ProtoBuf, and MsgPack ) as well as SOAP and MQ Hosts endpoints .

Those same services also serve as a controller in ServiceStack Smart Razor Views reducing effort, web and single page apps , and Rich desktop and mobile clients .

Messaging features

For messaging functions, ServiceStack provides a pure Messaging API where your services can be consumed through Rabbit MQ , Redis MQ, and in-memory MQ hosts. Although, since the Messaging API reuses your existing services, it follows the same Request / Reply MQ pattern.

Separated from the Messaging API, ServiceStack provides the Redis Pub / Sub Server library , which is the Redis Server Events and Redis MQ credentials.The Pub / Sub Functions also extend to the ServiceStack Server Services , which provide real-time Ajax / JavaScript and .NET ServerEvents Clients make it easy to build rich, live Web applications like React Chat and jQuery Chat (less than 200 lines of JS).

+6


source







All Articles