Week 4 at Makers was all about using databases in a web application, and specifically about using DataMapper to create a Bookmark Manager which stored and displayed a list of urls that a user had saved to the application. The structure of the project took us through a range of useful skills and tools, such as using forms to save information to a database, creating relations between the data, and allowing for user registration. I finished the week feeling like I had experienced a fast-paced tour of the key DataMapper-related concepts, with just enough time to puzzle over each to a point where I was barely comfortable with it. I did not give much thought to the fact that there was a theoretical user at the end of my application that wanted to use it.
When I completed the weekend challenge I got some way to realising why we are doing this project. Our task was to build a rudimentary replica of Twitter. After two days of thinking about this, I realised that databases are no more than a necessary tool that we use to deliver value to a person on the other end of our software. They are difficult to set up and require some abstract thought to understand, but their sole purpose is to allow information to be stored for longer than a person can attend a computer. Working on an app that bore such a close resemblance to something that brings people together, allows them to communicate and from which they get a deep level of value made it clear that this is why we studied what we did in week 4. Not because Object Oriented Databases are cool, or because working out how DataMapper relations work will keep you busy for an evening, but because if we are going to take part in building things that make people’s lives better, we have to equip ourselves with the arsenal required to do that.
This arsenal is formed in large part by understanding of the MVC (Model-View-Controller) structure of web applications. The model is formed by back-end code (in our case, ruby classes and objects), the controller dictates how those objects behave and how the navigation is structured, and the view is the interface which is rendered to the user. Databases form a layer underneath this, allowing data to persist between sessions, and allowing the application to retrieve information.
While I am still a beginner at using these ideas, I think it’s important to go forward making sure I keep in mind the big picture behind each idea I encounter in my course, and how each element ties into this picture. This might sound self-evident, but it can be easy to forget when you have spent hours trying to understand why your joins don’t work to realise that you have forgotten to run an update! We have some big projects ahead of us in the next few weeks, and I look forward to tying together all the tools I have learned to deliver something awesome.