后端的基于休息的服务 [英] Rest based services in back-end

查看:58
本文介绍了后端的基于休息的服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们建立了一个3000万以上用户的在线社区,该社区的后端有一个RESTful服务,而前端则利用它们.我的担心是:与Java的二进制序列化协议(取决于语言)相比,将REST用作内部数据传输协议是否可以,还是会大大降低性能?还有哪些其他方法/协议可以使它保持语言独立性并最大程度地提高速度?

we build a 30M+ users' online community, which has RESTful services in it's back-end and a front-end which utilizes them. My concern is: Is it OK to use REST as internal data transfer protocol, or it will significantly drop the performance, compared with Java's binary serialization protocol (language dependent)? What other approaches/protocols can be used to keep it language independent and maximally fast?

推荐答案

REST方法可能还不错,但是http层会使速度变慢.如果您在后端使用REST,则应确保后端和前端之间的连接保持打开状态,并且不要在每次请求时都重新打开它.

The REST approach can be quite ok, but the http layer can slow things down. If your use REST in the back-end, your should make sure that the connection between your back-end and front-end is kept open and not reopened with every request.

有关http保持活动的更多详细信息,请参见: http://en.wikipedia.org/wiki/HTTP_persistent_connection

More details about http keep-alive can be found here: http://en.wikipedia.org/wiki/HTTP_persistent_connection

这篇关于后端的基于休息的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆