Dynamic Vocabularies from SQL (what if SQL is offline)

Hi,
I have to setup a company team structure, data comes from a PostgreSQL database.
Staff will be saved in a Folder (a-z), teams will be filtered/sorted with an Collection.

But for that I need several vocabularies - dynamic generated from DB, but if the DB is offline, I'll get no data from the DB.

Has anyone a good idea how I can (temporary) save all the data for my vocabularies (German and English)?

Synchronisation with Database will be automated every 24h

thank you

What is the particular problem?

Either stored copies of the datastructure on the filesystem (as JSON, Python pickle or whatever) or using a cache like Memcached or Reddis.

I preference is also cache files. You need to ensure that you regularly check and update the cache files. In case of a ZEO environment you need to decide how to deal with cache copies across application servers.

-aj

Thank you, I didn't think about the filesystem...
My problems with redis/memcached or something in other: what if, if they are down?

Filesystem (json) is a good idea - but first I'll give https://pypi.org/project/souper.plone/ a try...

1 Like

Huuh? What do want with Souper here? Storing a datastructure as Python pickle is a two-liner and straight forward. Why do you need the extra complexity here?

I think this is a good (small) task for a first contact with souper...

And yes Python-pickles are the best way to store...