0

In Linux one can create a symbolic link. Using the ln command you could make one path location "see" the folder content of another location.

I'd like to do the same things in firebase's Realtime Database. I'd like to take viewerPath and let it "see" the data that exists at ownerPath. I could copy the data over, but I'd need to keep doing it every time ownerPath is updated. If I could add something like a symbolic link instead this would be a more elegant and clean solution.

Is this possible in firebase? Have not managed to find a definite answer.

shapiro yaacov
  • 2,308
  • 2
  • 26
  • 39
  • 2
    Firebase consists of 18 or so products. Which specific one are you asking about? Note: I expect the answer to be "no" for all of them, but there might be different workarounds for different products. – Frank van Puffelen Nov 10 '20 at 14:51
  • @FrankvanPuffelen - Realtime Database. Also updating the question – shapiro yaacov Nov 10 '20 at 18:47

1 Answers1

1

In most databases what you're describing would be a managed foreign key. Nothing similar exists in Realtime Database however. While you can (and often will) store the key of one node as the value somewhere else, Firebase won't know anything about the meaning of such values - and not do anything with them.

Duplicating data is extremely common in NoSQL databases, so I highly recommend embracing it. Once you do, you can start looking at how to then manage the duplicated data, for example by letting Cloud Functions take care of updating the duplicates.

Also see:

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Thanks for the answer! I was hoping to use this in conjunction with the Realtime Database rules, but I'll just go the route of handling data duplication when necessary. – shapiro yaacov Nov 11 '20 at 07:32