December 16th, 2017

Learning MongoDB Part II: Working with Documents



+3 More

Today I'm building on my first MongoDB discovery and looking at documents in more depth. To start, let's implement Christmas tree purchases in the database. The first task is picking a tree to buy! I searched the database for a tree I liked and used the findOne() function to return a single tree.

Next I created a customer collection to hold all the people who bought trees:


December 27th, 2017

Learning MongoDB Part IV: Aggregation Framework



+3 More

For more complex queries and data manipulation in MongoDB, we can use the aggregation framework. First introduced in MongoDB V2.2 (the current version as of this writing is V3.6) the aggregation framework creates a pipeline of operations to perform on documents1. Pipelines support operations such as sorting, filtering, and grouping documents similar to a SQL GROUP BY clause. Pipelines also enable grouped data manipulation, creating entirely new collections in the process. I used the tree database from my first and second MongoDB discoveries to explore the aggregation framework.

If you remember from my previous posts, each tree has a type and a grade which specifies the height of the tree. One piece of information I'm curious about is the total number of trees in each grade with type frazier fir. The aggregation function to answer my question is written like so:


December 15th, 2017

Learning MongoDB Part I: Creating the Database



+4 More

Continuing the trend of learning more about JavaScript, today I'm looking at MongoDB. Mongo is a NoSQL database that stores data in documents. Before getting into the code, its important to question why MongoDB is used in the first place.

First lets look at some positive aspects of MongoDB. MongoDB stores its data as JSON (and internally as BSON - short for Binary JSON) which in my personal opinion is the best structure for transferable data. BSON causes the stored data to be extremely lightweight1. MongoDB is great for a full JavaScript web stack, since MongoDB uses JavaScript as its query language instead of SQL. Having simple JavaScript knowledge helps make MongoDB an easy transition. You can even use JavaScript functions and variables to perform complex queries and database updates!


December 23rd, 2017

Learning MongoDB Part III: Arrays and Nested Objects



+3 More

One of the really powerful things about a document database like MongoDB is the ability to store arrays of values in a document. Arrays can even store sub-documents, allowing for many levels of nested data.

An example use case of an array in a document database is a user with multiple addresses. In a relational database, this address information would be stored in a separate table. To get a users addresses, the addresses table would be joined with the users table. In MongoDB, a user and their addresses can be stored in one document, making data access and updates quick and easy (with no expensive JOIN operations).


December 30th, 2017

Creating a Node.js and MongoDB REST API Prototype



+11 More

Most of my discoveries lately have been about JavaScript. This includes learning the new ES6 syntax and features along with all the quirks that come with the JavaScript language. Recently I have been exploring the MongoDB database and Node.js environment. MongoDB is a NoSQL database that allows you to store JSON formatted documents in a schema-less model. I wrote four discovery posts on MongoDB starting with the basic features of the database . While I haven't written any discoveries with Node.js as the main focus, I have experimented with it when testing out ES6 modules with Babel and Async Functions.

All of this knowledge buildup is for a personal website project that I have planned (and where this blog will call home!). Before I start development on the website directly, I will create a series of prototypes to get a feel for some of the technologies I will use in my websites stack. With these prototypes I can make sure the technology I choose is a good fit for the full project. Also I can use them as templates to complete future discoveries! In general if you have the time to build prototypes with technologies you want to use in a production project it is a great idea!


March 17th, 2018

Creating a MEAN Stack Prototype



+17 More

Much of my work lately has been in preparation for a personal website that I'm going to build (and where this blog post will call home!). The website is going to contain my resume, blog posts, and more. I am really excited to get started building it!

However, the first order of business is to decide which technology stack I want to use for the website. I've narrowed it down to a full JavaScript stack, from the front-end through the database. There are two remaining tech stacks in competition: the MEAN stack (MongoDB, Express, Angular, & Node.js) and the MERN stack (MongoDB, Express, React.js & Node.js). I started my research for building the website by reading JavaScript books and writing plenty of discovery posts about them. I also explored Node.js and MongoDB in depth. I even made a blog post and prototype on both technologies! Now its time to pick between the two front end JavaScript frameworks: Angular by Google and React.js by Facebook.


July 3rd, 2021

Exploring AWS DynamoDB



+7 More

DynamoDB is a NoSQL database on AWS specializing in key-value and document storage. DynamoDB is fully managed by AWS, meaning users don't need to provision any servers for it to run on. I often compare DynamoDB to MongoDB, due to their similar functionality and JSON document/item structure.

Recently, DynamoDB has come up quite a bit in engineering conversations I've had in relation to building cloud native applications. I wrote a series of articles on MongoDB in 2017 while I was prototyping with the database. Recently I did the same with DynamoDB, creating a sample DynamoDB table with Terraform and using AWS SDKs to modify and test its contents. This article discusses what I've learned about DynamoDB and showcases my prototype code.


March 9th, 2018

What I Learned About TravisCI


Continuous Integration

+5 More

My MEAN stack prototype is the first personal project that uses Continuous Integration (CI). Continuous Integration is great and I will likely use it in all future projects.

So what is CI? Continuous Integration is the practice of merging code in development into a main repository on a regular basis. On each of these merges, testing suites and builds are executed automatically by a tool separate from the main codebase1. This allows for early detection of bugs and helps avoid the nightmare of backtracking through many commits to see where some functionality broke. With CI each time a commit is made the developer knows if any existing code broke. Of course this requires some thorough testing suites to be created (something I often cut corners on admittedly).


January 6th, 2018

Angular 5 First Impressions



+2 More

Recently I learned a few JavaScript technologies for building website backends. I looked at Node.js in the server layer and MongoDB in the database layer. Now I'm switching gears and learning some front-end JavaScript technologies. My top two picks for front-end frameworks are Angular and React.js. Today I'm beginning my journey with Angular. Through this research I will determine if its a suitable option for my website. This post won't display much code, instead focusing on my initial reactions to the framework.

Angular CLI


May 31st, 2018

React & Webpack Seed Project Part I: Building With React



+3 More

Since mid March a lot of my free time work has been dedicated to building React.js apps. In fact, I built this website in the past month and a half with the MERN stack - MongoDB, Express, React and Node.js. Before I started building this website I built a sample prototype application using two key technologies - React and Webpack. The knowledge I learned from this prototype helped jump start my work on the website. This discovery looks at the first technology used in the prototype application - React. I will look at the Webpack portion of the prototype in my next discovery post.

React is a library for generating views. A view is the UI of an application, and for a web application it is rendered HTML. In a traditional web application, the client side JavaScript code manipulates the HTML view through the Document Object Model (DOM) API. When using React on the client side, views are interacted with through a construct called the "Virtual DOM."