moleculer-api
English
English
  • moleculer-api
  • Quick Start
    • Get Started
    • Configurations
    • Quick Examples
      • REST
        • REST Endpoints
        • REST File Upload with streaming
      • GraphQL
        • GraphQL Resolver with DataLoader
        • GraphQL type extension and reference
      • WebSocket
        • WebSocket Video Broadcasting
        • WebSocket Video Server/Client
        • WebSocket Chat Server/Client
      • Authentication
        • Parse OIDC/OAuth2 context
      • Authorization
        • Access Control with Auth token scopes
        • Access Control with Auth token claims
        • Access Control with IP address
  • API Gateway
    • Overview
    • Service Broker
      • Connenctor
      • Delegator
    • Schema Registry
      • Branch, Version, Integration
      • Protocol Plugin
      • Policy Plugin
      • API Handler
      • API Document Generation
      • Health Check
    • API Server
      • Application
        • Component
          • HTTP
          • WebSocket
        • Context Factory
          • Auth
          • Cookie
          • Correlation ID
          • IP Address
          • Locale
          • Request
          • User-Agent
      • Middleware
        • Error
        • Logging
        • Body Parser
        • Helmet
        • CORS
        • Serve Static
      • HTTP
      • HTTPS
  • Service API Schema
    • Overview
    • Branch
    • Protocol Plugin
      • REST
      • GraphQL
      • WebSocket
    • Policy Plugin
      • Scope
      • Filter
  • Development
    • Overview
    • Service Broker Delegator
      • Manipulating HTTP Response
      • Streaming Request/Response
      • Bidirectional Streaming
    • Schema Registry
      • Protocol Plugin
      • Policy Plugin
    • API Server
      • Application Component
      • Application Context Factory
      • Middleware
  • Miscellaneous
    • Project Roadmap
    • CHANGELOG
    • FAQ
    • Contributors
    • Supporters
  • Github
  • moleculer-iam
Powered by GitBook
On this page
  • API Schema and Handler
  • 1. Design Principle
  • 2. API Schema

Was this helpful?

Export as PDF
  1. Service API Schema

Overview

API Schema and Handler

1. Design Principle

Moleculer API Gateway는 아래 원칙을 기반으로 고안되었습니다.

  • 분산 시스템안에서 유동적으로 작동합니다.

    • Persistence Layer를 갖지 않습니다.

  • "분산 서비스 -> API" 종속성을 최소화합니다.

    • 서비스 API 스키마는 JSON 텍스트입니다.

    • 분산 서비스 호출시 인증 등의 컨텍스트를 파라미터로 맵핑하도록 유도합니다.

  • 확장 가능한 컴포넌트 패턴을 지향합니다.

    • 프로토콜 플러그인은 서버, 미들웨어, 스키마, 핸들러의 모든 부분을 확장합니다.

    • 접근 제어 정책은 프로토콜별 엔드포인트가 아닌 액션, 이벤트에 적용됩니다.

  • 네트워킹 및 복원 패턴에 관여하지 않습니다.

    • 분산 서비스와 API Gateway는 어댑터(Broker)로 연결됩니다.

    • 분산 트랜잭션을 유도하거나 관여하지 않습니다.

아울러 분산 서비스 및 서비스 브로커에서 기대되는 패턴은 다음과 같습니다.

  • 분산 서비스의 프로시저는 무상태를 지향합니다.

    • 프로시저는 인증 컨텍스트를 고려하지 않습니다.

    • 프로시저는 접근 제어를 고려하지 않습니다.

    • 프로시저는 가능한 멱등성을 갖도록 고려됩니다.

  • 서비스 브로커는 분산 시스템을 위한 복원 패턴을 구성합니다.

    • 회로차단기

    • 격벽

    • 재시도

    • 요청 큐

2. API Schema

이하에서 서비스 API 스키마는 분산 환경의 부분적인 API 스키마를 의미합니다. Gateway API 스키마는 Gateway에서 통합된 API 스키마를 의미합니다.

서비스 API 스키마는 JSON 텍스트로 Gateway에 전달됩니다. 스키마 데이터의 직렬화 및 비직렬화는 MSA 라이브러리에 달렸습니다. 아래 예시에서는 Node.js 환경을 기준으로 서비스 API 스키마를 JavaScript 객체로 표기합니다.

PreviousHTTPSNextBranch

Last updated 4 years ago

Was this helpful?