A programmer needs to store output in a place that can be accessed as quickly as possible. The data does not need to remain persistent. Which of the following is the BEST option for storing the data?
A programmer needs to store output in a place that can be accessed as quickly as possible. The data does not need to remain persistent. Which of the following is the BEST option for storing the data?
To store output that needs to be accessed as quickly as possible and does not need to remain persistent, the best option is memory (RAM). Memory provides much faster access times compared to other storage options such as flat files, relational databases, or solid state drives. Since the requirement specifies that persistence is not necessary, memory is the most suitable and efficient choice.
B. Memory is best option. Explanation: The data does not need to remain persistent. And we know that all data in memory is lost if your computer loses power.
The answer is B
... similarly, accessing data from memory (as asked in the question) is significantly faster than accessing the same data from a flat file. This is because the data held in the flat file would need to be accessed from disk storage and loaded into RAM (memory) before it could be used anyway.
Persistent data is data which you want to be available even after you fully close and restart your app. The three most common ways to safe this data locally is by using SharedPreferences, a local database or the file system (store data as a file). Given that this question mentions the non-persistent data --> should be in memory + much faster than storing in a hard drive!
Why mention data persistence not being necessary if its not to do with RAM?
B. Because data does not need to remain persistent.
Writing data to memory is orders of magnitude faster than writing data out to a flat file. The question states that persistence is not an issue, so memory should be the correct answer here.
memory should be the one
B is the answer.
B. Memory is the best option. The BEST option for storing data that needs to be accessed as quickly as possible and doesn't need to remain persistent is "Memory."
............................
Filesystem Persistence One way to achieve persistence is to simply save data to so-called “flat files”.