OSRM does not use a database, but tuned data structure that are sometimes (falsely) called index. The process to go from raw OSM data to actual query processing is a multi-step process, i.e. extract, prepare, route. As Mapperz said, it is possible to query a SQL data base for additional data during the extraction process.
To query OSRM for routes from your SQL queries, you would need to connect via http to a running OSRM instance and parse the data.
Do you need this functionality with a few via nodes (in this case I think there is a very similar Google API) or for a detailed track ( i.e. map-matching )? Otherwise you'll have to setup OSRM with a selection of roads instead of the full OSM.
If you only want to use your own data, I would suggest writing a script that converts it to the OSM XML format. We have done this in the past with proprietary data sets and it works fine (albeit you might consider writing out the PBF format if the data size is very large).
Merging OSM and non-OSM data is whole different story. That is nothing that can be solved on the OSRM side. Can you give more details on the nature of your data? Can it be added back to OSM? Does it contain own geometry or just remove geometry (you could disable specific roads in the profile)?
Best Answer
OSRM does not use a database, but tuned data structure that are sometimes (falsely) called index. The process to go from raw OSM data to actual query processing is a multi-step process, i.e. extract, prepare, route. As Mapperz said, it is possible to query a SQL data base for additional data during the extraction process.
To query OSRM for routes from your SQL queries, you would need to connect via http to a running OSRM instance and parse the data.