Periodic Table

This was a project I started whilst completing A-level physics, it took a long time to finish but I got there in the end!

The project encompasses a lot of technology, I originally started out planning to store all of the data in a MySQL database, and return it via ajax with PHP. The problem with this was that it was often not as fast as I needed it to be - the transition time for an element to show is around 0.5 seconds, so it needed to preferably be less than this.

I managed to solve this by parsing the MySQL database into static json files with PHP, so instead of hitting the database everytime that an element was clicked, the JavaScript requests the json file corresponding to the elements Atomic number, e.g. http://periodic-table.co/element/1.json is Hydrogen and http://periodic-table.co/element/1.json is Helium. Doing this allowed me to ensure that the data would return in a short enough time period, whilst using a storage medium (MySQL) that I am comfortable with. It was also a good chance for me to learn about file creation utilisng PHP

Long term I plan to change the database to NoSQL and create an API that allows you to query for elements using more than their atomic number.

I also opted not to use jQuery for performance reasons, it was a little difficult to do this, but I think I learnt quite a lot in the process. I think it's easy to forget how much JavaScript has progressed in the past few years.