Home > Back-end > Why use a RESTful, write a core functions and HTTP and TCP each call is bad?
Why use a RESTful, write a core functions and HTTP and TCP each call is bad?
Time:09-30
Find it difficult to design good RESTful or, especially there are many complex business systems,
Why a RESTful and fire? The benefits are all sorts of client are using the same interface and the agreement?
I'm thinking, our business is unified function, such as ServerCore1 ServerCore2... HTTP requests, and then returns a JSON values, call this function inside ServerCoreX to return JSON value is returned to the front end, TCP client's request, also in TCP request to accept the processing function call ServerCoreX returned to the client JSON, but HTTP and TCP request parameters are JSON,
Can not be like this? Requests are JSON data format and return are unified,
Only when the request WEB and C/S of different channels, which also most flexible unification, is that ok?
But the disadvantages of this solution is that I still need to maintain acceptance and management of TCP connections, and RESTful is whatever the client connection is unified by the nginx these agents to maintain, this is the advantage of it, I understand that right?
CodePudding user response:
TCP is a long connection, management up more troublesome. Restful low coupling, stateless
CodePudding user response:
Before and after the separation, easy to expand, debugging, maintenance, as the upstairs said, restful stateless, low coupling, front and back side can develop at the same time, more efficient, of course it takes some time to design early