24

Can somebody please tell me difference between JSON, Thrift and REST ? How one can decide which one to use ? Which one is the fastest one ?

1
  • 1
    They actually are all very different things. Maybe you tell us what you wanna do?
    – Niko
    Commented Sep 19, 2011 at 7:40

1 Answer 1

66

JSON is only data format, you can apply it in various situations, from storing data in NoSQL databases, to encoding of parameters in REST call

REST Is way of organizing client-server interaction. Central to the REST is resource, identified by its ID. REST server provides operations upon that resource, like deleting, updating, etc. REST calls are typically stateless, in another words, the server does not keep any client state, but it gets all information necessary for the operation from the call itself. REST is typically provided on top of HTTP, and URI- is used to encode resource id, operation and parameters. In addition parameters are often encoded with JSON. REST servers are usually built on top of HTTP servers, and clients use some HTTP client technology like curl.

Thrift is lightweight binary remote procedure call protocol. In interface definition langugage you define operations, and structure of parameters they take. Thrift compiler generates stubs for client and the server, and code to marshal calls into the binary format. That calls are then transfered over the wire according to one of the Thrift transports. Thrift clients and servers can be implemented in number of languages and technologies.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.