아파치 스리프트

위키백과, 우리 모두의 백과사전.

아파치 스리프트
원저자메타 플랫폼스
개발자아파치 소프트웨어 재단
안정화 버전
0.18.1 / 2023년 3월 1일(13개월 전)(2023-03-01)[1]
저장소
종류원격 프로시저 호출 프레임워크
라이선스아파치 라이선스 2.0
웹사이트thrift.apache.org
아파치 스리프트 API 클라이언트/서버 구조

스리프트(Thrift)는 인터페이스 정의 언어이자 이진 통신 프로토콜[2]로서 수많은 언어를 위한 서비스의 정의 및 생성에 사용된다.[3] 원격 프로시저 호출(RPC) 프레임워크를 형성하며 페이스북에서 "스케일링이 가능한 언어 간 서비스 개발"을 위해 개발된 것이다. 크로스 플랫폼 서비스 빌드를 위해소프트웨어 스택을 코드 생명 엔진과 결합하고 있으며 이로써 액션스크립트, C, C++,[4] C#, 카푸치노,[5] 코코아, 델파이, 얼랭, Go, 하스켈, 자바, Node.js, 오브젝티브-C, OCaml, , PHP, 파이썬, 루비, 스몰토크를 포함한 다양한 언어와 프레임워크로 작성된 응용 프로그램들을 연결할 수 있다.[6] 페이스북에서 개발되었으나 현재는 아파치 소프트웨어 재단오픈 소스 프로젝트이다. 이 구현체는 2007년 4월 페이스북이 출시한 기술 논문에 기술되었으며 현재 아파치에서 호스팅되고 있다.[7][8]

스리프트 서비스 생성[편집]

스리프트는 C++로 작성되어 있으나 수많은 언어를 대상으로 코드를 만들 수 있다. 스리프트 서비스를 만들려면 이를 기술하는 스리프트 파일을 작성한 다음 대상 언어로 코드를 생성한 이후 서버 시작을 위한 일부 코드를 작성하고 클라이언트로부터 이 코드를 호출해야 한다. 아래는 이러한 서술 파일의 코드 예시이다:

enum PhoneType {
  HOME,
  WORK,
  MOBILE,
  OTHER
}

struct Phone {
  1: i32 id,
  2: string number,
  3: PhoneType type
}

service PhoneSvc {
  Phone findById(1: i32 id),
  list<Phone> findAll()
}

스리프트는 이러한 서술 정보 외에 코드를 생성한다. 이를테면 자바에서 PhoneTypePhone 클래스 안에 단순한 enum이 된다.

같이 보기[편집]

각주[편집]

  1. “Apache Thrift - Downloads”. 2023년 3월 17일에 확인함. 
  2. “Installing and using Apache Cassandra With Java Part 4 (Thrift Client)”. http://www.sodeso.nl/: Sodeso – Software Development Solutions. 2010년 8월 15일에 원본 문서에서 보존된 문서. 2011년 3월 30일에 확인함. Thrift is a separate Apache project which is a binary communication protocol 
  3. Andrew Prunicki. “Apache Thrift: Introduction”. http://www.ociweb.com/: Object Computing Inc. – An Open Solutions Company. 2011년 7월 23일에 원본 문서에서 보존된 문서. 2011년 4월 11일에 확인함. Through a simple and straightforward Interface Definition Language (IDL), Thrift allows [users] to define and create services which are both consumable by and serviceable by numerous languages. Using code generation, Thrift creates a set of files which can then be used for creating clients and/or servers. In addition to interoperability, Thrift can be very efficient through a unique serialization mechanism that is efficient in both time and space. 
  4. Thrift Requirements, see this issue for Windows support
  5. Fred Potter, Using Thrift with Cappuccino 보관됨 2011-08-12 - 웨이백 머신, parallel48's posterously luscious blog, 10 June 2010.
  6. Andrew Prunicki. “Apache Thrift: Code Generation”. http://www.ociweb.com/: Object Computing Inc. – An Open Solutions Company. 2011년 7월 23일에 원본 문서에서 보존된 문서. 2011년 4월 12일에 확인함. Thrift supports many languages too varying degrees. The complete list is below. Be careful before assuming that just because your language has some support that it supports all of Thrift's features. Python for example, only supports TBinaryProtocol. Cocoa, C++, C#, Erlang, Haskell, Java, OCaml, Perl, PHP, Python, Ruby, and Smalltalk 
  7. Mark Slee, Aditya Agarwal, Marc Kwiatkowski, Thrift: Scalable Cross-Language Services Implementation
  8. “LibraryFeatures - Thrift Wiki”. 2016년 4월 21일에 확인함. 

외부 링크[편집]