CigTrack Day #4: Databases


For this project I chose MongoDB, which is a NO-SQL database, mainly because it fits nicely into the stack, since it’s almost the same as JSON objects inside.

I will not have to worry about merging things together and also I don’t have to worry too much about structure. Of course I can’t completely ignore it, but it’s easier to extend along the way.


var userSchema = new Schema({
    userUuid: ObjectId,
    userName: {type: String, default: "Anonymous"},
    userLevel: {type: Number, required: true, default: 1},

Furthermore I’ve chosen Mongoose.js to manage my schemas, meaning how I want the documents to be structured, that by default have none.

If you as me don’t own a white board, but love to visualise how you would structure your data more visually than in your text editor, feel free to abuse your bathroom mirror. If you have a girl/boyfriend this might impress them too 🙂


Right now I’m trying out the basic API layer and I’m posting and getting through Postman which is a REST-client for Chrome/Chromium. As a Firefox equivalent I can recommend RESTClient.

This part is not very interesting, but it needs to be done and I can ensure the API does what I want it to do, before hooking up the frontend with Angular.js.


Since I’ve never used Mongoose.js in production before, this is exciting to build. It works like a charm right now, but I will have to dig deeper into the documentation, especially for the config and test for concurrency, to see if the default connection pool will be sufficient for now.

For tomorrow I’m planning to sketch a little and preview how some of this app actually will look in the end.

Thank you for reading! If you have any comments, additions or questions, please leave them in the form below! You can also tweet them at me

If you want to read more like this, follow me on feedly or other rss readers

Leave a Reply

Your email address will not be published. Required fields are marked *