I’m looking to do a side project soon and was thinking to utilize a NoSQL store instead of SQL in order to get some hands-on experience with it before the SAFE network goes live. I have a couple of questions:
What current NoSQL DB is most similar to what the SAFE network API will be? I was learning Redis before, but it does have some fairly complex functionality that SAFE won’t have, like lists, sets, hashes, etc.
Are there any guides/books/tutorials you could recommend that helps web developers transition from SQL to NoSQL as the primary data store? Redis has a very nice tutorial here that helped clarify things, but perhaps there’s something more comprehensive out there that you know of.
I would say reddis will offer easiest playground if you like. Much simpler than hadoop or cassandra so yes reddis is a great choice here.
Thanks David. I rather enjoyed the Redis tutorial so I’m pretty happy to play with it.
I’m trying to keep in mind how exactly SAFE will be different. Will SAFE be a strict key → string value store only, no other value types allowed? I’m trying to get a clear picture of how a store for an application will be made.
Let’s say I’m making SafeX and I want to show a page that lists all available buy orders. Would the db look something like this?
orders:8333 → 5-safecoins;0.01btc;user:920
orders:9938 → 4-safecoins;0.02btc;user:194
user:194 → Bob
user:920 → Alice
available-orders → 8333,9938,(big list here)
My understanding is that I will grab the available-orders value, which will serve as the big list of available orders, and then make separate API calls for each specific order and user.
How far off am I?
At the moment there are strict data types. These are defined in the vault code, the version manager/StructuredData allows key value mapping of data at the moment. I do need to go into this much more but we are at a purely blistering pace right now in some detail of the implementaiton so my head is not so much in this.
My aim is you can define any data types you wish including computation. At the moment all types will be simplified. So you will get a system like this
1: Take your data and store via the chunk interface
2: You will then know the hashes of the data (of any type you wish)
3: Keep your mapping in a client side store (like a file)
4: Your client app then will be responsible for the mapping
This will improve dramatically but honestly I am just really working at full speed with commits last week and next so I can spend time soon. If you ask again when testnet3 is up then these advanced features can get more attention for sure.
Gotcha. Would you say my overall structure I mentioned about SafeX is correct, though?
What do you mean by a computation data type?
Not a computation data type as such, but ability to use semantically stored information that can be queried in a decentralised fashion and queried using map-reduce type algorithms across the network. This will be added to the ability to handle small computations per node using zk-snark type tech to ensure ‘halting (or more accurately lack of)’ is not an issue but using group consensus as opposed to snark validation of computation. Reason we will use snark is only non halting issue, the group consensus then takes care of the environment issues that zk-snarks are not good at (OK you run the code but can I be sure of your environment, was that really a real blockchain or similar you wrote to etc.).
This mix is potentially very powerful and allows the post Google type intelligence, so not searching but asking questions and getting answers via all of humanities information. a real goal of mine.
Sorry for my very fast messy answers
A Redis DB can’t be larger than RAM, so watch the size of that big list (and other key/value pairs you plan to store in Redis).