Git Product home page Git Product logo

Comments (3)

raoulmillais avatar raoulmillais commented on September 8, 2024

If I remember right it does parse XML on some endpoints that also support JSON. This was because the structure is subtly different and we don't want to break existing consumers. A major version (1.x.x) release will happen when the client can support POST/PUT ing JSON. At that point we can use semver properly to indicate breaking changes (via a major version number bump)

from 7digital-api.

raoulmillais avatar raoulmillais commented on September 8, 2024

We've found on the 7digital.com web store, which makes ~2500 API requests per minute, that our application is heavily network bound and the CPU usage is relatively low.

That said XML parsing can become a bottleneck if making lots of concurrent requests for big documents (e.g. search with a big pagesize). We found it was a problem in one place: prefetching entire user lockers (in batches of parrallel requests) under load.

I suspect that's unlikely for a mobile application, but I'm guessing you're concerned about battery life? If you do find hotspots then you can use the technique we used to override the content type by specifying custom headers:

var api = require('7digital');
api
  .User({ headers: { Accept: 'application/json' }})
  .getLocker({ userId: userId },  console.log);

The JSON support is still very beta and subject to change - so if you do use it you run the risk of things breaking in the future. This is not so much of a problem for us as we can roll out updates quickly to our web applications, not a luxury you have on mobile. Proceed with caution :)

Hope this helps.

from 7digital-api.

PradatiusD avatar PradatiusD commented on September 8, 2024

Thanks for clarifying Raoul and for giving me the detailed explanation!
Feel free to keep this issue open or closed.

On Wed, Aug 19, 2015 at 10:41 AM, Raoul Millais [email protected]
wrote:

We've found on the 7digital.com web store http://www.7digital.com/,
which makes ~2500 API requests per minute, that our application is heavily
network bound and the CPU usage is relatively low.

That said XML parsing can become a bottleneck if making lots of concurrent
requests for big documents (e.g. search with a big pagesize). We found it
was a problem in one place: prefetching entire user lockers (in batches of
parrallel requests) under load.

I suspect that's unlikely for a mobile application, but I'm guessing
you're concerned about battery life? If you do find hotspots then you can
use the technique we used to override the content type by specifying custom
headers:

var api = require('7digital');
api
.User({ headers: { Accept: 'application/json' }})
.getLocker({ userId: userId }, console.log);

The JSON support is still very beta and subject to change - so if you do
use it you run the risk of things breaking in the future. This is not so
much of a problem for us as we can roll out updates quickly to our web
applications, not a luxury you have on mobile. Proceed with caution :)

Hope this helps.


Reply to this email directly or view it on GitHub
#74 (comment)
.

Daniel Prada
954-990-9846

from 7digital-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.