如何使用 Delphi 做一个 REST Web 服务器作为大型 Web 应用程序的后端?
我读了这个问题,但对答案不满意。
我还快速阅读了(按照该问题中的建议)Marco Cantù 2010年手册的最后一章,我从中引用了以下内容(我想我可以引用这么短的文字):
我[Marco Cantù]确实有很多 对服务器端 Web 和 REST 的投资 用 Delphi 编写的应用程序,以及 这几年我开始玩 与并在会议上介绍a Delphi Web 应用程序 REST Framework119(即 DWARF),其中 目前还没有公开 可用...只是因为它太 粗略且未完成的 发表。我见过其他正在进行的 在 Delphi 中克隆 Rails 的努力以及 提供其他 REST 服务器架构。 我认为如果你想建立一个 非常大的 REST 应用程序 你应该推出你的架构 自己的技术或使用其中之一 原型架构。
考虑到我拥有 Delphi XE Professional 而 DataSnap 不在那里,并且我想考虑根据上面的评论编写大型应用程序,似乎 DataSnap 不是一个选择。
有没有商业解决方案?我不想考虑“我自己的 REST 实现”,我想创建一个使用我选择的 DAC(在本例中为 Devart)的一些数据模块的网络服务器。
最后说明:我的目标是为大型 Web 应用程序编写后端,在客户端上我想使用 Ext JS 4.0,但我想在 javascript 中完成所有客户端工作,以充分利用 EXT JS,所以基本上我需要一个网络服务器只是为了数据和跟踪状态,而不是为了提供网页。
I read this question but was somehow not satisfied with the answers.
I also quickly read (as suggested in that question) the last chapter of Marco Cantù 2010 Handbook, from which I quote the following (I think I can quote such a short text):
I [Marco Cantù] do have a lot of
investment in server side web and REST
applications written in Delphi, and in
the recent years I've started playing
with and introducing at conferences a
Delphi Web Application REST
Framework119 (that is, DWARF), which
at this time is still not publicly
available... simply because it is too
sketchy and unfinished to be
published. I've seen other ongoing
efforts to clone Rails in Delphi and
offer other REST server architectures.
I think that if you want to build a
very large REST application
architecture you should roll out your
own technology or use one of these
prototypical architectures.
Considering that I own Delphi XE Professional and DataSnap is not in there and I would like to consider to write large applications too according to the above comments it seems DataSnap is not an option.
Is there even a commercial solution for this? I don't want to consider "my own implementation of REST", I would like to create a webserver that uses some of my datamodules where I use the DAC I choose (Devart in this case).
Final note: my goal is to write the backend for a large web application, on the client I would like to use Ext JS 4.0, but I want to do all the client work in javascript, to take full advantage of EXT JS, so basically I need a webserver just for the data and tracking the state, not for serving webpages.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
要创建您的 REST 服务,请尝试我们的开源 mORMot 项目。现在它是一个众所周知且稳定的项目,在世界各地的生产中使用。
您可以通过实现自定义
TSQLRestServerStatic
类(类似于TSQLRestServerStaticInMemory
类,但调用您的 DAC)来将任何 DAC 与框架的当前状态结合使用:因此您将受益适用于 ORM 和 JSON RESTful 架构,以及高速 http.sys 内核模式服务器。SQLite3 引擎对于我们的框架来说并不是强制性的,即使它的设计目的是为了更好地配合它。
To create your REST services, try our Open Source mORMot project. Now it is a well known and stabilized project, used world wide in production.
You can use any DAC with the current state of the framework by implementing a custom
TSQLRestServerStatic
class (similar to theTSQLRestServerStaticInMemory
class, but calling your DAC): so you'll benefit for the ORM and the JSON RESTful architecture, together with the high-speed http.sys kernel-mode server.The SQLite3 engine is NOT mandatory with our framework, even if it was designed to work better with it.
如果您要从头开始一个应用程序,如果 Delphi 是您唯一的选择,我认为 mORMot 是一个不错的选择。如果您选择 datasnap,您将不得不忍受性能和稳定性问题。
我在博客上写了一篇文章,讨论大型应用程序中 DataSnap(和 mORMot)的性能和稳定性,您可以在以下链接中查看它:
基于速度和稳定性的DataSnap分析稳定性测试
If you will start an application from scratch, I think the mORMot is a good option if Delphi is your only option. If you choose datasnap you'll have to live with the problems of performance and stability.
I wrote an article on my blog talking about performance and stability with DataSnap (and mORMot) in large applications, you can see it on the following link:
DataSnap analysis based on Speed & Stability tests
我认为你应该看看 kbmMW,有一种方法可以基于事件驱动的 HTTP 服务器来实现基本的 REST 服务器。
检查
news.components4developers.com
新闻组,那里有很多文档。I think you should have a look at kbmMW, there is a way to implement a basic REST server based on an event driven HTTP server.
Check
news.components4developers.com
news groups, there you will have a lot of documentation.FireHttp是一个基于Delphi/Object Pascal语言的高性能Web服务器。它支持 HTTP 1.1、HTTPS (SSL/TLS)、WebSocket、GZip、Deflate、IOCP、EPOLL。采用多进程+多线程模型,具有良好的稳定性和并发性能,并提供SDK源码。开发者可以使用SDK快速构建高性能的跨平台Web应用程序。
FireHttp is a high-performance Web server based on Delphi/Object Pascal language. It supports HTTP 1.1, HTTPS (SSL/TLS), WebSocket, GZip, Deflate, IOCP, EPOLL. It adopts multi-process+multi-threading model, has good stability and concurrency performance, and provides SDK source code. Developers can use SDK to quickly build high-performance cross-platform Web applications.