Caching when updating mbtiles in Martin #1322
-
I am using Martin with mbtiles and one of them is the planet mbtiles. If I update the planet mbtiles file, is the only way for Martin to pick up the changes to restart the server? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
yes and no - mbtiles is a sqlite db - so if caching is disabled, it might actually be able to pick it up directly... That said, I would advise not to do it because sqlite is not usually recommended for read/write access from multiple processes. Instead, you can do the same thing relatively easily with a postgres db (i.e. just store things as blobs). On the other hand, for small installs / low usage, you might get away without having a proper server. To do this in PostgreSQL, simply set up a table with |
Beta Was this translation helpful? Give feedback.
-
@nyurik just for clarity and also anyone else who may be wondering, I presume to have the alternative setup via Postgres # Here my Martin configs...
postgres:
connection_string: '${DATABASE_URL:postgresql://postgres@localhost:5432/db}'
default_srid: 4326
pool_size: 20
functions:
get_bytea_data:
schema: public
function: get_bytea_data
minzoom: 0
maxzoom: 21 |
Beta Was this translation helpful? Give feedback.
yes and no - mbtiles is a sqlite db - so if caching is disabled, it might actually be able to pick it up directly... That said, I would advise not to do it because sqlite is not usually recommended for read/write access from multiple processes. Instead, you can do the same thing relatively easily with a postgres db (i.e. just store things as blobs). On the other hand, for small installs / low usage, you might get away without having a proper server.
To do this in PostgreSQL, simply set up a table with
z, x, y, data
columns, and write a function that takesz,x,y
and returns data. This is very similar to the structure of the mbtiles itself. You may want to use non-flat structure too, but it…