Like Jeff said, PB is going to get you a performance boost across the wire 
since you're sending less data. You introduce a dependency on a ProtocolBuffers 
library, but you'd have that anyway in most languages when using JSON.

The main benefit of JSON are that you can write JavaScript MR jobs without 
introducing an extra dependency.

In the end, I think Jeff makes the better suggestion: treat each communication 
in isolation. Communicate between the web server and the client in the best way 
possible and communicate between the web server and Riak in the most efficient 
way possible. 

Ultimately, though, do what makes sense for your team. I hate to give you vague 
advice, but do what makes sense now and then optimize when it becomes a 
problem. 
---
Jeremiah Peschka - Founder, Brent Ozar PLF, LLC
Microsoft SQL Server MVP

On Nov 17, 2011, at 6:28 AM, Jeff Kirkell wrote:

> You have a couple options. Using PB requires encoding the data for the trip 
> to Riak and decoding when pulling data out. You could use the AJAX call from 
> the client to call the server. The server then pulls does the encode/decode 
> piece and abstracts Riak much like normal web applications do. The major 
> difference in the approach between PB and not is the encode that is done and 
> the performance gains. You always want to put the server as the intercept 
> between the client and Riak because there is no inherent security like you 
> are used to in RDBMS.
> 
> When I am trying to get stuff prototyped, I tend to stick with JSON because 
> it is less work then add the encode and PB piece if and when I need the 
> performance.
> 
> Jeff
> 
> On Thursday, November 17, 2011, curiosity <[email protected]> wrote:
> > We are planning to design a website with Riak backend. Since website will
> > have AJAX calls to save/display data, we can send only JSON data from server
> > to browser client, but website will also have binary data(images, audio,
> > video) etc. related to component objects.
> >
> > Our solution for now is to save all data in PB format, but sending data to
> > AJAX calls convert data from PB to JSON, but for RPC calls send data in PB
> > format. Is this good solution? Or any suggestions to save data?
> >
> > Thanks
> >
> > --
> > View this message in context: 
> > http://riak-users.197444.n3.nabble.com/JSON-PB-tp3515064p3515064.html
> > Sent from the Riak Users mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > riak-users mailing list
> > [email protected]
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> > _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to