[libagilejedi commit] r22 - wiki

0 views
Skip to first unread message

codesite...@google.com

unread,
Dec 1, 2008, 11:37:58 PM12/1/08
to libagileje...@googlegroups.com
Author: Daniel.Pupek
Date: Mon Dec 1 20:36:53 2008
New Revision: 22

Modified:
wiki/MemcachedForMonorail.wiki

Log:
Added info about new caching strategy

Modified: wiki/MemcachedForMonorail.wiki
==============================================================================
--- wiki/MemcachedForMonorail.wiki (original)
+++ wiki/MemcachedForMonorail.wiki Mon Dec 1 20:36:53 2008
@@ -6,11 +6,29 @@

Memcached offers an excellent solution for applications that need to
balance object caches across multiple servers. It does so without the
overhead of a database or even the use of the hard disk.

+Since the Monorail sessions exist independent of the ASP.Net session the
ASP.Net session can be used to persist values locally...this gives a
noticeable read performance.
+
= Use Scenarios =
* Monorail based web application load balanced on multiple servers needs
a fast efficient way of sharing session state without the overhead of
constantly reading a database.
* More Anyone?

= Details =
+
+== Caching Strategy ==
+This library is READ optimized. As long as memcached stays un-flushed your
app should never read from the database. Write speeds depend on the speed
of your db server. You have 3 options for persisting to the database;(1)No
db persistence, (2)Active record persistence (3) raw persistence.
+
+*WRITING*
+ * From the beginning of an action to the end values are stored in the
ASP.Net session.
+ * Once the action ends (and persist is called by the session factory)
Values that changed are then persisted to memcached and the database (if
turned on)
+ * Timestamps are stored to check for staleness at the begining of each
session.
+
+*READING*
+ * The session first checks that the ASP.Net session is not stale. Uses
the ASP session if the key exists and it isn't stale.
+ * If this fails then memcached is checked...values are then persisted to
the local ASP session.
+ * If memcached fails then the database is checked. Values are persisted
to both the local session and memcached.
+ * If the database fails then the key is assumed to not exist and null is
returned.
+
+== Dependencies ==
Here are a few dependencies you will need to get going:
* [http://www.castleproject.org/ Castle::Monorail]
* A [http://www.socialtext.net/memcached/index.cgi?memcached memcached]
server or servers running on your network.
@@ -26,6 +44,7 @@
* ICustomSessionFactory for CASTLE::MONORAIL
* Now has the ability to use a DB backend
* Uses a local temp hashtable to speed up access to commonly accessed
session variables.
+ * Alternatively you can pass in the local ASP.Net session for additional
speed increase. The session dictionary will automatically handle staleness
across the cluster.

== Planned Features ==
* ~~Optional DB persistence of sessions using activerecord/memcached
fusion.~~

Reply all
Reply to author
Forward
0 new messages