Skip to content

Drop the table schema cache, cache capabilities as utf-8 - #291

Open
smnorris wants to merge 1 commit into
mainfrom
drop-schema-cache
Open

smnorris wants to merge 1 commit into
mainfrom
drop-schema-cache

Conversation

@smnorris

Copy link
Copy Markdown
Collaborator

Schema caching dropped - schema requests are only 1 additional request per download (which should not be significant), the cache could lag the data, and the cache is additional data to maintain.

Schemas are now kept in memory only, shared by all BCWFS instances for the life of the process. Each table is still described once per process and in batches of up to SCHEMAS_PER_REQUEST on the session's existing connection. get_schema returns copies, as reading the cache did. Old schema files in the cache folder are ignored.

The capabilities cache, now the only file in it, is written and read as utf-8 rather than in the platform's default encoding. A cached file that is not utf-8 (written by an earlier version, eg in cp1252 on Windows) is requested again.

Table schemas were cached on disk as JSON written by bcdata's own parser,
so a change to how schemas are parsed would meet files parsed by an
earlier version for up to 30 days, and a cached schema could be up to 30
days older than the data it describes (downloads are coerced to the
schema since #283).

Schemas are now kept in memory only, shared by all BCWFS instances for
the life of the process. Each table is still described once per process
and in batches of up to SCHEMAS_PER_REQUEST, on the session's existing
connection. get_schema returns copies, as reading the cache did. Old
schema files in the cache folder are ignored.

The capabilities cache, now the only file in it, is written and read as
utf-8 rather than in the platform's default encoding. A cached file that
is not utf-8 (written by an earlier version, eg in cp1252 on Windows) is
requested again.

Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant