Week 5: Databases 101 & Pair Programming
“What’s new is this electronic system so that we can gather information out of those databases very quickly. Instead of going through 50 files cabinets, which we have now, we’ll be able to go through the databases.” — Dr. George Teagarden
SQL Alchemy I and II | DateTime and Web Patters | Ratings Algorithm and Data Modeling| Dark Crystal and APIs and Request Library | Testing 2
First there were ups…and then some downs
All the awesome ladies I paired with were awesome, but Erika enthusiastic energy was totally what made this week awesome. We started the week strong, confident that we would finish the machine learning portion of the project. And then, we realized that we were both confused when it came to Flask sessions.
But first, what is Flask? In the words of the ever-growing encyclopedia Wikipedia, it is “a microframework used to refer to minimalistic web application frameworks. It is contrasted with full-stack frameworks, also called enterprise frameworks.” In my words? Flask is a framework that makes it easy for Python newbies to write a web-apps from begging to end.
In Flask, there are these magical little creatures known as Flask sessions that are similar to cookies (the cookies on your browser) but are stored in a server instead of the browser. A perfect example? When you log into a website, you may enter a “session” so that during the time you are logged in you have rights to certain activities (place in that Amazon order, ya feel?) that users who are not logged in do not.
Erika and I were stumped! To our credit, this was the first time we were created a user login form and we had no idea how to start or end our session. Welcome to the world of programming! We felt demoralized during an entire morning session.
Later during lunch, I went to the CVS down the block, armed myself with chocolate and decided to kick butt for the rest of the day. After some help from our lab instructors, Erika and I were on a roll! We finished out our login form that day.
There were ups and downs, but I was so glad to have shared those moments with Erika ❤.
Is it just me or is data modeling the coolest thing ever? I love our daily homework because it’s my way of checking myself. If I am at a total loss then I know I have a lot of self-studying to do. This week though, one of our assignments was extra fun. We were asked to mock out a data model for a scenario we were given. Backtrack what? So far, we have learned how to build logic into the front-end, such as forms submitted on the web. Ever fill out a form that ask for your credit card? Yep, that’s what I’m talking about. Anyhow, we’ve built those forms, but when a user entered information that information was lost…somewhere in the ether (my guess).
Starting this week, we learned how we could capture information, both from user input, API requests, and data we find elsewhere. We also learned of a fabulous way to keep all that information stored (databases!!). Databases are made up of tables and within those tables we organize the information we capture.
Data modeling is an art, there is no one way to perfect it. I am told that engineers in senior positions are in charge of figuring out the best way to model a database. It requires a certain foresight into the future as well. You don’t want to put a bunch of information is just one table, better that items be separated in their own categories. In relational databases, queries (searches) are usually made between relations that tables share. Therefore, the simple a query can be, the faster that query result can come back to you. With small data sets the time is not noticeable, but once you’re looking at a company’s database, you’ll want to save yourself that time.
The following is a random train of though so skip to the next section if you’d like. As an SQL newbie, I was surprised by how much I enjoyed writing queries, ahh so much fun! We were introduced to SQL the week before and have been given data to seed into our database so most of the work was cut out for us. The point of the exercise was to practice our querying skills. The concept that I found both interesting and alarming was the idea of dropping tables or dropping a database. What?! The idea of saving a databases’ data via a data dump made me nervous. I save every version of a document and because I want to be prepared for the time when I might need that information (which of course, always never happens). So I leave you with this…because if you drop a table on accident without dumping your data to a file. Tsk tsk tsk.
Follow me on Instagram, for my daily coding bootcamp updates or on Medium for weekly updates!
Thanks for reading this post! If you enjoyed what you read, I’d really appreciate it if you recommend this post (by clicking the ❤ button) so other people can see it!.