Giter Site home page Giter Site logo

Comments (3)

bokunodev avatar bokunodev commented on July 17, 2024

Json is already used for configuration files in many Go programs. Json is "simple" and "readable".
also to use Json no external dependencies required.
If it's not Json, then what is the alternative?
I suggest .ini file as an alternative

from dasarpemrogramangolang.

novalagung avatar novalagung commented on July 17, 2024

@bokunodev

JSON is not recommended on the production stage, especially when application managed using orchestration via Kubernetes. Every configuration needs to be in an os environment variable or in the shared storage like ETCD for example.

It'll be hard to manage the app seamlessly in an automated manner when the config is stored in a file. Like for example, what if I want to scale the current container into several instances with different port and config? I need to rewrite the .ini or the .json file on-the-fly? No. definitely nope.

I'm not talking about the self-preference version. I'm talking about real-world implementation. even docker-compose used env var to manage the config

from dasarpemrogramangolang.

novalagung avatar novalagung commented on July 17, 2024

what I'm going to do probably improve the current JSON config chapter, explain the pros and cons (from DevOps perspective). and then create another one that uses OS env var. let's see.

from dasarpemrogramangolang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.