Scaling sections and search for SAFE sites

I have had some thoughts and not enough knowlege or understanding to know if it is relevant, so I post this in beginners section.

If we Imagine a future SAFE Network with for examaple 10 000 sections, Bob decides to upload a SAFE site called “happylife”, at about the same time Alice uploads SAFE site called “happylife”, at the same time Carl search for a SAFE site “happylife”.

Which “happylife” site will Carl reach, Bob or Alice?

When uploading a site how will that site be known to all 10 000 sections, what is the steps until it is known and how long will it take?

Would SAFE-network benefit from creating centralised decentralised SAFE-DNS sections?

Sometimes my mind start spinning, don’t know these/this questions are relevant. :slightly_smiling_face:

5 Likes

There can only ever be one site with a given NRS name. SAFE achieves this without centralising the naming system, so everyone will see the same site - first come first served.

9 Likes

Yes that sounds reasonable to some extent but could we dive a little deeper on how a site gets known across the network?

If I upload a site, a section will handle that upload. After that will that section broadcast the site to other sections?

4 Likes

Yes indeed, to look at the edge case here, Rob in Oz uploads a site safe:/fluffykitittens at 00.01 UTC to his local section, which is then propogated throughout the network. Someone in the midwest US also uploads a site also named safe://fluffykittens at 00.03 UTC to their local section.

I can see there being a real possibility of a conflict when someone in Scotland decides they need a dose of emergency kitten. Or am I wrong ? image

3 Likes

@tobbetj there’s no propagation involved. The location of a site is determined by accessing a piece of data created by the site owner and uploaded to a location which is based on the hash of the website name.

Given the website name, anyone or rather any SAFE browser can determine the address of that data, and request it. They don’t need to look ip the address up anywhere, they don’t need to get the address from a section, it is calculated on your pc from the name of the website.

So they request the data, and from that they get a list of the files of the website and can request them in turn.

It is all decentralised. This is how all data access works on the network. There’s no index, you (or your browser) requests it by asking for the data at a given address, and when you do that the network goes and gets it from whichever section holds it, and returns it to you.

The location of the data is determined from its address, so it doesn’t matter where it is, the network can find it.

How that helps.

13 Likes

Now where getting closer and I feel alot more happy. :slightly_smiling_face:

So a site creates a hash of the site name in some section. If a client want to look up the page, that client ask the network to find the location based on the hash name.

It is a little blurry for me on how the network finds the right section for a specific site.

There can’t be a conflict because there can’t be two sites with the same hash name?

5 Likes

That’s about it. I glossed over a couple of details but that’s the nub.

4 Likes

It uses the XOR addressing to find the data, be it the NRS record, or the index.html file for the site.

There can only be one

One piece of data at the address for the data.

5 Likes

But if two users register a similar NRS name (lets call it safe://fluffykittens) at roughly the same time pointing to different data, cos we all like different pussies, which NRS link takes precedence?

Which is why I have always felt a bit uncomfortable with names like safe://mynewsite etc. Of course early doors like now, thats a vanishingly small concern, but in the few days after we go live and will stay live, then it may indeed be a concern.
Or image ?

3 Likes

The first person to create the NRS name. There can only be one.

2 Likes

I know that. But what if two folk make an NRS link from different data to the same name within a small period of time such that some sections see safe://fluffykittens pointing to Tibbles and friends and other sections a long way away see that same NRS name pointing to Whiskers and her cute pals?

Will sections be so slow to recognise that link that we can safely ignore intercontinental lag times? I know we can assume that it is equally likely that we are in the same section at ~400 miles remove as we are likely to be in a section with @neo 10k miles away. Or @Sotros 4k miles away in the MidWest?
I know it is XOR distance that matters but surely we cannot totally ignore physical distance and lag time? Or can we really? In practice, not theory.

I don’t understand what you mean by link from website data to the same name.

The link goes the other way, so each name can only link to only one website.

2 Likes

I create an NRS link with
safe nrs fluffykittens --link safe://hnyynyi6si48xqwnbmzgs1ikrwh7wa3qu5qamcm59cryjps9xtsgdztd1abnc?v=0

Someone else -in a different section- possibly a long way away in XOR space but certainly a long way away in terms of lag time creates
safe nrs fluffykittens --link safe://hnyynykrwhsomethingentirelydifferenti7wa3somethingentirelydifferentiztd1abnc?v=0 within a few seconds.

Which is first? You know its the one your section saw first. But what if a user in a well-separated section saw the other one first?

It’s not about who sees what first, but about who owns the name - which is whoever creates it first.

There will only ever be one fluffykittens NRS name registered on the network. One of those commands will fail.

4 Likes

But it wont fail the first time it is used in a section or sections which are not yet aware of the
fluffykittens link that was created at 00:00:01 (Tibbles) in a far-off distant section because the only link they know of is the safe://fluffkittens created at 00:00:02 (Whiskers) in a section close to them in both XOR-space and lag time.

You still have not convinced me that there is no possibility of a conflict. I’m sorry Mark, I’m not trying to be obtuse here I’m just trying to look at edge cases. Cos there is no timestamp to “rely” on.

3 Likes

The whole thing needs group consensus to be created. This means more than 50% agree to create it, so there can only be one majority.

6 Likes

I think @Southside and @tobbetj are wondering about lag, i.e. when is group consensus created, rather than how?

1 Like

So fitting for an immortal data network.

6 Likes

Aye but initially that is 50% + of one section, which may mostly have become aware of the Whiskers site created at 00:00:02 as opposed to the far away site created shortly beforehand.
So if I understand this correctly - for a (probably brief) period of time - for some sections safe://fluffykittens resolves to Whiskers while for most other sections it resolves to Tibbles (created 00:00:01) . then the next time someone tries to access it it goes to the “correct” site? Because consensus has been reached “globally”. And the person who created the Whiskers site wonders WTF happened there, my site no longer resolves to the NRS link I just created?
Which is fair enough if that is the mechanism, I’m just trying to get my head round it and understand edge cases.

2 Likes

For me the question is more like when/how does the whole Network or a random section know that a SAFE-name is taken after it has been created in a random section of a large network.

3 Likes