Re: Database for C#?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Michael B. Trausch wrote:
On Mon, 24 Nov 2008 02:05:03 +0200
"Stanimir Stoyanov" <stoyanov@xxxxxxxxxxxxxxxxxxx> wrote:

Yes, XML lookup would be slow because it is not indexed. SQL is a
good choice but for an application such as Outlook add-ins XML might
be a better choice--one file, no additional libraries or software
required.

However, ensure that at startup you cache the whole content to a
relevant Dictionary<key, value>. Loading might be a little slow but
once cached, value lookup will be much faster (by the way, loop
through all XML nodes consequently, don't select based on criteria).
Of course, you can also do tests to see how this affects the overall
performance of the add-in.

Hrm.

This will incur a consumption of at least 400,000 bytes of RAM (5 bytes
times 80,000 ZIP codes). This isn't counting the city/state data if
that is part of the XML file.

It'd probably be better to use (if available) a DBF table and the
Windows DBF ODBC driver. DBFs can be indexed, and, if memory serves,
queried with a subset of SQL. However, in doing that, you'll incur the
penalty of also not being cross-platform.

You could create a primitive DBF library in under 3-4K legible source
code size---certainly smaller than a simple C reader that includes
indexing support---it won't include SQL capability, but you'll gain the
ability to use a DBF (and its index) and the ability to use whatever
query interface suits you best. You won't incur the memory usage
penalty that you would if you had the entire thing loaded in memory
that way, unless you write the DBF library to load the entire thing
into RAM.

If memory consumption is not a concern and you expect people to always
have lots of RAM free, then reading the XML file isn't a problem.

Hm.

400 KB is nothing today.

And in memory will be a lot faster than a database.

And writing ones own database library seems as a complete
waste of resources.

And the aspect of cross platform does not seem to apply
much to an Outlook Addin written in C#.

Arne
.



Relevant Pages

  • Re: implementing roles in OOP......
    ... >>libraries already supply this sort of stuff. ... XML is designed around this notion while providing hierarchical ... identity positionally to encoder/decoder interface arguments similar to ... > I think patterns are in the title because they are trendy. ...
    (comp.object)
  • Re: Macro lambda list
    ... Lisp is basically a perfect language for SOA -- it ... and XML maps really well to Lisp ... A standard way to pass parsed XML ... Support libraries for some of the WS-* standards, ...
    (comp.lang.lisp)
  • Re: scheme seems neater
    ... I can download the JDK and get regexes and XML parsing for free. ... search around on CLiki.net for XML libraries ...
    (comp.lang.lisp)
  • unable to install gnome2 from ports
    ... port may not be enabled ... XFree86-libraries-4.3.0_6 XFree86-4 libraries and headers ... docbook-sk-4.1.2_3 XML version of the DocBook DTD version controlled for Scrol ... gnome-icon-theme-1.0.9_1 A collection of icons for the GNOME 2 desktop ...
    (freebsd-questions)
  • Re: XML-lib for clipper
    ... It is based on DBF2XML which was posted ... that allows the xml to be used to recreate a DBF from it. ...
    (comp.lang.clipper)