Creating an API — Trial 1

Necessary background:

I am an Electronics and Telecommunications Engineer and an MBA. Not a Computer Science grad. All that I describe in the series of posts that follow is self learnt. I learnt iOS programming over the span of ~8 months stealing a few hours almost everyday after coming back from work. I was a fan of Apache-PHP-MySQL — No more! I am trying to be MEANer.

What I am doing:

I am creating an App for the iOS platform. I quickly realized that I had to design and code an API first. The App would be the easy part for the MVP (minimum viable product).

Trail 1:

I used the MAMP stack to code the API in php and MySQL on my Mac.

Since hosting locally wasn’t the greatest idea to produce a functional high-availability app, I decided to use AWS (S3 for Image/File storage, EC2 for a Linux machine with Apache HTTPD, PHP and MySQL installed) to host the API.

Problems with Trail 1:

  1. A few weeks later, I had to add/expand functionality — Adding new fields to some key entities, add new entities and link others in new ways. Using a relational database quickly became a problem to deal with. Changing anything meant modifying the Schema and PHP Code.
  2. I also realized that the API I had built, although RESTful, was open to public and devoid of any authentication. I had to make this secure to avoid malicous attacks and high to very high AWS bills.
  3. The REST API URLs were not necessarily standard. I came across this great guide to API design which addresses all the challenges I saw with my current implementation.
  4. I was using Geolocation queries to fetch relevant data from the MySQL database. The queries were complex. I also was aware of other databases that had better Geo-query support.

Taking stock of the situation, I decided to abandon the known Apache-PHP-MySQL framework and learn the MEAN stack (w/ Stormpath as the authentication component). The posts that will follow will catalog that journey.

The series of posts are primarily to:

  1. Serve as a record of my learning. I come across many cool things while learning and implementing these technologies which my twitter or Tumblr accounts won’t capture as well as I want them to.
  2. Be helpful to someone who is beginning to work, without any formal training, on these technologies.
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.