The system I’m working is structured as below. Given that I’m planning to use Joomla as the base.

a(www.a.com),b(www.b.com),c(www.c.com) are search portals which allows user to to search for reservation.
x(www.x.com),y(www.y.com),z(www.z.com) are hotels where booking are made by users.
- http://www.a.com’s user can only search for the booking which are in
http://www.x.com - http://www.b.com’s user can only search for the booking which are in
http://www.x.com,www.y.com - http://www.c.com’s user can search for all the booking which are in
http://www.x.com, http://www.y.com, http://www.z.com
All a,b,c,x,y,z runs the same system. But they should have separate domains. So according to my finding and research architecture should be as above where an API integrate all database calls.
Given that only 6 instance are shown here(a,b,c,x,y,z). There can be up to 100 with different search combinations.
My problems,
Should I maintain a single database for the whole system ? If so how can I unplug one instance if required(EG : removing http://www.a.com from the system or removing http://www.z.com from the system) ? Since I’m using mysql will it not be cumbersome for the system due to the number of records?
If I maintain separate database for each instance how can I do the search? How can I integrate required records into one and do the search?
Is there a different database approach to be used rather than mentioned above ?
The problem you describe is “multitenancy” – it’s a fairly tricky problem to solve, but luckily, others have written up some useful approaches. (Though the link is to Microsoft, it applies to most SQL environments except in the details).
The trade-offs in your case are:
By far the simplest to manage and develop against is the “single database” model, but only if the data is moderately homogenous in schema, and as long as you can query the data with reasonable performance. I’d not worry about putting a lot of records in MySQL – it scales very well.
In such a design, you’d map “portal” to “hotel” in a lookup table:
PortalHotelAccess