Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create tiles with data from multiple databases #845

Open
bchapuis opened this issue Apr 10, 2024 · 1 comment
Open

Create tiles with data from multiple databases #845

bchapuis opened this issue Apr 10, 2024 · 1 comment

Comments

@bchapuis
Copy link
Member

bchapuis commented Apr 10, 2024

Tilesets currently connect to a single database. It would be nice if a tileset could span and connect to several databases.

One possible implementation would consist in specifying the data source at the layer level in the tileset. This way the TileStore could group layers by data source, fetch the layers by data source, and concatenate the layers in the TileStore. This is probably the easiest way to implement this feature, however, it means that each layer query will always involve only one database.

{
"datasources":[
 {
   "id": "a"
   "jdbcUrl": "jdbc:postgresql://a:5432/a",
   "poolSize": 8
 },
 {
   "id": "b"
   "jdbcUrl": "jdbc:postgresql://b:5432/b",
   "poolSize": 8
 }
],
"vector_layers": [
    {
      "id": "layer-a",
      "datasource": "a"
      "queries": [
        {
          "minzoom": 12,
          "maxzoom": 20,
          "sql": "SELECT id, tags, geom FROM table"
        },
      ]
    },
   {
      "id": "layer-b",
      "datasource": "b"
      "queries": [
        {
          "minzoom": 12,
          "maxzoom": 20,
          "sql": "SELECT id, tags, geom FROM table"
        },
      ]
    },
]

Another possibile implementation may be to rely on apache calcite to provide a uniform access to several databases. This solution would allow to execute queries that span over multiple databases. Personally, I'm a bit more interested in this alternative, as I currently seek to improve the compatibility of calcite with postgis. Unfortunately, it is probably not practical in a short to medium time frame.

apache/calcite#3668

I suggest we go for the first option, keeping in mind that apache calcite may be a better solution in the long term. @julsbreakdown do not hesitate to comment and to provide feedback.

@bchapuis
Copy link
Member Author

We should probably find a way to set a default datasource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant