0

I need to store key-value pair, which will be permanent and updated from time to time. The options which I see, but want to avoid them are:

  • add this key to external database,
  • store it in Sitecore Item (because, there can be lot of version etc. I see it as problem)
  • in memory (when application restart, the key will be lost)

Is there any built-in way to handle that?

1 Answer 1

2

Database:
Why do you see external database as an issue? If needed, other sitecore instances or applications that has an access to database can read this value.

File:
Also you can create a config or any txt file that contains this information. Everytime the value is needed it can be read from the file. Assuming you have only one sitecore running.

Sitecore Item:
You can store it under the "system/settings" item where usually sitecore users doesn't have access unless they are administrators. Or you can store it inside core database which is good place to put these kinds of values normally. You can hide the item too and even lock it.

1
  • Generally it is good idea, but in that case having table with one record on it, looks like to much effort to have that. I will check with Sitecore system/setting item. Thanks!
    – klucyszy
    Commented Jan 8, 2021 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.