Best way to store and use config file in redis?












0















I have a config file with the following structure-



"Root":{
"Parent":{
"Child1":{"Key1":"Value1"},
{"Key2":"Value2"},
{"Key3":"Value3"}
"Child2":{"Key1":"Value1"},
{"Key2":"Value2"},
{"Key3":"Value3"}
}
}


I want to store this config in Redis instance of my PCF. I am thinking of creating a database with ConnectionMultiplexer say "Config" then add each value with key as (Root:Parent:Child[i]:Key[i]) and value with corresponding value[i] for it.
For reading the values I can ask for child[i] name and key[i] name from the consumer and return value[i].
Please suggest if anyone has a better way to achieve this? The config size could be very large up to 1000 child's.










share|improve this question





























    0















    I have a config file with the following structure-



    "Root":{
    "Parent":{
    "Child1":{"Key1":"Value1"},
    {"Key2":"Value2"},
    {"Key3":"Value3"}
    "Child2":{"Key1":"Value1"},
    {"Key2":"Value2"},
    {"Key3":"Value3"}
    }
    }


    I want to store this config in Redis instance of my PCF. I am thinking of creating a database with ConnectionMultiplexer say "Config" then add each value with key as (Root:Parent:Child[i]:Key[i]) and value with corresponding value[i] for it.
    For reading the values I can ask for child[i] name and key[i] name from the consumer and return value[i].
    Please suggest if anyone has a better way to achieve this? The config size could be very large up to 1000 child's.










    share|improve this question



























      0












      0








      0


      0






      I have a config file with the following structure-



      "Root":{
      "Parent":{
      "Child1":{"Key1":"Value1"},
      {"Key2":"Value2"},
      {"Key3":"Value3"}
      "Child2":{"Key1":"Value1"},
      {"Key2":"Value2"},
      {"Key3":"Value3"}
      }
      }


      I want to store this config in Redis instance of my PCF. I am thinking of creating a database with ConnectionMultiplexer say "Config" then add each value with key as (Root:Parent:Child[i]:Key[i]) and value with corresponding value[i] for it.
      For reading the values I can ask for child[i] name and key[i] name from the consumer and return value[i].
      Please suggest if anyone has a better way to achieve this? The config size could be very large up to 1000 child's.










      share|improve this question
















      I have a config file with the following structure-



      "Root":{
      "Parent":{
      "Child1":{"Key1":"Value1"},
      {"Key2":"Value2"},
      {"Key3":"Value3"}
      "Child2":{"Key1":"Value1"},
      {"Key2":"Value2"},
      {"Key3":"Value3"}
      }
      }


      I want to store this config in Redis instance of my PCF. I am thinking of creating a database with ConnectionMultiplexer say "Config" then add each value with key as (Root:Parent:Child[i]:Key[i]) and value with corresponding value[i] for it.
      For reading the values I can ask for child[i] name and key[i] name from the consumer and return value[i].
      Please suggest if anyone has a better way to achieve this? The config size could be very large up to 1000 child's.







      c# redis .net-core stackexchange.redis pcf






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 25 '18 at 13:42







      Ratan

















      asked Nov 22 '18 at 19:30









      RatanRatan

      717




      717
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I would suggest you shouldn't use Redis to store your configuration, use Spring Cloud Config Server instead.



          Config Server is purpose-built for storing application configuration, it has support for multiple environments and sharing common configuration across applications. Not only that, but you can use Steeltoe's Config Server Configuration Provider to access the configuration from within your application via IConfiguration without needing to write your own configuration provider for Redis or doing something else custom. It is also probably easier to maintain the config values with structured files in a git repository than a Redis dictionary, plus then all changes are easily audit-able and quick to revert via git history.






          share|improve this answer
























          • Thanks, @Tim for the suggestion. Currently, I am storing it in config server only but thinking to move it to Redis for fast retrieval and simultaneous access and modification by the various users. Wouldn't that be a good idea?

            – Ratan
            Nov 26 '18 at 18:25











          • I don't know the full scope of your requirements, but I've laid out the general arguments for why config server should be a better choice for storing app configuration. App config is generally loaded into memory on startup, so I wouldn't expect the config server to be a bottleneck for you. Unless users of your application need to be able to make changes to the config, I would think that git can handle your user-access concerns

            – Tim
            Nov 27 '18 at 13:07











          • another reason is I want to prevent the extra call to the config server each time the app restarts or some modification happens in the config that's why thinking of storing in Redis which will save these values in my app host container RAM

            – Ratan
            Nov 27 '18 at 18:13











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53437106%2fbest-way-to-store-and-use-config-file-in-redis%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I would suggest you shouldn't use Redis to store your configuration, use Spring Cloud Config Server instead.



          Config Server is purpose-built for storing application configuration, it has support for multiple environments and sharing common configuration across applications. Not only that, but you can use Steeltoe's Config Server Configuration Provider to access the configuration from within your application via IConfiguration without needing to write your own configuration provider for Redis or doing something else custom. It is also probably easier to maintain the config values with structured files in a git repository than a Redis dictionary, plus then all changes are easily audit-able and quick to revert via git history.






          share|improve this answer
























          • Thanks, @Tim for the suggestion. Currently, I am storing it in config server only but thinking to move it to Redis for fast retrieval and simultaneous access and modification by the various users. Wouldn't that be a good idea?

            – Ratan
            Nov 26 '18 at 18:25











          • I don't know the full scope of your requirements, but I've laid out the general arguments for why config server should be a better choice for storing app configuration. App config is generally loaded into memory on startup, so I wouldn't expect the config server to be a bottleneck for you. Unless users of your application need to be able to make changes to the config, I would think that git can handle your user-access concerns

            – Tim
            Nov 27 '18 at 13:07











          • another reason is I want to prevent the extra call to the config server each time the app restarts or some modification happens in the config that's why thinking of storing in Redis which will save these values in my app host container RAM

            – Ratan
            Nov 27 '18 at 18:13
















          0














          I would suggest you shouldn't use Redis to store your configuration, use Spring Cloud Config Server instead.



          Config Server is purpose-built for storing application configuration, it has support for multiple environments and sharing common configuration across applications. Not only that, but you can use Steeltoe's Config Server Configuration Provider to access the configuration from within your application via IConfiguration without needing to write your own configuration provider for Redis or doing something else custom. It is also probably easier to maintain the config values with structured files in a git repository than a Redis dictionary, plus then all changes are easily audit-able and quick to revert via git history.






          share|improve this answer
























          • Thanks, @Tim for the suggestion. Currently, I am storing it in config server only but thinking to move it to Redis for fast retrieval and simultaneous access and modification by the various users. Wouldn't that be a good idea?

            – Ratan
            Nov 26 '18 at 18:25











          • I don't know the full scope of your requirements, but I've laid out the general arguments for why config server should be a better choice for storing app configuration. App config is generally loaded into memory on startup, so I wouldn't expect the config server to be a bottleneck for you. Unless users of your application need to be able to make changes to the config, I would think that git can handle your user-access concerns

            – Tim
            Nov 27 '18 at 13:07











          • another reason is I want to prevent the extra call to the config server each time the app restarts or some modification happens in the config that's why thinking of storing in Redis which will save these values in my app host container RAM

            – Ratan
            Nov 27 '18 at 18:13














          0












          0








          0







          I would suggest you shouldn't use Redis to store your configuration, use Spring Cloud Config Server instead.



          Config Server is purpose-built for storing application configuration, it has support for multiple environments and sharing common configuration across applications. Not only that, but you can use Steeltoe's Config Server Configuration Provider to access the configuration from within your application via IConfiguration without needing to write your own configuration provider for Redis or doing something else custom. It is also probably easier to maintain the config values with structured files in a git repository than a Redis dictionary, plus then all changes are easily audit-able and quick to revert via git history.






          share|improve this answer













          I would suggest you shouldn't use Redis to store your configuration, use Spring Cloud Config Server instead.



          Config Server is purpose-built for storing application configuration, it has support for multiple environments and sharing common configuration across applications. Not only that, but you can use Steeltoe's Config Server Configuration Provider to access the configuration from within your application via IConfiguration without needing to write your own configuration provider for Redis or doing something else custom. It is also probably easier to maintain the config values with structured files in a git repository than a Redis dictionary, plus then all changes are easily audit-able and quick to revert via git history.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 26 '18 at 14:44









          TimTim

          34338




          34338













          • Thanks, @Tim for the suggestion. Currently, I am storing it in config server only but thinking to move it to Redis for fast retrieval and simultaneous access and modification by the various users. Wouldn't that be a good idea?

            – Ratan
            Nov 26 '18 at 18:25











          • I don't know the full scope of your requirements, but I've laid out the general arguments for why config server should be a better choice for storing app configuration. App config is generally loaded into memory on startup, so I wouldn't expect the config server to be a bottleneck for you. Unless users of your application need to be able to make changes to the config, I would think that git can handle your user-access concerns

            – Tim
            Nov 27 '18 at 13:07











          • another reason is I want to prevent the extra call to the config server each time the app restarts or some modification happens in the config that's why thinking of storing in Redis which will save these values in my app host container RAM

            – Ratan
            Nov 27 '18 at 18:13



















          • Thanks, @Tim for the suggestion. Currently, I am storing it in config server only but thinking to move it to Redis for fast retrieval and simultaneous access and modification by the various users. Wouldn't that be a good idea?

            – Ratan
            Nov 26 '18 at 18:25











          • I don't know the full scope of your requirements, but I've laid out the general arguments for why config server should be a better choice for storing app configuration. App config is generally loaded into memory on startup, so I wouldn't expect the config server to be a bottleneck for you. Unless users of your application need to be able to make changes to the config, I would think that git can handle your user-access concerns

            – Tim
            Nov 27 '18 at 13:07











          • another reason is I want to prevent the extra call to the config server each time the app restarts or some modification happens in the config that's why thinking of storing in Redis which will save these values in my app host container RAM

            – Ratan
            Nov 27 '18 at 18:13

















          Thanks, @Tim for the suggestion. Currently, I am storing it in config server only but thinking to move it to Redis for fast retrieval and simultaneous access and modification by the various users. Wouldn't that be a good idea?

          – Ratan
          Nov 26 '18 at 18:25





          Thanks, @Tim for the suggestion. Currently, I am storing it in config server only but thinking to move it to Redis for fast retrieval and simultaneous access and modification by the various users. Wouldn't that be a good idea?

          – Ratan
          Nov 26 '18 at 18:25













          I don't know the full scope of your requirements, but I've laid out the general arguments for why config server should be a better choice for storing app configuration. App config is generally loaded into memory on startup, so I wouldn't expect the config server to be a bottleneck for you. Unless users of your application need to be able to make changes to the config, I would think that git can handle your user-access concerns

          – Tim
          Nov 27 '18 at 13:07





          I don't know the full scope of your requirements, but I've laid out the general arguments for why config server should be a better choice for storing app configuration. App config is generally loaded into memory on startup, so I wouldn't expect the config server to be a bottleneck for you. Unless users of your application need to be able to make changes to the config, I would think that git can handle your user-access concerns

          – Tim
          Nov 27 '18 at 13:07













          another reason is I want to prevent the extra call to the config server each time the app restarts or some modification happens in the config that's why thinking of storing in Redis which will save these values in my app host container RAM

          – Ratan
          Nov 27 '18 at 18:13





          another reason is I want to prevent the extra call to the config server each time the app restarts or some modification happens in the config that's why thinking of storing in Redis which will save these values in my app host container RAM

          – Ratan
          Nov 27 '18 at 18:13




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53437106%2fbest-way-to-store-and-use-config-file-in-redis%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          If I really need a card on my start hand, how many mulligans make sense? [duplicate]

          Alcedinidae

          Can an atomic nucleus contain both particles and antiparticles? [duplicate]