Skip to content
Regunath B edited this page Sep 13, 2013 · 12 revisions

Phantom is a high performance proxy for accessing distributed services. It is an RPC system with support for different transports and protocols. Phantom finds many uses:

  • Proxy for protocols like Http and Thrift - for e.g. protecting a website/app from latent upstream services
  • Build Composite services that delegate to a number of upstream services - for e.g. a Mobile API platform
  • Deploy highly localized business logic - for e.g. rule based ordering of results from a service call

Motivation for creating Phantom and design overview is described in this Proxies for resilience and fault tolerance in SOA blog post.

Content delivery web-sites like Flipkart may be classified as highly-available and latency-sensitive service clients. Web sites are often implemented using diverse technology stacks that may include (and not limited to) non-threaded applications like PHP, Ruby, Python, etc. There are valid reasons for using a language like PHP for building web-sites:

  • It is good for front-end development and templating
  • Provides good agility, especially when starting out to create the website and going through quick iterations of build-deploy-validate-build.

However, the process-per-request model of these technologies result in applications incurring a high cost for making parallel calls, IO intensive operations, aggregation of calls, etc. The cost is amplified at scale - at tens of millions of calls per day, and result in large deployment footprints of web-servers.

The following illustrations from a presentation on Lessons from scaling the Flipkart website demonstrate the benefits of using a proxy:

Writing application logs to a file
Directly from PHP Using a proxy(fk-w3-agent i.e Phantom)
Composing service responses using a proxy
Loading application config from a DB
Directly from PHP - multiple DB calls(one connection per call) Using a proxy(fk-w3-agent i.e Phantom)