douzhaiya3968
2017-02-16 18:12
浏览 92

Laravel的Web服务

Assume that I have a third-party database application with SDK that can be used to retrieve data out of the database in XML.

On the other side, I have developed a website using Laravel framework of PHP. The website is supposed to display data from the database of the application.

In regards to above I have the following questions:

  1. As far as I understand, I can either store the requested data in my website database or just show it without storing. What technique do you suggest?
  2. How do I achieve xml data transfer from the database server to the website? Taking into account that I have experience of development in C#, I assume that I have to develop some web-service that would run on the database server, retrieve the required data and send it to my website. So the web-service has to receive the requests from my Laravel website, retrieve data from database server accordingly and pass the xml response to my website that would finally display it. Am I on the right way? If so, could you please guide me on how to code and bind these parts?

Thank you in advance.

图片转代码服务由CSDN问答提供 功能建议

假设我有一个带有SDK的第三方数据库应用程序,可用于从数据库中检索数据 XML。

另一方面,我使用Laravel PHP框架开发了一个网站。 该网站应该显示来自应用程序数据库的数据。

关于上述问题,我有以下问题:

  1. 据我了解,我可以存储请求的数据 在我的网站数据库中或只是显示它而不存储。 您建议采用什么技术?
  2. 如何实现从数据库服务器到网站的xml数据传输? 考虑到我在C#中有开发经验,我认为我必须开发 一些将在数据库服务器上运行的Web服务,检索所需的数据并将其发送到我的网站。 因此,Web服务必须从我的Laravel网站接收请求,相应地从数据库服务器检索数据并将xml响应传递给我的网站,最终显示它。 我是正确的吗? 如果是这样,你能指导我如何编码和绑定这些部分吗?

    提前谢谢你。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doupang3062 2017-02-17 20:07
    已采纳

    I have to agree with @Serge in the comments - there are many ways to do this because it is a very broad question.

    My answer was mostly going to deal with how regularly the third party database was going to be updated but judging from your comments, I'm assuming it will be fairly often? In which case, I would likely connect directly to the third party database from your laravel app using the firebird driver found here: https://github.com/jacquestvanzuydam/laravel-firebird (Please note, I have never used this so I cannot comment on it's quality) instead of writing a C# web service. I don't know much about firebird itself but you will likely want to connect using an SSH tunnel or VPN for security reasons.

    Then I would either store data in MySQL if you know it isn't likely to change very often (in this case you would use a laravel command, run on a schedule, to pull data out of firebird every [X] days/hours/minutes depending on the data) or, if the data is likely to change on each potential web request, using some form of caching system (redis, memcache, file cache etc) to speed up the web requests.

    Sorry if that isn't particularly helpful - if you can provide more information maybe I can help you out further :)

    Good luck!

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题