Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

divostar's avatar

Can two laravel app use thesame database?

Hello, I have two laravel projects with setup as follows:

App1 - Web application portal NB: Currently on a remote server Allow students to submit applications and check the status of their applications online. Tables include (users, students, applications, documents, comments, faqs, answers)

App2 - Corp App NB: On our local server Allow to evaluate applications submitted via App1, view reports, manage selected applications, generate letters, etc. Tables include (users, students, applications, documents, interns, attestations, supervisors, messages, etc). App2 do not share login information with App1. It mainly contains login info of corp employees while App1 only contain login info of students and site administrator. Tables common between the two dbs are students, applications, documents and via master-master replication we are able to get all applications submitted to App1 on the remote server and on App2 we can update the status of the applications which is sync back to App1 DB. Now we want both applications and db to be on thesame server and so for replication to work , that would mean installing two instances of mysql with each database on a separate instance. Would it be better to just include all the tables of the website - App1 (comments, faqs, answers, etc) on App2 DB and make both applications now use one database?

0 likes
1 reply
simondavies's avatar

You can use the same DB, as long as the DB/server enables external connections.

For instance you can have a server with to sites running on them, then have a separate server for the DB, its separate incase the sites server crashes etc and you don't lose the DB as well, but you could also use the server to run a DB.

Its just the connection details, also as long as the space you get and DB allows multiple connections etc etc.

I would also run or ensure that you do backups things like that so not tt lose you whole data.

Please or to participate in this conversation.