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.

  • 写回答

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!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 我这模型写的不对吗?为什么lingo解出来的下面影子价格这一溜少一个变量
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波