?
=?ISO-8859-1?Q?=22Andr=E9s_G=2E_Aragoneses_=5B_kno
I am developing a Windows Service that is resident on the machine. The
program needs to synchronize certain object list in memory (an object
typed as List<Foo>) with disc, serializing and deserializing XML.
The first simplest technique I have used ATM is the following:
- At program start, if the XML file exists, deserialize it and create an
object with its content.
- Every time the list changes (an element is added or remove), I
serialize the entire object again and I write a new file (overwriting
the old one).
The problem is that I am a little bit concerned about this going to
production, because of the following matters:
- Scalability: What would happen if the list begins to grow to, for
example, 1000 or 10000 elements? (I suppose that the data serialization
would take much longer and the program would go much slower when the
list is modified).
- Data loss: what would happen if the computer looses energy in the
moment when the serializer is writing data to disc? (I suppose that I
would loose the last list written and I would get a new corrupt file, am
I right?).
Do you have any ideas to improve this behaviour?
Thanks in advance.
Andrés [ knocte ]
--
program needs to synchronize certain object list in memory (an object
typed as List<Foo>) with disc, serializing and deserializing XML.
The first simplest technique I have used ATM is the following:
- At program start, if the XML file exists, deserialize it and create an
object with its content.
- Every time the list changes (an element is added or remove), I
serialize the entire object again and I write a new file (overwriting
the old one).
The problem is that I am a little bit concerned about this going to
production, because of the following matters:
- Scalability: What would happen if the list begins to grow to, for
example, 1000 or 10000 elements? (I suppose that the data serialization
would take much longer and the program would go much slower when the
list is modified).
- Data loss: what would happen if the computer looses energy in the
moment when the serializer is writing data to disc? (I suppose that I
would loose the last list written and I would get a new corrupt file, am
I right?).
Do you have any ideas to improve this behaviour?
Thanks in advance.
Andrés [ knocte ]
--