Solved

In-Memory Database

Posted on 2001-08-02
10
223 Views
Last Modified: 2010-05-02
I have a 3 tier Application. In the middle tier, which is in the form of active X Exe, i want to get data into the middle tier from the database and maintain it in-memory till the exe is being used.
Please suggest how to maintain the data other than disconnected recordsets
0
Comment
Question by:agl
10 Comments
 
LVL 3

Expert Comment

by:nigelrowe
ID: 6344288
Store it in arrays?
0
 
LVL 6

Accepted Solution

by:
andyclap earned 50 total points
ID: 6344313
Memory databases are extremely powerful when used correctly - I use the concept in my current application and the performance is amazing compared to fetches from the database each time.

I can't really go into too much detail here, as my current app's implementation is very complex, but here are a few general things I've come across with cacheing data in memory:

MTS - state is not maintained, so your data cache tier cannot use MTS.

Data synchronisation across machines - If you have data in memory, and it's changed on one machine, the data needs to be refreshed somehow. I used a mechanism using sockets to broadcast data update messages across all client workstations.

My data layer translates recordsets into collections of objects - it's not the fastest way to do things, but it makes coding against the objects very easy. I wrote a small 'generator' program to produce VB code for the data tier objects, their collection, and the general access/synchronisation code based on a database table.

Microsoft are interested in memory databases - SQL server is scheduled to have some kind of client cacheing in the near future, so it might be worth waiting or trying to find out how it's going to be done before coding your own version.

Garbage collection - Unless your DB is small, don't try and keep everything in memory. Use a garbage collection technique to 'forget' data which is not being used. You can use a reference count (like COM), a proper GC (like .net) or an alternative method (I use a callback interface to check if an object is still being referenced by an active object before removing it from the cache).

0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 6344492
0
 
LVL 3

Expert Comment

by:Joebob
ID: 6344603
Just curious, what do you have against disconnected recordsets?
0
 
LVL 14

Expert Comment

by:wsh2
ID: 6344701
<ping>.. Listening
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:agl
ID: 6344759
Joebob

We have used disconnected recordsets in the application using collections along with it.But performance is hampered as we keep as many as 100000 records at a time in memory and using recordsets we have to scroll through each and every record to get to the one we want to process.
So we want a system where we can use sql queries(select,update,insert,delete) and get records in one shot rather than scrolling through them.



0
 
LVL 3

Expert Comment

by:Joebob
ID: 6344838
Why not use the filter property of the recordset.  With tht filter property, ADO searchs the records for you using the indexes that it retrieved from the database.  I assume the fields you want to search by are indexed fields.  By using disconnected recordsets and this property, you should have a in-memory db with good performance at the same time.

If this still doesn't give you the performance you need, then your only real choice is to convert the records into a sorted list that you can use a binary search on.  But of course you can actually do a binary search on a recordset also by using the move method and specifying the record to jump to.
0
 
LVL 12

Expert Comment

by:guidway
ID: 7180502
Thank you for your interest in Expert’s Exchange. We hope that this information has assisted you in diagnosing your problem. Please award the experts who diligently helped you to find a solution (if any) or request a moderator to PAQ or delete this question. I will check back in seven days to see if a response was given. If not this will be turned over to a moderator for a decision. Thank you!

Your options are:

1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts and include the details (expert name and point values to each).
4. Delete the question. Again, you must tell the other participants why you wish to do this, and only Moderators can take this action for you. Do not try to delete them directly if any comments exist, they will be pended and will not complete.

For special handling needs, please post a zero point question in the link below, include the question QID/link.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

Please click this Help Desk link for Member Guidelines, Member Agreement and the Question/Answer process: Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues.
http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp


PLEASE DO NOT AWARD THE POINTS TO ME. ------------> EXPERTS: Please leave any comments regarding this question here on closing recommendations if this item remains inactive another seven (7) days.

 



0
 
LVL 12

Expert Comment

by:guidway
ID: 7196297
My following recommended disposition:

Points to andyclap

If you have any comment or objection to the recommendation, please leave it here.

guidway
EE Cleanup Volunteer


0
 
LVL 5

Expert Comment

by:Netminder
ID: 7199558
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now