PHP with Apache is enough to serve a proper RESTful interface. Being able to divide all your operations into proper resources and verbs is what REST needs. As REST is a way of designing an interface and now about the actual implementation, there are multiple ways of implementing it in PHP/Apache itself. I have used the Zend Framework for big APIs. For something super simple, a .htaccess with a PHP file should be good. :)
That said, I believe Node.js would give your API a nice performance advantage just after installing it. The actual numbers would depend upon how your backend works.
IMO, if you already have a lot of code in PHP and are not facing any performance issues, you can stick to the PHP+Apache combo than try out node.js.
发布评论
评论(3)
PHP 与 Apache 足以提供适当的 RESTful 接口。 REST 所需要的就是能够将所有操作划分为适当的资源和动词。由于 REST 是一种设计接口的方法,现在是实际的实现,因此在 PHP/Apache 本身中有多种实现它的方法。我已经将 Zend Framework 用于大型 API。对于超级简单的事情,带有 PHP 文件的 .htaccess 应该很好。 :)
也就是说,我相信 Node.js 在安装后会给你的 API 带来很好的性能优势。实际数字取决于您的后端的工作方式。
IMO,如果您已经有大量 PHP 代码并且没有遇到任何性能问题,那么您可以坚持使用 PHP+Apache 组合,而不是尝试 Node.js。
PHP with Apache is enough to serve a proper RESTful interface. Being able to divide all your operations into proper resources and verbs is what REST needs. As REST is a way of designing an interface and now about the actual implementation, there are multiple ways of implementing it in PHP/Apache itself. I have used the Zend Framework for big APIs. For something super simple, a .htaccess with a PHP file should be good. :)
That said, I believe Node.js would give your API a nice performance advantage just after installing it. The actual numbers would depend upon how your backend works.
IMO, if you already have a lot of code in PHP and are not facing any performance issues, you can stick to the PHP+Apache combo than try out node.js.
你可以尝试一下Zend框架。它将简化您的 RESTful API 开发。
You can try Zend framework. It will simplify your RESTful API development.
通过 Apache 代理 Node.js 错过了 Node.js 的很多要点(每个连接没有线程)
通过 Node.js 代理 Apache 将 Node.js 放在前面,虽然没有已知的安全缺陷,但 Node.js 根本就不是没有那么身经百战。
输入 nginx。您可以通过 ngnix 代理两者,也可以用 nginx 替换 Apache。
除了需要代理之外,我没有看到任何麻烦。
Proxying Node.js through Apache misses a lot of the point of Node.js (no thread per connection)
Proxying Apache through Node.js puts Node.js on the front, and while there are no known security flaws, Node.js simply isn't as battle hardened.
Enter nginx. You can either proxy both through ngnix or replace Apache with nginx.
Other than the need for a proxy I don't see any trouble in the wings.