0

Goal: Separate business logic and processes from ecommerce shopping cart. Just so we're clear, we are a larger ecommerce shop but by no means are we dealing with mega amounts of traffic here, just a few thousand visitors a day.

We want a maintainable outside application to handle things such as: PDF generation, quoting logic, invoice and purchase order processing, etc. Currently this is built mostly into our modular shopping cart software but to achieve more mobility, stability, and maintainability, we think this is the best direction. We currently use, LAMP for shopping cart, MongoDB, Python, for some outside data importing and processing. We want to use PHP for this particular application, the development will be more rapid as much of our business logic is already written in PHP and will just need to be ported.

I'm sure this is not a new problem. So how do most larger sites do it? Is it best to use something like SOAP/REST to communicate between applications or is this too slow, is it necessary to just build PHP libraries that are used directly by the ecommerce shopping cart.

If I had my choice, I'd do a webservice but I am afraid the overhead will be to great for it to make sense. I know from experience UPS APIs are no fun to work with! I'm leaning towards a combination of REST and DAO, I'd love to hear from anyone who's been through this or seen something like this before. Could also throw in we could use a messaging queue which is great for processes that take a lot of time but not for things that need an instant response...

4

1 回答 1

1

协议的性能可能是次要问题,如果 Web 服务存在于不同的机器中,那么机器之间的延迟将成为主要的性能瓶颈,无论您使用什么协议。

最好将服务器配置为位于同一网络中。与查询远程服务一样,最好减少查询次数,相反,您应该将 API 设计为尽可能批量执行查询。

REST 或 SOAP 唯一可能的问题是它们没有直接的方式来进行推送通知,相反,您需要使用 Web 挂钩。但这确实是一个小问题。

于 2013-05-21T01:01:05.330 回答