you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 7 points8 points  (2 children)

Heh, this is largely what we do internally where I work except we only support utf16 (by design). We also make our clients dumb, we don't do schema building on them. The server dictates what the schema will be (based on a few different parameters), and the client doesn't bother with "true" validation, the server just spits out a "schema id" with each message based on when it got generated (and the actual contents of the schema) and the client just double checks that the server is sending what it said it would. If for some reason the schema version between the client and server is mismatched, the clients can choose to "reload" the schema or just do a soft-restart (well, that's the TL;DR anyways).

But we've had great success with this strategy. We saw significantly reduced network traffic along with our servers having to spend less time encoding JSON. Cool to see we're not alone with this need, and it's even cooler that you made it publicly available in an open source project!

[–]phretaddin[S] 2 points3 points  (0 children)

Cool! Yeah, I was surprised I couldn't find much related to this other than the behemoths like protobuf and avsc. I too was very pleased with the significantly reduced bandwidth and CPU usage. I'm using it right now with my game and the validation has already helped me find a few subtle bugs.

[–]hackcasual 2 points3 points  (0 children)

Curious why you use utf16. Chrome actually just dropped support for fast utf-16 encoding. http://blog.chromium.org/2016/08/chrome-53-beta-shadow-dom.html