1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] World Persistence, flat files v/s DB v/s ?? -->
<!--X-From-R13: Hnqvz Fxnpuraxb <igNserrubyq.pebpbqvyr.bet> -->
<!--X-Date: Wed, 25 Mar 1998 05:28:51 +0000 -->
<!--X-Message-Id: 351865D0.3DEEC3D7#freehold,crocodile.org -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 9803230236.8w3d@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:vt#freehold,crocodile.org">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00885.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00887.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00864.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00902.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00886">Author</A>
&nbsp;|&nbsp;<A HREF="#00886">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00886">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</LI>
<LI><em>From</em>: Vadim Tkachenko &lt;<A HREF="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</A>&gt;</LI>
<LI><em>Date</em>: Tue, 24 Mar 1998 20:02:56 -0600</LI>
<LI><em>Sender</em>: <A HREF="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Chris Gray wrote:
&gt; 
&gt; [Vadim Tkachenko:]
&gt; 
&gt; :- You strictly divide the persistence engine from the logic;
&gt; :- You build the two-tiered system with the logic as a client and the
&gt; :persistence engine as a server;
&gt; :- You build them in such a way that doesn't require them both to be
&gt; :within the same binary (address space, whatever), or build the adaptor
&gt; :which will be within and will connect to the persistence engine outside;
&gt; :- Your problem is fixed, because as soon as you finish that, you don't
&gt; :have a limitation to run those thousands of threads on the same box -
&gt; :you can spread them through several servers.
&gt; 
&gt; Some potential problems:
&gt; 
&gt;     - if multiple threads are updating the single image of the DB
&gt;         (whether those threads are local or remote), then you need some
&gt;         kind of consistency mechanism. If you use locks, then you are
&gt;         vulnerable to a client vanishing when it holds locks - you will
&gt;         have to detect that and rip the locks away.

Sure, that's why there is a concept of a business logic - client doesn't
hold any locks at all. Everything is split into transactions, and any
possible locks are handled by the business logic.

When the client dies, there are two possibilities - one, it drops the
connection, which automatically leads to the IOException and depending
on the higher-level protocol handling it's either disconnected or put
into the linkdead state. Two, it lags out, which is worse but can be
handled somehow - any comments on this case?

&gt;         This also means
&gt;         that your execution model has to be very complete with respect
&gt;         to locks,

Always :-)

&gt;         both read locks and write locks.

The single-write, multiple-read access is the usual way of handling
that. Then come the different insulation levels...

&gt;         With remotely held
&gt;         locks, you can get some *very* large latencies.

Never have the remotely held locks, then :-)

&gt;         Alternatively, you might try Chris L's lockless scheme, or some
&gt;         variant.

What is that? Can you give me a reference, please?

&gt;         In either case, information generated by a thread run often
&gt;         produces output that must go to several clients. Does each
&gt;         client know about all other clients, and so can send directly,
&gt;         or does that information have to bounce through the server?

I'd probably have a special kind of 'broadcast handler' business logic
(BL) to do that (as I mentioned before, the BL adaptors are stackable,
and there may be three ways of handling the request by the BL adaptor:

- The response is delivered by using 'return anObject' from within a BL
adaptor, which passes it down the BL chain;
- The response is thrown within the exception (I use the special kind of
exception which can hold the java.lang.Object inside), and then is being
immediately delivered as the final answer;
- If the response comes unmodified beyond the last BL in the chain, the
UnsupportedRequestException is delivered to the client.

So, going back in stack, the broadcast handler will be probably one of
the first in chain and will not increase the load on other parts of the
server.

&gt;     - threads often need a fair amount of context (mostly read-only) to run.
&gt;         Getting the up-to-date version of that to the clients can up your
&gt;         latency quite a bit. You can cache information like that on the
&gt;         clients, but see recent discussion on that for some hazards.

Can't answer this yet, the first thought is that I try to follow the MVC
paradigm, and everything on the other end of the connection is either V
or C for me, so all the data you're talking about here will probably end
up in the BLs on the server side.

&gt; Chris Gray   cg#ami-cg,GraySage.Edmonton.AB.CA

-- 
Still alive and smile stays on,
Vadim Tkachenko &lt;vt#freehold,crocodile.org&gt;
--
UNIX _is_ user friendly, he's just very picky about who his friends are

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00902" HREF="msg00902.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>
<ul compact><li><em>From:</em> "Jon A. Lambert" &lt;jlsysinc#ix,netcom.com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00833" HREF="msg00833.html">Re: [MUD-Dev]	World Persistence, flat files v/s DB v/s ??</A></STRONG>
<UL><LI><EM>From:</EM> cg#ami-cg,GraySage.Edmonton.AB.CA (Chris Gray)</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00885.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00887.html">Re: [MUD-Dev]  UML/Commercial v Free Muds</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00864.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00902.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00886"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00886"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00904" HREF="msg00904.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
Joel Dillon <a href="mailto:emily#cornholio,new.ox.ac.uk">emily#cornholio,new.ox.ac.uk</a>, Thu 26 Mar 1998, 15:52 GMT
</LI>
</ul>
</ul>
</ul>
</ul>
<LI><strong><A NAME="00830" HREF="msg00830.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 22 Mar 1998, 21:10 GMT
</LI>
<LI><strong><A NAME="00833" HREF="msg00833.html">Re: [MUD-Dev]	World Persistence, flat files v/s DB v/s ??</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Mon 23 Mar 1998, 06:54 GMT
<UL>
<LI><strong><A NAME="00864" HREF="msg00864.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Mon 23 Mar 1998, 21:42 GMT
</LI>
<LI><strong><A NAME="00886" HREF="msg00886.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
Vadim Tkachenko <a href="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</a>, Wed 25 Mar 1998, 05:28 GMT
<UL>
<LI><strong><A NAME="00902" HREF="msg00902.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Thu 26 Mar 1998, 05:03 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00836" HREF="msg00836.html">Re: [MUD-Dev]	World Persistence, flat files v/s DB v/s ??</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Mon 23 Mar 1998, 07:07 GMT
<UL>
<LI><strong><A NAME="00839" HREF="msg00839.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
Ross Nicoll <a href="mailto:jrn#st-andrews,ac.uk">jrn#st-andrews,ac.uk</a>, Mon 23 Mar 1998, 08:09 GMT
</LI>
<LI><strong><A NAME="00845" HREF="msg00845.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
Matt Chatterley <a href="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</a>, Mon 23 Mar 1998, 18:05 GMT
</LI>
</UL>
</LI>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>