we deferred the handling to Drupal’s waiting line program. That neatly avoided race conditions around accessing nodes during node save and stored an individual screen rapid and responsive.
There is an added necessity: Because inbound data ended up being typically incomplete we must in addition import information from RottenTomatoes.com. For this we developed a two covering system: a person is a common PHP package utilizing the Guzzle collection that indicated Rotten Tomatoes material as PHP objects, even though the some other subsequently bridges that program to generate Drupal nodes inhabited from Rotten Tomatoes facts. We next harmonized Rotten Tomatoes movies and feedback making use of client’s origin data and let editors to elect to use data from Rotten Tomatoes in support of their very own in which appropriate. That data had been joined in during indexing process too, very once information is in Elasticsearch it doesn’t matter in which they originated. We additionally revealed Critic product reviews to Elasticsearch at the same time making sure that clients software could read studies of movies and consumer score before buying.
The Silex app doesn’t have doing much. For all the wire format we picked the Hypertext program words, or HAL. HAL are an easy to use JSON-based hypermedia structure used by Drupal 8, Zend Appagility, as well as others, and it is an IETF draft requirements. In addition possess a very powerful PHP library available that we could make use of. Since Elasticsearch already sites and returns JSON it was trivial to map stuff from Elasticsearch into HAL. The hard work ended up being simply in deriving and attaching the appropriate hypermedia hyperlinks and embedded beliefs. Keywords and various other look questions had been simply passed away to Elasticsearch as well as the outcomes always weight the right documents.
Finally, we wrapped the HAL object up in Symfony’s reaction object, ready the HTTP caching parameters and ETags, and sent the content coming.
A huge advantageous asset of the split-architecture is the fact that spinning up another Silex example are trivial. There’s no meaningful setup beyond determining the Elasticsearch machine to utilize, and most code was yanked down via Composer. Meaning rotating up several cases of the API server for redundancy, high-availability, or abilities are basically no jobs. We don’t need certainly to be concerned, however; the API try read-only, so with proper utilization of HTTP headers and a basic Varnish server before they the API is surprisingly snappy.
For Ooyala as well as its consumers, Drupal got perfect for handling content material, but not for serving a web site API. Fortunately, Palantir’s familiarity with the coming Drupal 8 launch and its particular dependence regarding the Symfony pipeline let us combine Drupal with Silex – which can be just the thing for providing a web site API although not everything hot for managing and curating articles. In the long run, Palantir find the correct instrument for the job, and venture benefited out of this greatly.
Ooyala presently has a robust and dependable API that’s in a position to offer client programs we never actually handled ourselves; Ooyala’s customers become what they want; customers have a quick and receptive online services powering their particular media programs. Furthermore, Palantir met with the possibility to see our hands dirty with another member of the Symfony family – a good investment that’ll pay off lasting with Drupal 8 together with developing rise in popularity of Symfony inside the PHP ecosystem.
Ideal for Ooyala; just the thing for Palantir; just the thing for the city.
Image by Todd Lappin “Above Suburbia” under CC BY-NC 2.0, customized with greeen overlay together with improvement of arrows.
Established in 2001, Invision Solution is a certified technology solution provider company serving clients worldwide. We provide wide range of products/services in digital space to the businesses across the globe. Our key focus is on quality service and customer satisfaction.