3

I'm building a Web app in codeigniter. Instead of the http server speaking to MySQL via php, and what if I built 2 applications, the first one would talk directly to MySQL, and serve as an api server. Perhaps using xml rpc or rest..

The second app, which would serve the front end, the http stuff, and but speak directly to the api server, instead of speaking to MySQL

What are the pros and cons of using this approach. Everything will run on the same network internally but only the http / front end servers are accessible to the Web via a load balancer.

2 Answers 2

3

PROs:

  • You wont have to change the second app if you make changes in calls to the db.
  • You could possibly serve more requests by replicating the front end, also taking different types of incoming requests
  • You can reuse the data access app in other places

CONs: might be overkill depending on your needs

1
  • 2
    It might be important to note that the con described here is fairly heavy. And API takes a lot of time to implement correctly and make extendable, and don't underestimate making the requirements clear so you can actually re-use it possible for other front-end apps.
    – sg3s
    Jun 16, 2012 at 19:00
2

Pros

  • It would make your application more modular allowing for changes to be made down the road with out breaking other parts of the application
  • It would make testing easier as you could test the two parts Independently of each other

Cons

  • Could be overly complex leading to maintenance problems
  • There is always overhead introduced due to abstraction so slower proformence would result

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.