Transcript of the tutorial.
TOP
All right then.
So sometimes when we create websites, we're going to be working with some kind of data.
Now, that data could be blog posts, comments to do's, user information, or some other kind of data
entirely.
And a lot of the time we need to store that data somewhere so we can use it later on.
For example, a blog site would need to store all the blog posts somewhere so that every time the site
is loaded, it can retrieve those blog posts and show them on the homepage.
So to store this kind of data, we're going to need to work with a database.
The database won't be stored on our own computer anywhere.
It's going to live on some other server out there on the Internet.
But don't worry, we won't be getting bogged down with server side code or configuration.
We'll be communicating with a free hosted database directly from our JavaScript code in the browser,
and that database is called Firebase provided to us for free by Google.
Now there's two main types of databases we can use with our websites, either SQL databases or NoSQL
databases.
SQL databases use tables, rows and columns to store data, and they're very popular when it comes to
working with things like PHP.
So NoSQL databases, they don't use tables.
Instead they use collections, documents and properties.
And this works very well with the JavaScript language.
Therefore, in this course and in this chapter, we're going to be working with a NoSQL database in
particular.
Like I said, we'll be working with a NoSQL database called Firebase Firestore.
So typically a NoSQL database at a glance looks like this.
First of all, we have a database instance which is like a container for all of our data.
And inside that database we can have multiple different collections, and each of those collections
would represent a particular type of data.
For example, A to collection would store todos, a blog collection would store blogs, etcetera.
And we can have as many different collections for different types of data as we like.
Now, inside each collection would be a bunch of different documents and each document would represent
a single record of data.
For example, a document in the blogs collection would represent a single blog, and all the documents
here have a unique ID associated with them.
And if we looked inside a document, it would look a lot like a JavaScript object.
It would have several key value pairs like this.
And again, we're not limited to how many different key value pairs we want on a single document.
So our NoSQL databases are going to be structured in this very fashion with collections of documents
and each document looking very much like a JavaScript object.
So in this chapter we'll be looking at a NoSQL database called Firebase Firestore, and I'll be showing
you how to save, retrieve and delete data from that database.