使用 Web 服务将遗留应用程序连接到数据库
我想开发一个系统,其中所有网络通信都通过网络服务进行。我的问题是我使用了一些遗留应用程序。
这些应用程序需要连接到数据库。我的问题是我不想让他们使用与数据库的本机二进制连接。
我正在寻找解决方案。
类似于虚拟数据库,它是一个代理进程,它接受连接,然后将这些连接传输到 Web 服务并连接到数据库。
我不想更改任何代码,最好的情况只是连接字符串。
目前我正在使用 Linux 并考虑使用 PostgreSQL 数据库,但任何解决方案都将受到赞赏。
I want to develop a system in which all network communications are via web services. My problem is I used some legacy applications.
These applications need to connect to a database. My problem is I don't want to let them to use native, binary connection to database.
I was looking for a solution.
Something like a virtual database that is a proxy process which accept connections, then transfer these connections to Web Service and connect to database.
I want to not change any code, in the best case just connection string.
Currently I'm using Linux and thinking about using PostgreSQL Database but any solution will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设所有遗留应用程序都可以配置为使用不同的数据库连接(连接字符串、主机名等),那么您需要一个代理数据库服务器。
仅当遗留应用程序和数据库之间的协议有详细记录时,这才有效。
此外,该服务将 100% 特定于所使用的数据库。所有 Web 服务操作都需要与数据库协议上的数据库操作处于同一级别。这不会是很高水平。
这是太多的努力,将完全由你支持,并且不值得。
Assuming that all the legacy applications can either be configured to use a different database connection (connection string, host name, whatever), then you need a proxy database server.
This will only work if the protocol between the legacy applications and the database is well-documented.
Also, this service will be 100% specific to the database being used. All of your web service operations will need to be at the same level as the database operations on the database protocol. This will not be very high-level.
This is far too much effort, will be supported entirely by you, and will not be worth it.
您正在描述面向服务的架构 (SOA)。在 SOA 环境中,所有这些组件都通过服务提供者松散耦合。您可以让遗留应用程序、业务规则引擎和后端数据库都通过定义的服务进行通信。
You are describing one of the use cases that went into the design of Service-oriented architecture (SOA). In a SOA environment all these components are loosely coupled via service providers. You can have legacy applications, business rule engines, and back end databases all communicating via defined services.