Say that I have some data that is publicly available to begin (like an archive of hackernews stories), and I would like to make it available publicly in a sql database that is world-accessible. The constraints/salient points are these:
- The data is public to begin with so there's no risk of leaking sensitive information.
- Users should be allowed to run any
SELECTorSHOWPLANbut nothing destructive likeDELETEorDROP. - The worst-case scenario here should be that someone manages to somehow sneak a
DROPthrough and the whole thing vanishes. This scenario is acceptable with very low probability. What is not acceptable is that someone manages to get root access to the system on which the database is running. - Rate limiting is outside the scope of the problem. It can be assumed that this can be done higher up, like at the API level.
Could all of these be satisfied by something as simple as having a database fronted by an API with a single endpoint which takes SQL queries, parses them, filters them, and forwards them to the database?
Are there any instances of this happening in the wild? Google returns 0 results when searching "publicly readable relational database"...