Denormalization is normal with the Firebase Database - The Firebase Database For SQL Developers #6

preview_player
Показать описание

Welcome to the sixth video in the Firebase Database for SQL Developers series!

Coming from a SQL background you likely know plenty about normalization. But come prepared to learn all about denormalization! Denormalization is the process of duplicating data in order to reduce or simplify querying. While it may be strange coming from a SQL background, it's a common practice in NoSQL databases that will make reads more performant and your life much easier.

Рекомендации по теме
Комментарии
Автор

i feel like im building a skyscraper with scissors and plastic forks, my head hurts

whiskey
Автор

it's like choosing between firebase's speed & flexibility vs sql's consistency.

moseskarunia
Автор

You are making it so hard for us... What exactly is the convenience of using JSON instead of SQL databases?

teinvanderlugt
Автор

I'm coming from the multi path update video and at the moment I don't see benefit of denormalisation, i.e. there are some benefits for data reads (less queries faster times etc..), but this comes at a cost of more data in the database + more queries to update it? It also looks like complexity of the app increases this way i.e. need to track all places where data is duplicated etc. So is there another benefit to denormalisation besides faster data fetches that I might be missing? Is it alright to use normalised data in places that don't update to often?

IljaDidDevs
Автор

the consistency part really gives you alot more work but it is how it is.

NGP-svjf
Автор

Hi since firebase run asynchronously, how do we run the nested queries and wait till both the queries have successfully completed and then return the result

shekharskamble
Автор

You do not need to keep writing JOIN QUERIES if you have all your VIEWS in your relational database -- VIEW facilitates programming + ensure Data Integrity (and Consistency). You don't "programmatically" ensure data consistency but "automate" its consistency "by design" instead.

tkooi
Автор

Why do you want to avoid querying? It seems more simple than modifying your data structure?

hojdog
Автор

This is crazy. No atomicity. No normalization. What's the point of having flexibility from not being tied to a schema, when you have to jump through all these crazy error-prone hoops just to access the data? This looks like a pure cost-cutting measure to reduce the number of queries that google has to process.

GoldenJoe
Автор

Querying in SQL is like talking in human language, why avoiding it to track and duplicate data every now and then? I hope someday Firebase can accommodate DB relational in SQL manner

boylanpardosi
Автор

What about when my view changed? Let's say I want to show events by in-person or online instead of location at the top level?

sukast
Автор

Duplicating the data seems unnatural. However, if we make peace with this approach, considering quering speed. What happens if down the road, when our database has thousands of records, we decide to add a functionality to our 'view' which require us to use a new query (for existing data but from a different perspective), do we have to create a new node again (for querying differently)? if yes, how will this new node is supposed to return old data when queried?

faisalkhurshid
Автор

First of all sorry for my english, I want to ask you the way of do this thing:
I'm developing an app that will store stores profiles, now I want to filter wich stores are opened just right now. I have stored the open and close time of every store. but I cant figure out the way of retrieve the stores that are opened right now.

Thank you, I hope you can help me.

MineryReport
Автор

Thanks for this tutorial, I've been looking everywhere for something that made sense to me :)

Trickpants
Автор

Thanks a lot its Will be very usefull for my actual Ionic app backend with firebase 😉.

yass
Автор

how can I retrieve Denormalized data? Do I use a nested object ?

Ex: the node Events have some values (name and date), and inside Events has a child called rules (rule to start, rule to register).

Events {
name: "runnig"
date: "04/20/2018"
rules {
ruleToStart: "use a sneaker"
ruleToRegister: "..."
}
}

I retrieve it like this
Events () {
string name;
string date;
Rules rules;
}

joabefernandes
Автор

Why is querying bad? I'm open to a good argument for it, but I just don't see it. With SQL and normalization, I get consistency by design, less storage required, less data being sent between server and client and while yes the processing might be a bit more intense, it is all happening server side on a search engine built for exactly that reason. The way I understand it the API runs on the client, which is likely to be a phone, or a slim laptop so even if the load I'm putting on it is smaller then what I would put on the server, the relative speed of those devices is surely going to make the performance same if not worse?

KrisRogos
Автор

Multi-path updates certainly doesn't solve all consistency issues - multiple input clients(requires slow transactions that don't really work in multiple paths), client authorization issues (can't update certain paths), client knowledge issues (where to update).
I tried to solve it with a sweeper task that periodically checks what updates clients wrote they *want* to do and then performs a single multi-path write for all relevant updates in the period with no collisions. This works okay, but means the data is not immediately available, it takes extra resources, and I'm not sure if it scales well.

ShpanMan
Автор

Thanks! Does anyone have any recommended readings/tutorials that cover this topic in a more advanced level?

yndrywjynsyn
Автор

How can i easily change one event to another location? Get the data of an event, create the same event at another location and delete the old event? (My current solution)

achtbanen
join shbcf.ru