Issues With Back-end Component Coordination



Hey Guys! As you all know I've been working on a special multi platform project and I'm currently working on the iOS portion of it's development. I've made several changes to the back-end thus far. Originally, the plan was to use MySQL database, which then changed to using MongoDB, due to it being easy to scale and easy to use. I had set everything up using RESTful API, including node.js, express, and mongoose. In order to easily make http requests to/from the database, I used Cocoa Rest Client. This client has a simple user interface that made it easy to create and retrieve the JSON entries for my MongoDB. I needed to host the server locally so I also used a tunnel, ngrok. This was to allow me to connect my iOS application to my local server. This service give me a free random URL that can be used inside my app, which will reroute the connection to my local server.

There were many layers involved in my iOS application, which made debugging the network issues very difficult. Whenever I would fix one issue, another would pop up. The code itself also didn't look as neat as I would prefer. These issues were taking up more time than I wanted, so I decided to switch to using only Core Data. This is the native iOS database. I would not need any other layers in my code to implement this and it makes debugging infinitely simpler. At this point, this seems like the best solution.

I plan on using MongoDB in the future if I have more intensive server demands with either this app or a future app project. I really like it, but there were just too many separate foreign systems that needed to coordinate to run smoothly in my current project. This was the most frustrating issue of this past week, but I learned a lot more about JSON decoding/encoding, network requests, and persistence in Swift 4.


*Note: I'm not affiliated with any of the companies or services mentioned in this post. This is all my own opinion.

Comments

Popular Posts