[MUSIC PLAYING]
DAVID EAST: Hello there, everyone,
and welcome to another episode of "#AskFirebase,"
the show where we take all of your questions from YouTube,
Twitter, Stack Overflow, wherever we can find them,
and we give you answers right here.
And today, we have one of my favorite people
in the entire world, Roman Nurik.
And Roman is from Firebase UX, but he's also
one heck of a beat boxer.
ROMAN NURIK: [BEAT BOXING]
DAVID EAST: Let's answer some questions.
This first question comes from Dan on Twitter.
And Dan asks, "Is it a good idea to use cloud functions
for doing all database reads and writes?
For security reasons primarily."
So, Dan, you can use Cloud Functions to do
reads and writes in proxy to your Firestore database.
But if you're worried about security,
Firestore has its own security rules language
where you can achieve that.
And it's much easier, and it's only
dealing with one service instead of two services.
And also, with Firestore, you end up
getting that nice, awesome, real tiny nature.
So if one user updates data remotely,
it just automatically updates in your app.
And that's not something you would get with Cloud Functions.
But where I like to use Cloud Functions
is for reads when I use it with Firebase Hosting.
So Firebase Hosting, I can deploy static files
and super-low-latency CDN servers all around the world.
And if I use that in conjunction with Cloud Functions,
I can actually say, every five hours or so
I want to regenerate this file and store that response
for a certain amount of time in those edge servers.
So if that file only updates every so often,
it's really, really good, because it'll
be a super, super fast read.
Dan, great question, and thanks for asking.
ROMAN NURIK: [BEAT BOXING]
DAVID EAST: Next question.
ROMAN NURIK: So this next question
comes from David E-- wait, that's you.
David East.
DAVID EAST: Yeah, I asked my question.
Host question.
ROMAN NURIK: Host question.
So your question is, "What are the best practices for showing
data updates in my UI?
I always want to do cool animations and re-ordering,
but I'm not sure if that's too busy."
That's a really fantastic question,
because a lot of people think that, hey, real time means
that everything in my app is real time,
and it's always real time.
But I think the important thing to think about
is, what are the user journeys?
What are the different tasks that people
are trying to do in your app?
So there are going to be a lot of situations
where you're browsing through something casually,
like a social stream or whatever,
and you want things to be real time and updating,
because I'm just casually interacting with something.
But I think when the journey is I decide
to dive into a piece of content and interact with it,
I think that's a really great moment where you really
have to think about, do I still want
this to update all the time, or do I want to pause and snapshot
what the user's looking at?
A good example is actually something
we do in the Firebase console for Cloud Functions
for Firebase, where when you're looking
at the logs for Cloud Functions, they're
just constantly streaming and updating.
But if now you see a log that you're worried about,
you can actually hit the Pause button
and interact with that log, expand it, collapse it,
whatever, and also scroll down a little bit
to see if there's anything else that happened just before,
like a crash or an error.
And so that's something to keep in mind.
I think you want to be really careful about,
is this something where it's expected to be real time,
or is this a task that's expected to be paused?
And sometimes the right answer, like in functions,
is to just give the user the option to just halt
things for a moment.
DAVID EAST: If I want to affect something
that is from the structure, I should probably
give the user either more control over that,
or I should just pause from being able to not
have them chase down some div on the screen
that they're trying to click, because I keep just
moving it everywhere.
ROMAN NURIK: Yeah, that's one of the most frustrating things,
is when I expect to be interacting with something,
and then things are just changing underneath,
like underneath my finger.
The worst is-- you know those examples where you're
typing a search, and then it's doing
autocomplete in the background, and it's trying to be smart?
And then you're about to click on the thing,
but then a thing pops up, and you click on the wrong thing
accidentally?
It's super, super frustrating.
So again, you want to really avoid that.
One of the best ways to avoid it is to observe users.
And if they actually make mistakes like that,
then you know that's a situation that you
may need to rethink if it really should be updating
or if it should really be real time or not.
DAVID EAST: Great answer.
ROMAN NURIK: You heard it here first.
[LAUGHS]
I'm just kidding.
[BEAT BOXING]
Next question.
DAVID EAST: This next question comes from Patrick.
And Patrick asks, "What are some good tips for onboarding users
into your website or app?"
ROMAN NURIK: That's a really good question.
I think onboarding is one of the most
interesting and challenging problems in UX.
There's no right answer for onboarding,
and every onboarding problem you have is going
to be a little bit different.
But I think that the way in which you
do onboarding successfully is through experience and testing.
I think the number one thing you can do
is come up with a couple of different options
that you're happy with.
All these options work well.
But then using a product like A/B testing,
Firebase A/B Testing, to see which of these
is the most successful.
And I would make sure to define success
in a way that makes sense for users as well, not just
thinking about conversions, but which of these options
leads to the users being the most engaged
or doing the most things in your app after the onboard
that they want to do.
So I would definitely think about A/B testing as one way
to decide between a couple of really great onboarding
options you have.
But if you're looking for some good general tips,
I definitely say be really focused, and think about,
what are the things that the user absolutely
needs to do before they just get into the app
and start exploring?
And also just be really careful not to overcomplicate things.
Actually, what's most important, something
that is really, really important to mention, is transparency.
You also want to be really, really careful
not to do stuff behind the scenes
that the user may not expect for you to do.
I think A/B testing is really important, transparency,
and then also just staying really,
really focused in how you do onboarding.
Those are some of the best tips that I can offer.
DAVID EAST: Great question, Patrick.
[MUSIC PLAYING]
Well, that's all the questions that we have today.
Thank you all so much for sending them in.
And thank you to Roman Nurik for coming in and helping
us answer these.
And if you have any questions that you want to ask,
make sure to go on Twitter, YouTube, Stack
Overflow, my personal email-- no, not that one.
But just tag it #AskFirebase, and we will answer it
right here on this show.
So thank you all for stopping by.
If you like this, make sure to hit that thumbs up button
and to subscribe for all the brand-new content
that we have coming out.
So thank you all so much, and we will see you in the next
episode of "#AskFirebase."
ROMAN NURIK: (SINGING) Next question.
[MUSIC PLAYING]