Difference between Thrift, JSON, and REST
Can somebody please tell me difference between JSON, Thrift and REST ? How one can开发者_如何学Go decide which one to use ? Which one is the fastest one ?
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.
精彩评论