SQL Database and Cache Server


It is a .net cache and sql database server designed for raspberry pi and other low memory computers. It can also be configured through configuration file to run on high capacity servers and other computers with higher memory without any restrictions. It contains built-in security against sql injection on "system" database to protect database and cache server. It is designed to upgrade the embedded database, as simple as copy pasting it to appropriate database directory on the server.

The server program requires .Net on windows and mono on Linux to run properly. On Raspberry pi use the following commands which can also be used on other Debian based Linux installations. Server require mono-complete , if you have mono-runtime installed, you will still need mono-complete. The minimum requirement is .Net 4.5 or Mono 4.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mono-complete

Note: You can skip the first two lines if you do not wish to update or upgrade, update will get the information about the latest versions of packages. Upgrade will upgrade the existing packages already installed.

Download Server : ZIP Format - TAR Format (Note: downloads contain executable .exe files, your browser or anti virus software may not permit you to download them, try github clone of .Net Client which also contain server binaries in .zip and .tar format. )

Download Client : .Net Client on Github.com - Java Client on Github.com

When first time executed a new database is created under the name of SQLDatabase.Net.Server.db the path and file name can be changed through configuration file: SQLDatabase.Net.Server.Config.xml Directory where database exe (SQLDatabase.Net.Server.exe) resides must have read write permissions. e.g. if the exe resides in SQLDatabaseAndCacheServer directory use sudo chmod 777 SQLDatabaseAndCacheServer To start the server program browse the directory SQLDatabaseAndCacheServer and use the below command.

sudo mono SQLDatabase.Net.Server.exe 

Steps:

  1. Install Mono
  2. Download the Server program
  3. Set permission on the extracted folder
  4. Execute the program exe

Note: To stop the server press Control and C , also known as Ctrl+C

To troubleshoot use the following command line arguments

sudo mono SQLDatabase.Net.Server.exe OutPutToScreen

OR 

sudo mono SQLDatabase.Net.Server.exe OutPutToScreen Debug

The combination of OutPutToScreen and Debug provides detailed information about what is happening during execution.

Automtically start when operating system loads

Use RC.LOCAL file to start the server each time linux or raspberry pi starts, more information about rc.local can be found here: rc.local

First open rc.local in editor of your choice or in nano, on raspberry pi use the following command:

sudo nano /etc/rc.local

Then add the following at the end of rc.local file. Place the commands before the exit 0 , first line changes the current directory second starts the server process. You must use "&" ampersand sign also known as "and sign" at the end to start the Server process, for more information read linux documentation.

cd /home/pi/Desktop/SQLDatabaseAndCacheServer
sudo mono SQLDatabase.Net.Server.exe &