1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]	World Persistence, flat files v/s DB v/s ?? -->
<!--X-From-R13: ptNnzv&#45;pt.UenlEntr.Sqzbagba.OP.QO (Quevf Uenl) -->
<!--X-Date: Sun, 22 Mar 1998 18:21:06 +0000 -->
<!--X-Message-Id: 9803221732.8w2k@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Content-Type: text -->
<!--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:cg#ami-cg,GraySage.Edmonton.AB.CA">
</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="msg00818.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00820.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00868.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00822.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00819">Author</A>
&nbsp;|&nbsp;<A HREF="#00819">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00819">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>: <A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A> (Chris Gray)</LI>
<LI><em>Date</em>: Sun, 22 Mar 98 10:32:32 MST</LI>
<LI><em>>Received</em>: by ami-cg.GraySage.Edmonton.AB.CA (V1.17-beta/Amiga)  id &lt;8w2k#ami-cg,GraySage.Edmonton.AB.CA&gt;; Sun, 22 Mar 98 10:32:32 MST</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
[Ben Greear:]

:The two things I'm pondering now are binary flat files (one per object,
:a collection of objects?? I dunno) or a database.

A binary form has the distinct advantage that it is relatively easy to
replace a single entity in the file. With text files, variations in
formatting of things like numbers make that harder. If you need to save
more than one kind of thing in your file (fairly likely!), then you can:

    - have multiple files, one per type of entity
	[can be expensive in terms of file handles and space]
    - reserve portions of the file for arrays of the different entities
	[what happens if you overflow a portion, needing more space?]
    - set up means by which varying lengths and types of things can be
	interspersed in the file, and properly found and updated.
	[can get complicated]

The third choice is pretty close to writing your own DB system.

:I'm a little concerned about the performance hit on a DB, as I expect
:this game server to bring a machine to it's knees anyway...

A good non-write-through cache attached to a DB layer seems to work
pretty well. Disk I/O is not really a problem on my setup, other than
when the cache gets flushed. The fix for that is to use a separate
thread to do that, so that main server processing is not delayed. You
have to be careful to write a consistent image to the disk, however,
which may require some copying of entities if the server needs to update
them while they are already marked for flushing by the separate thread.

:Also, as a java server, I don't think I can do a select on incomming
:data.	I think a thread for every player is a bit much...any suggestions
:here?

I have just started into the socket programming stuff of the current Java
book I'm reading, but I just went and did some scanning. The technique
he suggests for a server is to create some fixed number of threads, and
re-use those threads throughout the lifetime of the server. He says that
some Java implementations do not garbage collect threads at all, so having
one per connection can result in an eventual crash due to lack of memory.
Ick. Given the lack of a 'select' or 'poll' method in Java, the choices
are quite limited. Double ick.

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


</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="00830" HREF="msg00830.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>
<li><strong><A NAME="00823" HREF="msg00823.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>
<ul compact><li><em>From:</em> Matt Chatterley &lt;matt#mpc,dyn.ml.org&gt;</li></ul>
<li><strong><A NAME="00822" HREF="msg00822.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>
<ul compact><li><em>From:</em> Greg Munt &lt;greg#uni-corn,demon.co.uk&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00818.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00820.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00868.html">Re: [MUD-Dev] Jukebox</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00822.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#00819"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00819"><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] Jukebox</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="00863" HREF="msg00863.html">Re: [MUD-Dev] Jukebox</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Mon 23 Mar 1998, 21:40 GMT
</LI>
<LI><strong><A NAME="00867" HREF="msg00867.html">Re: [MUD-Dev]  Jukebox</A></strong>, 
Vadim Tkachenko <a href="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</a>, Tue 24 Mar 1998, 02:52 GMT
</LI>
</ul>
<LI><strong><A NAME="00854" HREF="msg00854.html">Re: [MUD-Dev] Jukebox</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Mon 23 Mar 1998, 20:34 GMT
<UL>
<LI><strong><A NAME="00868" HREF="msg00868.html">Re: [MUD-Dev] Jukebox</A></strong>, 
Vadim Tkachenko <a href="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</a>, Tue 24 Mar 1998, 03:25 GMT
</LI>
</UL>
</LI>
</ul>
</LI>
<LI><strong><A NAME="00819" HREF="msg00819.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>, Sun 22 Mar 1998, 18:21 GMT
<UL>
<LI><strong><A NAME="00822" HREF="msg00822.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Sun 22 Mar 1998, 19:02 GMT
</LI>
<LI><strong><A NAME="00823" HREF="msg00823.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>, Sun 22 Mar 1998, 19:19 GMT
<UL>
<LI><strong><A NAME="00852" HREF="msg00852.html">World Persistence, flat files v/s DB v/s ??</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Mon 23 Mar 1998, 19:51 GMT
<UL>
<LI><strong><A NAME="00884" HREF="msg00884.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:23 GMT
</LI>
</UL>
</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>