<span style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">Hello all,</span><br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px"><br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px"><span style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">I have a question about Mercurial's internals.  I'm interested in using Mercurial as a database backend for a peer-to-peer application.  One of the main challenges I see with this is maintaining efficiency with hundreds of thousands of records.  Logically each database "record" should be a versioned file in the repository.  However, storing 100k+ files is a really inefficient use of the disk, especially if the records are small.</span><br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">
<br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px"><span style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">What I wonder is, how difficult would it be to modify Mercurial to store the files in, for example, a SQLite database?  Not the revlog mind you, that would stay as-is.  I'm just talking about the working copy of each file.  Is the Mercurial code base tightly coupled with the file system or is it's interface with file system nicely factored into a few key functions/classes?</span><br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">
<br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px"><span style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">I would only need to support the essential mercurial functions like: add, remove, commit, revert, push, pull, update, merge, and log.</span><br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">
<br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px"><span style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">Any thoughts?</span><br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px"><br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">
<span style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">Thanks!</span><br style="font-family:Tahoma,Verdana,sans-serif;font-size:13px"><span style="font-family:Tahoma,Verdana,sans-serif;font-size:13px">- Adam B.</span>