This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
blm768's profile picture

Persistent central database

Started by blm768, 27 December 2012 - 10:53 AM
blm768 #1
Posted 27 December 2012 - 11:53 AM
I've been recently thinking about the design for a ComputerCraft banking system. The main technical hurdle seems to be having a server that's always accessible throughout the world. Using something like RailCraft's World Anchors could keep the database server's chunk loaded, but then you need some sort of routing/relay system or really long redstone lines, and the connections get cut if chunks along the path are unloaded. Using a ton of World Anchors is possible but could slow the server to a crawl.

After some thought on the issue, I realized that the HTTP API could be the perfect solution for the issue. By writing a custom Web application and running it somewhere on the Minecraft server's LAN (or even on the machine itself), you can create a database system that is accessible from anywhere in the world without any sort of routing or wiring. You can even make use of a full-power relational database instead of some sort of Lua pseudo-database.

Unless anyone can think of a major flaw in the idea, I think I'll work on hacking together a prototype of the HTTP banking system. I should have semi-working code within a few days.
PixelToast #2
Posted 27 December 2012 - 12:16 PM
immibis peripherals has LAN wires wich works over unloaded chunks
blm768 #3
Posted 27 December 2012 - 01:14 PM
immibis peripherals has LAN wires wich works over unloaded chunks

True, but I'm trying for a solution that can be implemented in vanilla ComputerCraft; every time a new mod is required, the user base is cut in half. :)/>

I think that if the Web application is written the right way, it will be easier to set up than mods sometimes are; I'm planning on a simple "drop in a folder and run" system.