- [Instructor] Let's talk for a minute
about database observables.
Real-time data.
Not too long ago this was impressive,
cutting-edge technology.
Nowadays it's become standard, expected.
But how does this affect databases?
Well, before real-time updates,
databases were just sitting there
holding the data and waiting for a query to come in.
When it received a query it would gather up all the data
and return results and then go back to waiting.
Nowadays, we don't want our databases
to sit around passively waiting for a query.
We want our databases to notify us
anytime something has changed.
And now that this behavior has become standard,
we're changing the way we interact with databases.
We can still query the database
just like we always did,
but now we can also listen for updates.
This is actually great because not that long ago,
if we wanted real-time updates,
the only way to achieve that was to keep
pinging the database over and over
and then look for changes.
Now we can just sit back and listen,
which really reduces the amount
of unnecessary traffic on the network.
Just one more thing.
As technology evolves, we get new buzz words.
Now that we're listening for dynamic data,
we refer to this as a data stream.
According to Wikipedia,
a stream is a sequence of data elements
made available over time.
A stream can be thought of as items on a conveyor belt
being processed one at a time
rather than in large batches.
Remember the marble diagrams we talked about
in the last video?
Okay, marble diagrams, data streams, same same.
Each new update is an event,
usually carrying with it some new data
also known as a payload.
For the rest of this course,
I want you to visualize your data
as a stream of events or updates.
Okay, now we understand the basics
of asynchronous JavaScript and reactive programming.
We've learned about the evolution
from callbacks to promises to observables.
We've learned about data as a stream.
Now I bet you're ready to dive into some code.
Yes?
Okay, let's get started.