Building an cache-component

Results 1 to 2 of 2

Thread: Building an cache-component

  1. #1
    Magnus Mellin Guest

    Default Building an cache-component

    I&#039ve started to build on cache-component to minimize my database-searches and would like some input on the core ideas.<BR>The idea is to save complex database queries in XML-files, whenever an table is updated, delete the cache-file and write an new one.<BR>Some questions:<BR>1) Is there any way to store memory persistent information in an VB-Com object?<BR>The ideal situation is to save the database queries in memory (internal memory is cheap compered to a clusterd web farm with Oracle 8 databases).<BR>2) The big one: Can I improve performance by storing queries as XML-files (or any other way)? Or is accessing the filesystem slow? In other words, should i save or delete my VB project file right away? :)<BR>Regards,<BR><BR>Magnus Mellin<BR>

  2. #2
    Christiaan Guest

    Default RE: Building an cache-component

    Define &#039storing persistant data in a component&#039<BR><BR>My guess is that you want to store stuff in a session variable or something. Don&#039t do that! Storing state is really evil and hurts scalability a lot. Like i explained in another reply, the reason for this is that the server has to spawn an instance of the component for each and every user because the values of several global (read: not within just methods) can differ for each user. So, don&#039t go there.<BR><BR>building a system that employs the FSO is a very good idea. But VB6 has a lot more powerful (and faster) methods than the FSO. For more information, check out They have some info on reading files using handles in their tip-bank (didn&#039t have the time to look up the exact article).<BR><BR>Uhm....locks? You&#039re going to be in for a hell of a fight if you want to be sure that you aren&#039t going to experience any locking problems. A file can only be opened once at a time.<BR><BR>last, but not least, i&#039ve already made a component that does exactly what you described in your post. You just put a query into it and it&#039ll determine by itself where to get the data from. It&#039s possible and many, many times faster than using a database. But it has its cons too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts