What can be used to store static data?

I wanted to save the an api endpoint url in Plone. However, I would like to access the value from all instances of Plone. Currently, I am using a script that is called whenever a a content type creation event is called but id have to save the url in the code. This doesnt allow me to change the url after running Plone or the script.
I wanted to know if anyone had used anything that would provide a similar or the same functionality in allowing me to create a static and safe storage method in plone.
Related solutions
I was able to find some information about using Plone registry to save persistent data. The only problem with this is that it would create a new instance of that registry for each plone site. Therefore, not allowing me to have one set value that im able to change. I was trying to find if there was a static variation of it but i was unsuccessful in finding any.

You have many options:

  • the ZODB
  • the file system
  • a (relational) database

In all cases, you would have a Python module/package which hides the storage details.

What kind of static data is this?
If you have static data belongs a resources to your own code and/or package then you include the data with your package and service from your package using a browser view or a static resource directory.

Your description of what you want to save and why is very vague, so the question of what you mean with static data still stands if you want more specific help from others.

Seeting your requirement to share the data between Plone sites (but maybe all running in one Zope container), you might want to check out souper.plone and underlying souper .

I haven no personal experience with it, but I know it is used for storing and querying more relational data efficiently in a Zope/Plone instance and in production use, from the description of the package it mentions you can share a souper storage between multiple Plone sites.

1 Like

I also would recommend having a look at https://pypi.org/project/souper.plone/
We use that for all kinds of data, from storing contact form submissions to order entries in a shop.

1 Like