Cross language를 쉽게 지원하는 Thrift

thrift는 facebook에서 개발하여 현재는 apache의 인큐베이션 프로젝트로 등록된 프로젝입니다.
thrift는 corba, SOAP 등과 같이 다양한 프로그램 언어를 지원하는 도구로 IDL 기반으로 하고 있습니다. 자체 내에 안정적인 데몬 모듈까지 제공하고 있어 IDL 작성 후 생성된 코드를 이용하여 기존 서비스를 간단하게 다양한 언어를 지원하도록 할 수 있습니다.
다음 그림은 neptune을 적용한 예입니다.

사용자 삽입 이미지


thrift 사용은 다음과 같이 합니다.
1. thrift 설치
   Download: http://incubator.apache.org/thrift/
2. thrift idl file 작성
   neptune.thrift
3. Code 생성
   명령: thrift -cpp ?java ?php ?py neptune.thrift
4. 서버 모듈 작성
   Java or cpp or php
5. 클라이언트 코드 작성
   다양한 언어의 클라이언트 코드 작성 가능

neptune.thrift 예

namespace cpp neptune

namespace java com.nhncorp.neptune.thrift.generated

struct ThriftColumnInfo {

  1: string columnName,

  2: string numOfVersion,

  3: string columnType,

}

struct ThriftTableSchema {

  1: string tableName,

  2: string description,

  3: list<ThriftColumnInfo> columns,

}

service ThriftNeptuneService

{

  list<ThriftTableSchema> listTables() throws (1:ThriftIOException tioe),

  void put(1:string tableName, 2:ThriftRow row,

          3:bool useSystemTimestamp) throws (1:ThriftIOException tioe),

  void removeRow(1:string tableName, 2:string rowKey) throws (1:ThriftIOException tioe),

  binary getValue(1:string tableName, 2:string rowKey,

             3:string columnName, 4:string cellKey) throws (1:ThriftIOException tioe),

  void createTable(1:ThriftTableSchema tableSchema) throws (1:ThriftIOException tioe),

  bool existsTable(1:string tableName) throws (1:ThriftIOException tioe),

  void dropTable(1:string tableName) throws (1:ThriftIOException tioe),

  ThriftTableSchema descTable(1:string tableName) throws (1:ThriftIOException tioe),

}


크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 김형준


Trackback URL : http://www.jaso.co.kr/trackback/345

Comments List

  1. typos 2009/04/27 12:25 # M/D Reply Permalink

    아직까지는 안정된 모듈은 아닌것 같은데요

    1. 김형준 2009/04/27 13:34 # M/D Permalink

      아직 검증은 해봊 않았지만 facebook이나 다른 오픈소스 쪽에서도 많이 사용하니까 어느 정도 검증은 되었겠죠. 그리고 neptune의 다른 언어 지원을 위해서 이것만한게 없더라구요.. ㅋㅋㅋ

  2. 준비태세 2009/04/29 10:55 # M/D Reply Permalink

    삼성SDS와 클라우데라는 28일 양해각서(MOU)를 맺고 대용량 데이터 처리 분석 기술인 하둡(Hadoop) 관련 공동기술개발을 통해 기업들이 필요로 하는 다양한 클라우드 컴퓨팅 환경을 제공하기로 했다.

    지대로 맞짱 한번 뜨시겠군요...^^

    1. 김형준 2009/04/29 11:02 # M/D Permalink

      맞짱은요... 어디 감히 대기업을 상대로 맞짱뜨겠어요. ㅋㅋㅋ 일단 대기업이 나섰으니까 어느 정도 시장은 형성된다는데 기대를 걸어야죠

Leave a comment
« Previous : 1 : ... 94 : 95 : 96 : 97 : 98 : 99 : 100 : 101 : 102 : ... 388 : Next »