Question

I'm trying on a piece of software the uses couchdb. I'm not a coder, I don't understand how couchdb works, etc... So for that software, I wanted to use a website in php, that was built to work with mysql.

Is there a way that I can replicate the data that I need and delete those documents from couchdb, as couchdb grows a lot and fills my webspace in a flash.

For those who may know what software and what I want to do, I'm trying to get ecoinpool to work with a php frontend like simplecoin. If that fails how hard is it to get a php, already developed and working with mysql, website working with couchdb?

Thanks.

Was it helpful?

Solution

I wouldn't try to replicate or share data from CouchDB to MySQL. CouchDB has a significantly different data model than MySQL, so at best you end up with a pretty bad mismatch between data on both sides.

On the other hand, making a well-designed PHP-based website interface with CouchDB instead of MySQL shouldn't be that hard. The CouchDB REST API is pretty easy to work with, and there are plenty of libraries you can use.

OTHER TIPS

With some programming you can import that data to couchdb. It requires some effort and it is up to you to decide whether you prefer to build an importer or to reprogram your software. I myself would prefer to build an importer because otherwise you won't be able to update simplecoin ever again without breaking your adaptations.

To create an importer I would use my preferred scripting language to listen the _changes API of your couchdb database. Then for every new document I would format it into an SQL query and insert it to MySQL.

Afterwards you still would need to create some script to delete old documents on couchdb and find a way to import missing documents in case your importer stops (this will happen for sure at some point).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top