We do in lots of places. Python has a database API specification, with implementations for lots of popular databases. Want to write and test with sqlite then move to MySQL, Postress or Oracle? Go ahead. Medical images are stored in PACS systems: databases with software wrapped around them to do network and API access. Any scanner can talk to any big hospital system, or the open source PACS server running on your notebook.
This stuff already exists, and we already use it where it makes sense.