[MUSIC PLAYING]
DAVID EAST: Hey, everyone.
Welcome to a brand new episode of #AskFirebase.
And today I am just super excited,
because we have the one and only Roman Nurik here
to help us answer some questions.
And Roman is in UX at Firebase, and Roman spends most
of his time every day just--
what does UX do, Roman?
ROMAN NURIK: Well, a lot of people
think of UX as they're the designers that are picking
the right shade of blue.
But UX is a lot more than that.
We do everything from looking at a given problem
that the user has and trying to figure out
how can we create a series of user
interfaces and different things that they can interact with
to help them accomplish a certain set of goals.
So figuring out how something should look,
but also, how should it work, how should it feel,
what are the different tasks or different ways
to accomplish those tasks.
A really, really big part of it is also
observing users and seeing what are the challenges that they're
facing when they try to do something,
and figuring out how can we make that better for them.
DAVID EAST: So how do I pick out what shade of blue?
ROMAN NURIK: It's a hard question to answer.
That's probably for another video.
DAVID EAST: What's the hex code, Roman?
ROMAN NURIK: 039be5, that's the Firebase blue.
It's really sad that I know that.
But I have a thing for hex codes.
I think I know a lot of hex codes.
And it kind of scares me sometimes.
DAVID EAST: Well, let's start answering some questions.
This question comes from Akashc on Twitter.
And Akashc asks, "What kind of customers
is Firebase Hosting targeting?
Since the same thing can be done on GCP."
So this is actually a really interesting question.
And for those of you who don't know,
GCP stands for Google Cloud Platform.
And Firebase Hosting is built on top of Google Cloud Platform.
But we use a lot of the pieces that pretty much you
would build anyways if you were building a hosting provider.
In this case, if you are serving lots of static files
for your website, what we do is you
deploy them out to Firebase Hosting,
and we stick them in CDN edge servers all around the world.
So if we have a user in Tokyo requesting files,
they don't have to go all the way to the United States
and send that data all the way back.
Instead, your files are stored in a little--
probably not little-- but a server in Tokyo.
And so that way the latency of returning the response
is just much, much faster.
And while Firebase Hosting is--
its core is all static files, it actually
has grown beyond that to do dynamic server code.
So if you pair it up with other GCP services,
like Cloud Functions, or recently Cloud Run--
a favorite of mine--
you can run server code, and you can actually
take the generated response.
And you can store that in the CDN cache
for a certain amount of time.
And that way you get a really big performance hit,
because you don't have to keep going back and regenerating
every single time a user hits that endpoint.
ROMAN NURIK: There's also Dynamic Links.
I think we recently launched an integration where
you can set up-- you can basically
do URL shortening on your hosting URLs,
your hosting domains.
It's pretty awesome.
DAVID EAST: I get my own custom domain URL shortening.
ROMAN NURIK: It's awesome.
It's pretty sweet.
DAVID EAST: So that's a great question, Akashc.
Thank you for asking.
Next question.
So this next question comes from me.
Host question.
And I use Firestore a lot for its offline capabilities.
And while it handles it really, really well, it actually
leaves me with a bit of this problem.
When a user goes offline, do I let
them know with the user interface, some notification
or something?
It's like, hey, you're offline.
You may not receive--
you probably won't receive updates from other people
until you go back online.
Or should I just keep it as a seamless experience
and not burden them with this whole switching of states?
ROMAN NURIK: Going offline is cool and all, handling that.
But what you really need to pay attention to
is coming back online and dealing with that
and managing that well, because going offline, that's cool.
And things-- you can mention to the user that, hey, now
you're offline.
But coming back online, that's the moment where what the user
was doing offline can kind of blow up in their face
if you don't handle that well, if you don't
save those changes correctly, if you don't
manage the merging process.
If like somebody did something while they
were offline that would conflict,
then you're really in a situation
where the user is super frustrated,
because all their stuff is lost.
So you need to be really careful.
The number one thing to think about
is don't frustrate the user.
And make sure that you don't lose their work,
because that is the worst.
How many times have you like had a file
or you're writing a paper for college or something,
and it just--
for some reason, it's all gone.
DAVID EAST: I have Git rebased before, yes.
ROMAN NURIK: Oh, my.
Yeah.
Or like if you do like RMRF or something an entire folder,
and you don't realize that really important thing is
there, it's the same thing if you're working offline,
especially if it's like for a couple of hours
or a couple of minutes or whatever.
If you do a lot of stuff and it goes away,
you need to be really careful not to lose that stuff.
So I think that it's obviously important to provide
visual feedback, just to provide some information about,
here's the current state of things.
But then when they come back online,
if there's a situation where you're
at risk of losing their information
or mangling what they did offline,
you have to be really careful to potentially give
the user options, like here are a couple of things
that you can do.
And ideally, it's not like the most common thing
that they're working on something while somebody
else is doing the same thing.
But you want to be really, really careful
to handle those cases.
So if you need to spend a bunch of engineering time
to make sure that that is really, really good
and that's handled well, then that
is time well worth whatever.
It's worth spending that time.
DAVID EAST: So make sure--
while it might not be the most common thing,
you have to handle those moments of potential frustration.
ROMAN NURIK: Yes.
DAVID EAST: And make them as just positive for the user as
possible.
ROMAN NURIK: Absolutely.
DAVID EAST: Amazing answer for an amazing question.
Roman, what's that over there?
ROMAN NURIK: Oh!
It's the next question.
DAVID EAST: This next question comes from Manya on Twitter.
And Manya asks, "Are there any plans
to have a SQL database in Firebase anytime soon?"
So Manya, there are tons of differences
between NoSQL databases, like Firestore, and SQL databases.
And I could totally go into that,
but that would be such a crazy long video.
And actually, Todd Kerpelman on the Firebase team
did an amazing video on this in his "Get to Know Cloud
Firestore" series.
So you should totally watch that.
The link is in the description.
But essentially, Firestore is a real-time database
that wants to optimize out to just huge scale, millions
of users.
And it doesn't provide certain things that--
queries that SQL provides to prevent any scaling in that.
So a lot of people want to essentially-- want
that real-time connection to their application,
but they also need to be able to do really fancy queries
and cross joins.
You know, crazy stuff like that.
And what I've seen a lot of people
do to have the best of both worlds
is they do a Cloud Function to send data
to a SQL database instance.
So like a Cloud SQL from Google Cloud Platform,
or they'll use like BigQuery, or send out of BigQuery
to do a really awesome join.
So effectively, you treat your Firestore database
as your real-time application point.
And then for any type of business purposes
or any type of querying, you can send that off
to a SQL instance.
But if you are still really in love with SQL
and you want to write SQL queries inside
of your application, you can still do that.
A Google Developer Expert named Josep Sayol wrote a JavaScript
library call FireSQL.
And FireSQL allows you to write a SQL query and a string
template.
And it will convert it behind the scenes with magic
to a Firestore query.
So you can do things like select all from here
where this is equal to this.
And there is so much more you can do with it.
So if you're interested in using that,
we will leave a link in the description to the GitHub page,
and also the NPM package.
So thank you so much, Manya, for asking.
So that is all the questions that we have time for today.
I want to thank the one and only--
are you the only?
Or is there other-- are you going to run into other--
ROMAN NURIK: There are other Romans,
but I don't know about other Roman Nuriks.
DAVID EAST: It's true.
ROMAN NURIK: In the world, I don't know.
If you're out there, please say hi.
I mean, I'd love to meet you.
DAVID EAST: Thank you to Roman Nurik for stopping by, talking
to us about amazing UX things, what color of blue
to use in our buttons.
Thank you so much.
If you like this video, make sure to give it a thumbs up.
And subscribe to all the other Firebase content
that we are going to be releasing.
So thank you all so much for stopping by.
And we will see you in the next episode of #AskFirebase.
Roman, I think you have something on the shirt.
Oh, it's a question.
[MUSIC PLAYING]