RESTBase

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page RESTBase and the translation is 100% complete.

Other languages:
English • ‎polski • ‎português • ‎português do Brasil • ‎українська • ‎العربية • ‎中文 • ‎日本語 • ‎한국어
Restbase request flow.svg

RESTBase是缓存/存储API代理后端维基媒体REST API。 它的配置基于Swagger规范,其主存储后端使用Cassandra。 它支持rest_v1可视化编辑群使用的维基媒体REST内容API来检索页面HTML以进行编辑。 对于性能(T95229),每个维基上也提供服务端点,例如[$ url 此维基上的]。

作为代理,RESTBase本身不执行任何重要的内容处理。 相反,它在需要时请求来自后端服务的内容转换,并且通常(取决于配置)将其存储回来供以后检索。 对于高容量静态端点,大多数请求将直接从存储中满足。

Its storage backends expose a RESTful storage API similar to Amazon DynamoDB and Google DataStore. The primary implementation uses Apache Cassandra. Notable features include automatically maintained secondary indexes and some lightweight transaction support. A SQLite backend has been developed and is the default backend in the package.

RESTBase automatically emits statsd metrics about all storage and backend requests. This provides a good baseline level of performance and error instrumentation in a micro-service architecture.

Use cases

Our first use case is speeding up VisualEditor by reducing HTML size, and eliminating Varnish cache misses. RESTBase stores Parsoid metadata separately from the HTML of the page, which reduces the size of the latter by about 40%. RESTBase provides only this HTML to VE, which reduces network transfer and processing latency significantly. In the longer term, we are aiming to bring down the size of the HTML to that of current PHP parser output to make it suitable for regular page views. This has the potential to make switching to visual editing instantaneous and free of any scrolling.

If parse time is not a pressing concern for your wiki (for example it does not have complex templates or large transclusion counts), then accessing Parsoid directly may make more sense than introducing a dependency on RESTBase.

Another use case we are strongly interested in is providing a section-level editing API for micro-contributions and extremely fast VisualEditor saves, even faster than wikitext.

Documentation

Installation

See also

References