Questions about SN

I read Primer twice with very great fun.
For Digital Bearer Certificates, Elder is the weakest point, but I think it seems to work well. As I read this, I noticed a lot of surprising things.

However I’m asking because I have some questions.

  1. In the case of a simple web page, a DB can be not required, but Dapps such as exchanges seem to require the DB, but SN does not seem to provide a DB. So, is SN’s purpose to provide a simple web page? Or can you build an exchange in SN?

  2. There are 3 types of data in SN. Map, Sequence and Blob. I am curious about the purpose of the Map. First of all, the map seems to be intended to manage multiple chunks from one data. What is the map mainly used for?

  3. I wonder if there is any limit to uploading data on the website. It is written in the Primer that Blob has a limit of 5MB.

Thx…

15 Likes

SN can store data (closer to object storage than a database). The question becomes a bit like, can we use pure data storage to do database tasks or exchange tasks? In some sense yes, we can generate an index and store the index on SN, but in other ways no, we can’t request the network to do a SQL query for us and only return a subset of data, we must do that ourselves.

Similar with an exchange, we can do the data parts (storing orders and transactions) but the execution of that will have to be negotiated between clients, not by nodes.

Possibly SOLID and SPARQL might help here, but I feel in the early stages of the network most of the data processing will be done locally and not by SN nodes. Others here may have deeper insights to add.

The map is a key:value store, in javascript it’s like this type of array: {}

A sequence is a list of values, in javascript it’s like this type of array: []

But it’s hard to find examples of where map is really used, the best I could see is sn_api/wallet.rs but hopefully someone else can shed more light here.

Let’s clarify some terminology first; a file is split into multiple chunks before being uploaded. The term file is different to the term chunk. Just to be sure we’re not confusing the terms. Also blob is just a more general term for a file (maybe the bytes don’t live on disk as a file so we use the term blob).

File size will have no limit on the live network, but is currently limited to 1 GiB, see self_encryption/lib.rs:MAX_FILE_SIZE, ie 1024×1024×1024 bytes.

A file is split into 1 MiB chunks by self_encryption, see self_encryption/lib.rs:MAX_CHUNK_SIZE, which is 1024×1024 bytes.

There’s a node limit on chunk size of 1 MB, see sn_node/capacity:MAX_CHUNK_SIZE which is 1,000,000 bytes. Not 1 MiB…?!

But 5 MB, no, there is no limit of 5 MB in the network that I’m aware of. Can you please let us know where this is in the primer, I could not see it there.

Not exactly a crystal clear answer to all questions, but hopefully a good start and someone more knowledgeable can chip in with further details.

22 Likes

@mav , I am very grateful for your very kind reply.
Also, your reply has widened my understanding of SN.

And I found out that ‘5MB’ in my writings was written incorrectly.
The primer says: “A single Blob is limited to 1 MB”. So your description is correct.

Once again, thank you for your warm response.

10 Likes

If so, the primer is incorrect. A blob is limited to 1GiB and a chunk to 1 MiB or 1 MB (depending on source as mentioned by @mav).

The confusion comes from ancient times when the two terms could be used interchangeably. But now the definitions are clear: a blob is split into several chunks.

6 Likes

@tfa, Thanks for the accurate information.

1 Like

@JPL Maybe a Primer error.

2 Likes

OK thanks - can someone from MaidSafe clarify?

I am not up on the blob terminology but there should be no limit on file sizes only chunk sizes (1Mb)

9 Likes