Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not sure if you are looking for specific implementation details, or more conceptual ideas about how to handle but I'll throw some ideas out there for now. </p> <p><strong>Actual Trie Classes</strong> - Here is a good <a href="http://code.google.com/p/typocalypse/source/browse/#hg/Trie" rel="nofollow">C# example of classes for setting up a Trie</a>. It sounds like you already have this part figured out.</p> <p><strong>Storing</strong>: I would persist the trie data to XML unless you are already using a database and have some need to have it in a dbms. The XML will be simple to work with in the MVC application and you don't need to worry about database connectivity issues, or the added cost of a database. I would also have two versions of the trie data on the server, a production copy and a production support copy, the second for which your admin can perform transactions against.</p> <p><strong>Loading</strong> In your admin module of the application, you may implement a feature for loading the trie data into memory, the frequency of data loading depends on your application needs. It could be scheduled or available as a manual function. Like in wordpress sites, if a user should access it while updating they would receive a message that the site is undergoing maintenance. You may choose to load into memory on demand only, and keep the trie loaded at all times except for if problems occurred.</p> <p><strong>Updating</strong> - I'd have a second database (or XML file) that is used for applying updates. The method of applying updates to production would depend partially on the frequency, quantity, and time of updates. One safe method might be to store transactions entered by the admin. For example:</p> <ul> <li>trie.put("John", 112);</li> <li>trie.put("Doe", 222);</li> <li>trie.Remove("John");</li> </ul> <p>Then apply these transactions to your production data as needed via an admin function. If needed put your site into "maint" mode. If the updates are few and fast you may be able to code the site so that it will hold all work until transactions are processed, a user might have to wait a few milliseconds longer for a result but you wouldn't have to worry about mutating data issues.</p> <p>This is pretty vague but just throwing some ideas out there... if you provide comments I'll try to give more.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload