Another notice regarding this: for efficiency causes, and to eliminate race conditions whenever preserving nodes

we deferred the specific processing off to Drupal’s queue program. That neatly stopped race ailments around opening nodes during node conserve and stored the consumer software smooth and receptive.

There was one other prerequisite: Because arriving data was typically incomplete we wanted to furthermore import facts from Regarding we built a two coating program: you’re a generic PHP plan making use of the Guzzle collection that expressed Rotten Tomatoes articles as PHP things, even though the more subsequently links that program to produce Drupal nodes populated from Rotten Tomatoes information. We after that matched up Rotten Tomatoes videos and product reviews making use of the customer’s provider data and allowed editors to choose to make use of information from Rotten Tomatoes in favor of their own in which appropriate. That facts was actually combined in during the indexing procedure nicely, so when data is in Elasticsearch it does not matter where it came from. We furthermore exposed Critic Evaluations to Elasticsearch aswell in order that client applications could see product reviews of flicks and user score before buying.

Incoming needs from clients applications never ever struck Drupal. They only actually hit the Silex application server.

The Silex software does not need to-do a lot. For cable format we chosen the Hypertext program vocabulary, or HAL. HAL was an easy to use JSON-based hypermedia style employed by Drupal 8, Zend Appagility, among others, and it is an IETF draft requirements. It enjoys a very sturdy PHP collection available that we were able to make use of. Since Elasticsearch currently storage and comes back JSON it absolutely was unimportant to map stuff from Elasticsearch into HAL. The heavy lifting is only in deriving and attaching the right hypermedia website links and embedded principles. Key phrase as well as other look questions had been just passed away through to Elasticsearch together with success accustomed weight the best information.

Eventually, we wrapped the HAL object up in Symfony’s responses item, arranged our very own HTTP caching variables and ETags, and delivered the content coming.

A huge benefit of the split-architecture is that rotating up a brand new Silex case try trivial. There is absolutely no significant configuration beyond identifying the Elasticsearch machine to utilize, and the majority of rule is actually heaved down via Composer. Which means spinning up multiple cases of the API host for redundancy, high-availability, or abilities was which has no services. We don’t need certainly to stress, however; the API try read-only, so with correct use of HTTP headers and an elementary Varnish server facing it the API was amazingly snappy.

The Upshot

A big section of Drupal’s maturity as a CMS is recognizing it isn’t the be-all end-all response to all issues.

For Ooyala and its particular people, Drupal had been just the thing for controlling material, not for offering a web API. Happily, Palantir’s familiarity with the coming Drupal 8 launch and its own dependence regarding the Symfony pipeline permit us to set Drupal with Silex – and that’s great for providing a Web API not everything hot for controlling and curating material. Ultimately, Palantir chose the right software for the job, in addition to task gained out of this considerably.

Ooyala now has a sturdy and trustworthy API which in a position to serve clients programs we never even handled ourselves; Ooyala’s people see what they need; end users have a quick and responsive Web solution powering their news solutions. And also, Palantir encountered the possibility to get our very own fingers dirty with another person in the Symfony family members – a financial investment which will pay back lasting with Drupal 8 and also the expanding rise in popularity of Symfony in the PHP environment.

An excellent option for Ooyala; ideal for Palantir; an excellent option for town.

Image by Todd Lappin “Above Suburbia” under CC BY-NC 2.0, changed with greeen overlay together with connection of arrows.