[英]Can I use Database web service with generated HTML for internet?
I am planning a web site (Internet facing) and would like to generate the HTML directly from a Database using Database Web Server (with proxy). 我正在计划一个网站(面向Internet),并希望使用数据库Web服务器(带有代理)直接从数据库生成HTML。 For, example, creating a SOAP web-service in an iAnywhere database .
例如, 在iAnywhere数据库中创建SOAP Web服务 。
This is in contrast to the "traditional" route of a PHP/C#/etc. 这与PHP / C#/ etc的“传统”路由相反。 application layer in between the client and the database.
客户端和数据库之间的应用程序层。 Before jumping on my head or lol .... I have read about reducing server load but expect that the database server can handle this, I have read about security isuues yet expect the logging in procedures and rights management in the database to be sufficient, sessions can also be handled etc.
在大步向前或大声笑....之前,我已经阅读了有关减少服务器负载的信息,但是希望数据库服务器能够处理这一点,我已经阅读了有关安全问题的信息,但希望数据库中的登录过程和权限管理足够了,会话也可以处理等。
Can anyone (without listing up the pros and cons of c#, PHP or any other programming language) help me on this decision please? 任何人(不列出C#,PHP或任何其他编程语言的优缺点)可以帮助我做出这个决定吗? I am aware that going the data base web service direction would mean a bit of re-inventing the wheel ...
我知道,向数据库Web服务方向发展将意味着重新发明轮子。
Although in theory there is no technical reason not to do this, I would generally consider it to not be a great idea, for a few different reasons. 尽管从理论上讲,没有技术上的理由不这样做,但出于一些不同的原因,我通常认为这不是一个好主意。
Your database query would be responsible for getting the data from the database and generating the HTML from that database. 你的数据库查询将负责从数据库中获取数据,并生成该数据库的HTML。 This is a possibility if you are just sending back really simple tabular data to the client.
如果您只是将非常简单的表格数据发送回客户端,则这是一种可能性。 However, this would be the worlds ugliest and least functional site.
但是,这将是世界上最丑陋且功能最差的站点。
If you wanted to start including CSS, JavaScript, a navigation menu, or anything like that, then it would be a huge amount of work. 如果您想开始包括CSS,JavaScript,导航菜单或类似的东西,那将是大量的工作。 It would almost certainly prove a maintenance nightmare.
几乎可以肯定,这将是维护方面的噩梦。
If you can expand on why you want to do it this way, and the complexity of your web-pages then I'll expand my answer a bit more. 如果您可以扩展为什么要这样做的原因以及网页的复杂性,那么我将进一步扩展答案。
If you really wanted to do it this way, then you could use shudder iFrames to have a basic site-structure, and load database-generated pages into the iFrame. 如果您确实想通过这种方式进行操作,则可以使用不规则的 iFrame来具有基本的站点结构,并将数据库生成的页面加载到iFrame中。
Alternatively, you could have a more traditional site, but use AJAX techniques (typically in conjunction with jQuery) to get JSON data from the database and display that. 另外,您可能有一个更传统的站点,但是使用AJAX技术(通常与jQuery结合使用)从数据库中获取JSON数据并进行显示。
A sensibly developed web-site (ie one which avoids SQL Injection attacks, etc.) will remove almost any attack-vector against your database (which will not be internet visible). 一个合理开发的网站(即避免SQL注入攻击等的网站)将删除针对您数据库的几乎所有攻击载体(在互联网上不可见)。 Your way, you are relying on the database itself to provide that security.
您的方式就是依靠数据库本身来提供这种安全性。 In principle that's possible, but you would want to spend very good money on a DBA who really knew his stuff to ensure that.
从原则上讲这是可能的,但是您可能想花很多钱去买一个真正了解他的东西的DBA来确保这一点。
There is a whole wealth of resources out there (tutorials, code samples, stack-overflow, etc.) to aid you in implementing the traditional architecture. 那里有大量资源(教程,代码示例,堆栈溢出等)可以帮助您实现传统架构。 You won't get this same support for the direct-database approach.
您将不会对直接数据库方法获得同样的支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.