|
Improve Performance - Case Study :: Article - 2eNetWorX
|
|||
| 2eNetWorX :: ASP, VB, Asp.Net, Vb.Net, C#, dotNet, .Net OpenSource Projects |
| MyDev | What's New | Projects | Tutorials & Articles | Services | Stats | Contact Us |
| Guest-02583 | /dev :: home :: articles :: Caching Recorsets | 21 online visitors |
» Contributions
» Recordset Cache » OpenSource » Statisticus » OpenCYA!
» Undocumented... » Ask For Login » DSN'less Connection » Who's Online? » (All Samples)
|
Improving Database Performance by Caching serialized Recordsetsby Hakan Eskici Part 1 - Key Features and DesignPart 2 - Cache Storage and Implementation Part 3 - GetRecordset Function Part 4 - Cache Expiration and Removal Part 5 - Using the Cache Engine in your Projects Part 6 - Case Study and Final Words Step #2 (knowing when to call expiration methods) actually depends on your application design. For example, if your Customers table gets updated a few times a day; it would be wise to call ExpireTable "Customers" whenever you update your table.
'...
'You would have code above to initialize
rs.AddNew
rs("FirstName") = Request("txtFirstName")
rs("LastName") = Request("txtLastName")
'...
rs.Update
'Now it's a good time to expire your
'Customers table:
Dim MyCache
Set MyCache = New DataCache
MyCache.ExpireTable "Customers"
There is a tradeoff between performance and freshness when we talk about
caches. Our implementation is no different.
You can also put up a button somewhere in your administration pages to call RemoveAll() method on a periodic basis to make sure your all cache items get expired regularly. This caching technique is being used on 2eNetWorX/dev for a long time and provides impressive performance gain. Of course, the internal cache engine is more complex and have more features, but it's based on the ideas presented in this article. I have performed a few tests with a large database that contains hundreds of thousands of records (actually it's an old 2eNetWorX StatCounteX database). Here are the results:
Query 1: SELECT AVG(StatID) FROM Stats Query 2: SELECT * FROM TopPageViewsPerDay Query 3: SELECT * FROM TopIpsPerDay For a sneak preview of the internal 2eNetWorX cache engine, take a look at the cache reports. Feel free to contact us if you have questions, comments or new ideas related to the material presented here, or about purchasing the advanced version of the cache engine. Remember that we developers need feedback. Until the next article, take care. < Previous Part: Using the Cache Engine in your Projects Hakan Eskici 2eNetWorX OpenSource Projects http://www.2enetworx.com/dev |
Bot: Google
FogBugz Hosting Plans
Note Thing - A Perfect
|
| privacy policy , license , disclaimer , © 2000-2004, 2eNetWorX. [page generated in 8 ms.] |