GSoC 2015 : Week 3

This post is regarding the work done in the third week of the GSoC coding period. To know more details about the project follow the Introduction link.

This week I worked on implementing the replicate changes phase. Here the main challenge was to deal with the multipart/mixed responses from the Couchdb. Unlike any of the previous responses that I have dealt with, this is not a JSON data. So I wrote a basic parser myself which seems to be working.  I may need to improve upon it after I take a look at how one of the members of PouchDB community did that in JavaScript. After I completed the basic steps of the phase, I ran the completed replicator for the first time and WOAH..! , I was able to replicate multiple documents with image and text attachments. It felt good.. 😛

Now I will be improving the way the multipart data is being handled. For lesser memory footprint, I need to handle the data as a  stream where I can process it line by line, as we don’t want to hang our system by storing say a whole 10 GB attachment in the memory. Yield has been introduced in PHP 5.5 and I think it will ease my task to handle data line by line. This along with writing tests and documentation of all the changes made to the couchdb-client project will be the major work for the coming week.

Leave a comment