Jutsu – Protocols and programming patterns
Protocol, techniques and programming patterns are called Jutsu in Sugoi. They are generally agnostic and re-usable across different transport protocols or integrated services. All Jutsu implementations are design to completely de-couple business concerns from actual API interfaces similar to other big enterprise frameworks.
Distributed tracing is supported out of the box through the use of Span
natively in the framework. All tracing information will be initialised with sane defaults out of the box. Each HTTP SpanHttp
request will receive a new standardized traceparent automatically, each WebSocket SpanWebSocket
connection will be attached to a trace on connect, etc.
These simple spans contain basic context information, such as who's making the request (auth user), where it came from (original protocol), a unique trace ID and arbitrary manually defined metadata. These spans are encapsulated, so they can be passed around in async contexts if required without losing the original origin metadata data or trace. They are also used for direct logging, so there's no need for a logging facade, call-traces are automatically calculated.
The protocol layer will also handle all transformation, validation and (de)serialisation of request/response data before handlers are invoked. This means your DTOs are ready for consumption before ever hitting your controllers and can immediately be used in the business context.
Current:
- Core – Shared traits, utilities, and cross-cutting concerns
- Events – Application-level event handling and dispatch
- Http – Pages, APIs, and web interactions
- Messaging – Kafka, WebSocket, and message-driven interactions
Roadmap:
- Functions – Lambda-style executions and RPC endpoints
- Streaming – Continuous dataflows (e.g., Kafka Streams, Flink-style)
Considered:
- Graph – GraphQL-style query interfaces
- Integration – Enterprise integration patterns (e.g., service bus, EIP)
Why group them?
All Jutsu types are:
- Externally visible: They interact with clients, users, or other systems
- Declarative: You define what happens, and Sugoi handles the orchestration
- Composable: You can use Core logic, DTOs, and context spans inside any Jutsu