Answer the question
In order to leave comments, you need to log in
C# - how to choose an in-memory data store?
There was a case, the need forced me to turn to the DBMS , but I avoided this quite simply. It was possible to split the data into fragments of 1 - 20 Mb, so that requests do not capture more than one such file. That is, it was possible to separate everything without any damage, from which I was able to abandon the DBMS in principle, returned to XML and everything is fine ...
But still, the problem overtook me, it became necessary to store data in an "array". I write like this because I have been using them in PHP for 15 years and did not know grief. Just because there was nothing plainly, the question did not stand. However, nothing lasts forever... Therefore, now in C# you need to do something like this:
<?php
$E = array(
array(double, DateTime, double, string, int),
array(double, DateTime, double, string, int),
array(double, DateTime, double, string, int),
array(double , DateTime, double, string, int),
array(double, DateTime, double, string, int)
}
?>
Represents a collection of keys and values.
Answer the question
In order to leave comments, you need to log in
Essentially, a list of elements of a certain structure is required.
But if you need data persistence, then in my opinion the best solution would be a DBMS like SQLite. It will be both more economical in memory consumption and more scalable.
It all depends on what is needed.
If you just need to serialize, then you need IEnumerable.
If you need to know in advance the number of elements, then you need an ICollection.
If you need work access by element indexes, then you need IList.
If work on keys is necessary, IDictionary is necessary.
If you need to bind/handle element changes, then you need an IBindingList or IObservableCollection.
These are the basic features that any class for storing elements will inherit. Further, if the method of storing elements or special access is important, choose or implement a class with the necessary interfaces and capabilities.
Base classes: array, List<T>
Queue<T> - queue
Stack<T> - stack
Dictionary<TK,TV> - a dictionary
ObservableCollection<T> - a collection with support for change events
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question