79317388

Date: 2024-12-30 10:51:38
Score: 0.5
Natty:
Report link

You're doing a complete apples to oranges comparison here. They are completely different things which serve very different purposes. The only actual resemblance is that both are simple key value structures.

ENV variables are variables which are set by operating system, shell or when invoking the process (or from a file by tools like DotEnv). They are typically used to tell programs things about the environment which they are operating in (thus the name). In general they should be treated as immutable inputs.

Redis is an in-memory storage that can be used as key-value database, cache or message broker between programs (and many more things). Unlike ENV variables it is actually meant as a read and write storage.

Is data fetching from RedisDB faster than ENV variables?

It's completely irrelevant as they have different uses. The difference in performance extremely negible as both are just reading from memory. Redis will have slightly more overhead as you're communicating with a different process but it's irrevant.

Is memory consumption greater in ENV or RedisDB?

If memory consumption is an issue you probably shouldn't be using either of them.

Unable to measure statistical data to prove which one is better. Please suggest

Read up on the two concepts and stop using a screwdriver to beat a nail in.

Reasons:
  • RegEx Blacklisted phrase (2.5): Please suggest
  • Long answer (-1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • High reputation (-2):
Posted by: max