BDS Software

Database vs. Code

We're considering the situation where we have for our game a Plate Carrée map of the World divided into squares which are one degree on a side. That will give us 180 x 360 = 64,800 squares ==> 9,072,000 bytes =~ 8.65 megabytes.

And, we're asking the question, which is faster: To access these values from a database, or to calculate them in code?

Everything we do during this quest will be done on BigLinux. The first thing we have to do is establish and build the database. So, we'll go to /var/www/mysqlWork and enter the command "mysql -u root -p". After entering the root password, we'll establish mdavidjohnson as a user by doing "CREATE USER 'mdavidjohnson'@'localhost' IDENTIFIED BY '********';" where ******** stands for mdavidjohnson's password. Then, we'll give mdavidjohnson all privileges on all databases by doing "GRANT ALL ON *.* TO 'mdavidjohnson'@'localhost';" (These particular actions will be taken on VPSServer0 as well). Then, we'll sign out of mysql with "\q" on both servers, and sign back in as mdavidjohnson on BigLinux only.

We'll then create the database itself with "CREATE DATABASE EarthSphericalMapBase; Then, as a check, we'll do:


mysql> show databases;
+-----------------------+
| Database              |
+-----------------------+
| EarthSphericalMapBase |
| information_schema    |
| mysql                 |
| performance_schema    |
| sys                   |
+-----------------------+
5 rows in set (0.03 sec)

mysql>