Silky Microservice FrameworkSilky Microservice Framework
Home
Docs
Config
Source
github
gitee
  • 简体中文
  • English
Home
Docs
Config
Source
github
gitee
  • 简体中文
  • English
  • Introduction

    • Silky Framework Overview
  • Getting Started

    • Glossary
    • Quick Start
    • Project Template
    • Microservice Architecture
    • Sample Projects
  • Host & Module

    • Host Types
    • Gateway Configuration
    • Module System
    • Plugin System
  • Gateway & HTTP

    • Swagger / OpenAPI
    • MiniProfiler
    • CORS
    • Audit Logging
  • Service & RPC

    • App Services & Service Entries
    • RPC Communication
    • WebSocket
    • Service Registry
    • Service Governance
  • Data & Cache

    • EFCore Data Access
    • Caching
    • Distributed Lock
  • Security & Auth

    • Identity & Authentication
    • Distributed Transactions
  • Infrastructure

    • Dependency Injection
    • Object Mapping
    • Validation
    • Link Tracking (SkyAPM)
    • Logging (Serilog)
    • Health Checks
    • Message Bus (MassTransit)
    • Unit & Integration Testing

Core Concepts

Application Service

An application service is a C# interface annotated with [ServiceRoute]. It defines the public contract of a microservice — the methods available to other services and external HTTP clients. In Silky, an application service is analogous to a Controller in MVC.

Naming convention: IXxxxAppService (interface), XxxxAppService (implementation).

Service Entry

A service entry is generated for every method defined on an application service interface. It is analogous to an Action in MVC. Each service entry has:

  • A unique Service Entry ID for RPC routing
  • An optional WebAPI endpoint (HTTP route + verb) for external access
  • Configurable governance parameters (timeout, retry, circuit breaker, etc.)

Service Entry ID

The unique identifier for a service entry, generated as:

FullyQualifiedMethodName + ParameterNames + _ + HttpVerb

Example: Demo.Contracts.IOrderAppService.GetAsync.id_Get

RPC (Remote Procedure Call)

Silky uses DotNetty TCP-based binary RPC for inter-service communication. The interface proxy pattern makes remote calls look identical to local method calls.

Dynamic Proxy

Generated at runtime via Autofac dynamic proxy (Autofac.Extras.DynamicProxy). When you inject a remote service interface, Silky provides a proxy that transparently routes the call to the correct remote instance.

Service Governance

A set of policies applied to service-to-service calls to ensure reliability and performance:

  • Load Balancing: Distributes requests across healthy instances
  • Circuit Breaking: Prevents cascading failures by fast-failing unhealthy routes
  • Retry / Failover: Retries on infrastructure errors
  • Timeout: Caps maximum wait time for a response
  • Rate Limiting: Caps concurrent requests per instance

Registry Center

A service registry (Zookeeper / Nacos / Consul) that stores service metadata and endpoint addresses. Service providers register with the registry at startup; consumers query it to discover available instances.

Service Metadata

Data registered by a service provider in the registry center, including:

  • hostName: Provider host name
  • services: Application service definitions and their service entries
  • endpoints: Network addresses of the running instance
  • timeStamp: Last update time

RPC Context (RpcContext)

A request-scoped dictionary of metadata propagated through the entire call chain (HTTP → Gateway → Service A → Service B → ...). Contains user identity, TraceId, tenant ID, and custom attachments.

TCC (Try-Confirm-Cancel)

A distributed transaction pattern where each participant exposes three methods:

  • Try: Reserve resources without committing
  • Confirm: Commit using the reserved resources
  • Cancel: Release reserved resources on failure

Module (SilkyModule)

The basic unit of framework extensibility. Each module encapsulates a cohesive set of services and configuration. Modules declare their dependencies via [DependsOn], and the framework initializes them in topological order.

Host Types

TypeDescription
GeneralHostRPC-only microservice, no external HTTP
WebHostRPC + external HTTP, typically a business service
WebSocketHostRPC + WebSocket server-push
GatewayHostHTTP gateway — routes external requests to internal services

Fallback

A degraded implementation of a service interface, activated automatically when the normal RPC call fails (circuit open, timeout, etc.).

Cache Interception

An AOP-based mechanism that checks the distributed cache before executing an RPC call. On a cache hit, data is returned directly without network IO.

Edit this page
Next
Quick Start