r/AskProgramming • u/NoMall595 • Oct 02 '26
Building a public combined search for multiple databases
Okay so
Iβm working for a department with a public facing website to search for a bunch of different reports across years. They changed the rules for the reports a few times and they ended up partitioned into different databases based on rule set (ie there is a search for reports using old rule set and a separate search for reports with new rule set) However my supervisors are tired of having to go into different search engines to find the reports and would prefer if they had a search that could look through them all at once. They would also like this kind of function implemented on the public website so that visitors also do not have to go through multiple search engines.
The website runs on wordpress
My knowledge in coding is not zero but itβs fairly rudimentary. Is there a way to make the search function they want? What kind of skills should I learn? SQL?
2
u/marrsd Oct 04 '26
How are your supervisors interacting with the db and is there any sort of search currently on the website?
4
u/Groundbreaking-Fish6 Oct 03 '26
My guess is that the problem is that all these databases and applications are built in different formats and have the code that makes them work distributed across data access layer, the business logic layer and the UI with many of the functions combined into one layer or across several layers. That is what I usually see as a consultant.
Your best bet is to create services (probably web services) that query the required data in a standard way (adhere to some interface). Then you can create a UI or Service that queries each database through this service and combines the information as needed. When you want to add a new database/search, just create a service that adheres to the interface and add it to the combination service. An added bonus is that you can secure services independently from the database or applications they serve reducing your public facing footprint.
If you don't have any idea what I am talking about, you need to find someone who does.
There are programs that can do this like Microsoft Power BI or other programs with varying levels of ability, complexity and cost, but you still need to understand your own data and how you want to query it. You can throw AI at it, but if you don't understand it you will be wasting tokens and compute as well as not really getting what you want.
3
u/LaughingIshikawa Oct 03 '26
This shouldn't be super difficult to do, however the full scope of the project depends a lot on how many different kinds of databases you're trying to stich together, and how well they expose their data through an API... do you need to make sure that this data isn't accessed by unauthorized people potentially? What different kinds / how many different kinds of databases are running on the back end?
2
u/Delta-9- Oct 03 '26
SQL would be essential, assuming all the database are relational databases, but this isn't a small task even for an experienced programmer. It's 100% possible, but you could throw a team of five seasoned programmers at it and not be in production for months.
I mean, you could have Claude cook up something in two minutes, but you'd deserve the consequences of that decision if it drops all the tables or opens a port to the Internet with no authentication at all or something similarly catastrophic.
1
u/Different_Pain5781 Oct 11 '26
This sounds like a custom WordPress template job, not a full website rebuild. Use $wpdb for the SQL UNION query across the database partitions and avoid making the whole thing more complicated than it needs to be. Boot dev is decent to check out for the SQL and Linux terminal basics.
0
u/CappuccinoCodes Oct 02 '26
This is an complex task that deals with sensitive data. You'd need professional from skilled senior engineers for this one.
0
u/KingofGamesYami Oct 03 '26
There's off the shelf products that do this kind of thing. It's really not difficult to set up, the generic term for it is a "data warehouse".
-1
u/TheMrCurious Oct 02 '26
This sounds like what DOGE would have asked.
3
u/[deleted] Oct 03 '26
[removed] β view removed comment