0

I have a project consisting of a webapplication, a database and a program running in the background which processes rows created by the webapp. Both the programs work with the database and store their needed info (with tables both applications use).

To make the situation a bit clearer lets say I have a database (used by my applications exclusive) containing three Tables A, B and C.

  • A is only used by my webapp.
  • C is only used by the other program.
  • B contains columns that only the webapp needs als well as columns that the other program uses and of course columns used by both.

You can think of the whole project this way:

  1. User places an order throu the webapp
  2. The webapp stores the order in the database
  3. The other program accesses the database and processes the order
  4. If errors occured during the processing these are stored in the database as well

That raises the following questions:

  • Which program should be responsible for managing the tables in the database?
  • Should every program manage its exclusively needed tables itself or should one manage all so that the database is managed from a central point?
  • Who should manage the tables that both applications need?
  • Or should I manage the database myself as the database structure shouldn't change that often anyway

Some info on the side: DBMS is 9.3, webapp is using and accessing the database throu (currently managing the database using evolutions), and the other program is written in scala and acesses the database using .

mgttlinger
  • 1,435
  • 2
  • 21
  • 35
  • There seems a lot of confusion here... The backend IS the database. A frontend should NEVER interact with the database. ... – Thomas Weller Dec 31 '13 at 07:15
  • @ThomasWeller I know what you mean but I dont know how I should call it. By frontend I mean the whole application that the user interacts with which of course itself consists of its frontend(the web gui) and a backend(model and controller) and by backend(in the question) I mean an application that just processes the information in the database and does things whose results the user will experience but never interacts directly with this application. – mgttlinger Dec 31 '13 at 07:19
  • Yes, but you should clarify your concepts first: Frontend (better: Presentation logic) is the one part that is responsible for interacting with the end user. The business logic is actually what you call 'backend' (model and controller). And the data access logic is the ONLY part that should interact with the database (the backend of the application). – Thomas Weller Dec 31 '13 at 07:24
  • @ThomasWeller I have rewritten the question a bit and removed the frontend backend confusion. – mgttlinger Dec 31 '13 at 07:32
  • Another question: What do you mean with _managing a database_? Normally, a database is static and does not need to be _managed_ at all, – Thomas Weller Dec 31 '13 at 07:38
  • @ThomasWeller somewhere the tables are created (currently in plain SQL using evolutions in my webapp) now if something changes in my application (not necessarily in the webapp) some part might need new columns in a table or a new table altogether. I dont know if it is good design that I change the evolutions in the webapp when the webapp isnt affected at all by the changes. – mgttlinger Dec 31 '13 at 07:42

1 Answers1

0

Since nobody is providing a better solution I decided to manage the DB by hand as the structure of the database shouldn't change after my application goes live.

mgttlinger
  • 1,435
  • 2
  • 21
  • 35