Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application architecture MySQL / PHP / Java / AngularJS

Intro: We are redesigning our application architecture and we are about to make import design decisions.

Background and dependencies: All data is stored in distributed MySQL databases. We have two systems that access the databases - one that performs routinely tasks, programmed in Java and our web application - currently Apache2, PHP (Zend1 framework) and JavaScript (jQuery).
The Java app will not be redesigned and the database should remain MySQL.
The web application is supposed to be changed to a REST API and a modern, fast, real-time AngularJS frontend that communicate over JSON.
Since we already programmed all backend functionality in PHP, it would probably make sense to stick with PHP for the REST API - but this is not a must if it makes future development easier, faster and future-proof.
The Java app and the web application share some MySQL queries.

Questions:

  1. Shared MySQL queries: Should we implement them as a) MySQL procedures / views, b) separately in Java and PHP, c) independent service (e.g. another REST API)
  2. Should we stick with Zend1 or rather use a more suited PHP REST framework (such as Slim or Restler or something else)?
  3. Should we stick with Apache2/PHP for the REST API at all (maybe use Node.js instead)?

Thanks!

like image 690
Horen Avatar asked Mar 18 '23 21:03

Horen


1 Answers

This post is probably designed to start a flame war... but...

Never rewrite code from scratch. Take what you have, and refactor it to create modern restful services on top of it.

Do it as a slow migration, rewriting one page at a time in a like-for-like manner.

You will have far fewer bugs, it will cost less, and totally avoid second-system syndrome

like image 169
Rob Conklin Avatar answered Apr 01 '23 00:04

Rob Conklin