0
votes

Our company decided to move to Symfony2 and now we are trying to re-write our application. I'm still new to Symfony2 and trying to figure out what is the best way to build the app.

our app consists of 2 part each part is on a different server:

  • A contains all the logic required to get/store/update records in database
  • B users requests go to, process the request and send another request to A for any database interaction

I'm planning to use Doctrine in A so i created all the required Entities, but i feel i need to share A entities with B since it's easier to create/validate forms using entities.

  • Am I going into the right direction or I don't have to share the entities?
  • If I share the entities and B doesn't have any database connection, will that create any problem for me?
  • If I'm going to do this approach (separate logic and database calls into 2 separate bundles each one on a different server) is there any consequences? where should i build Services ? on A or B or also i would have to share Services too?

Thanks

1

1 Answers

0
votes

I did not have the exact problem you described, but I wanted to share/extend some entities between applications in single project. However, I was recommended by good folks on SO to branch entire project.

I suppose you will be using Git so you'll have two branches: A and B. Both will have common files (entities in you case), but will certainly contain different controllers/services as necessary.

Now, since you've mentioned two servers, not only you will have separated code but you will be able to set different deployment scripts both for A and B.

The downside: I believe that some intermediate knowledge of git branching will be necessary.

Is that acceptable for you?