0

In an application which is all ready developed and deployed data is stored in MySQL database. I want to import that data into swarm.

Reasons to import data in swarm -

1) All the data shall not be stored in blockchain because of transaction(gas) cost.

2) Decentralised storage has more advantages like fault tolerance over centralised storage.

From whatever I read and experimented I am able to store unstructured data in swarm.

My question is - 1) How shall I store structured data in ethereum swarm? 2) How shall I query structured data stored in ethereum swarm.

Link of any tutorials , blogs related to same would be helpful for me.

2

The ordinary ways of storing data in swarm are:

  • HTTP API calls
  • the FUSE module that can mount swarm as a filesystem.

HTTP is comparatively slow, so it's not so well suited for high volume of i/o. In operations like these, FUSE or a direct hack into the swarm storage stack layer is probably whay you want. You will specifically want to look at the DPA object in the swarm/storage package.

I don't know of any implementations for mysql on top of, swarm, but I wrote a simple example of how to implement a vfs for sqlite using swarm a while ago, using the swarm chunk size as the fs "block size." If it could help, have a look here:

https://github.com/nolash/swarm-demos/tree/master/sqlite-vfs

There is also a company that are working on implemention a database natively on swarm, which could give some inspiration:

https://github.com/wolkdb/swarmdb

Please also keep in mind that it is not possible to actually delete data in swarm. Depending on the constraints of your implementation (like GDPR) that might be an issue.

  • What is workaroud for data which is stored in swarm and data should be deleted if user requests so according to GDPR regulation? – Soham Lawar Apr 30 '18 at 5:17
  • I believe it's difficult to say for certain how law will apply to decentralized services, but I doubt if swarm nodes could be held responsible for deletion if users directly upload data themselves. However, if you serve as a facilitator for a user to upload data somewhere it can't be deleted, I'd imagine you could be on shaky ground if your pursuers are very aggressive. My gut feeling is that user should encrypt with secret keys, where destroying them for all practical purposes (for the time being) means that the data is gone. This is mere opinion, mind you. – lash Apr 30 '18 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.