There will be (actually, there is already) a web API offering the kind of
data required, and for client wikis not running on WMF infrastructure this
will eventually be the way to access the data.
For WMF clients, like the Wikipedias, our decision was not to use HTTP web
requests, but to internally get the data directly from the respective DB.
This was deemed the deciding factor wrt performance: internal DB queries vs
HTTP requests.
The cost of serializing to and from JSON was not deemed relevant, as you
argue for.
This sums up my understanding of the situation, I might easily be wrong.
Cheers,
Denny
2013/2/5 Gabriel Wicke <gwicke(a)wikimedia.org>
On 02/05/2013 02:35 AM, Jens Ohlig wrote:
I'm
wondering if some of the specialized functionality can be avoided by
fetching JSON data from wikibase / wikidata through a web API. This
would be more versatile, and could be used by alternative templating
systems.
This was actually my first idea! However, since the client (i.e.
Wikipedia) currently must have access to the database at the repo (i.e.
Wikidata) anyway, this would result in a huge performance loss without
any obvious gain.
Jens,
I am not so sure about the potential performance loss. I am guessing
that you fear the overheads of JSON serialization, which tends to be
relatively low with current libraries. Moving or accessing PHP objects
to/from Lua involves some overheads too, which is avoided when directly
decoding in Lua.
Apart from making the data generally available, using a web API means
that the execution can be parallelized / distributed and potentially
cached. It also tends to lead to narrow interfaces with explicit
handling of state. Is direct DB access just needed because an API is
missing, or are there technical issues that are hard to handle in a web
API?
Adding specialized Wikidata methods to Lua has a cost for users and
developers. Users probably need to learn larger and less general APIs.
Developers need to continue to support these methods once the content is
there, which can be difficult if the specialized methods don't cleanly
map to a future web API.
Gabriel
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
--
Project director Wikidata
Wikimedia Deutschland e.V. | Obentrautstr. 72 | 10963 Berlin
Tel. +49-30-219 158 26-0 |
http://wikimedia.de
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für
Körperschaften I Berlin, Steuernummer 27/681/51985.