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...

Michael Irigoyen
  • 22,513
  • 17
  • 89
  • 131
Mazzy
  • 327
  • 2
  • 10
  • Performance? `SOAP` will make a `HTTP` request.. – AlexP May 21 '13 at 00:37
  • I'm aware that both SOAP and REST are built upon HTTP, my question is that fact going to make them to slow to use for things like looking up a quote for a customer, pulling some sort of order data, etc. – Mazzy May 21 '13 at 00:39
  • duplicate: http://stackoverflow.com/questions/4163066/rest-vs-soap-has-rest-a-better-performance – AlexP May 21 '13 at 00:42
  • No its not, I am not comparing rest to soap I am lumping them together and asking if they are fast enough to use for the purpose I outlined. – Mazzy May 21 '13 at 00:47

1 Answers1

1

Performance of the protocol is likely minor issue, if the web services lives in different machines then latency between the machines are going to become the major performance bottleneck, whatever protocol you're using.

It is best if you can provision the servers to be in the same network. As always when querying remote services, it's best to reduce the number of queries, instead you should design your API to do queries in bulk whenever possible.

The only possible issue with REST or SOAP is that they do not have a straight forward way to do push notification, instead you'll need to use web hooks. But that's really a minor issue.

Lie Ryan
  • 62,238
  • 13
  • 100
  • 144