Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Item

Notes

The Next API Lead…

dun dun dun

  • Josh is graduating next semester

  • Reach out to Josh if you’re even a bit interested

    • Involves some one-on-one mentoring about running the API and API team

Overview

  • Relational databases. Eg. SQL

    • This is most of what you learn at UTD

    • Fairly rigid data structure, strict adherence to column-based schemas

  • Document databases

    • Both have been around, but this is more modern

    • Stored in basically JSON

    • Still have primary and foreign keys but it’s less of a focus

    • Looser data structure, can still support schemas but more adaptable

Diving in

  • Looking at MongoDB Go Driver and the mongo Go package

  • MongoDB Compass app helps visualize the database

  • Structure: multiple databases with collections (folders)

    • In this case the folders are courses, degrees, exams, professors, and sections

  • Working with course collection

    • Find method: find items in collection based on query

      • uses filters can use bson.D or bson.M (documentation): what to find by

      • uses supports various options such as optionLimit: defined in configs, mainly used to Limit results. supports pagination with Skip

    • Cursor: iterate over stream of documents

      • kind of works like reading a file: you can decode it all at once, or document by document

      • has various options to set such as setting MongoDB server timeout, find

      • can allow finding errors in specific documents while salvaging the rest

      • most importantly allows for continuous streaming of documents

  • Object IDs are auto generated by MongoDB but can be customized

  • More specific queries return less data and allow the more efficient database server to do the work for you

  • Aggregations let you set up data pipelines and can produce queryable collections like regular collections

...