Vanillo’s original codebase was written in PHP. The language was mostly built to be used synchronously. Meaning for every request made, the web server opens a process and parses the code to return a result. This can cause performance issues when dealing with large amounts of traffic and could require a lot of load balancing. Async languages, on the other hand, can do many tasks at the same time, in the same process without having to parse and compile the code for each request making the response time faster and allowing for more requests to be completed in the same amount of time. PHP has been a language that the CosmicMedia developers have been very familiar with for a while, which is the reason we used it on the Vanillo codebase. However, we quickly realized the problems and limitations that come with using it.

Limitations

Synchronous languages usually don’t work well for a video platform. Events are basically non-existent, making it more difficult to deal with data processing like video progress updates, notifications, live chat, etc.

For each request, a database connection is made. Database connections can be resource intensive if you’re working with a lot of traffic and this can cause your site to slow to a crawl. This was one thing we noticed when using the Vanillo codebase during tests and production. While connection pooling does exist, the way it works in PHP is fundamentally different from how it works in other languages. With persistent connections, if your script terminates unexpectedly in the middle of database operations, the next request that gets the leftover connection will pick up where the dead script left off. Read more about this here.

Solution

Due to the limitations of PHP, the CosmicMedia developers have been looking for a language for the Vanillo backend that has the following:

Non-blocking I/O.

Events.

Speed.

Data Streaming.

Scalability.

With these requirements in mind, we’ve decided on Node.js as our primary backend language with PostgreSQL for the database and Vue.js as the frontend engine. This fits pretty much all these requirements and on top of that, puts less load on our backend which will allow us to support more users on the site at once.

With this will also come a new UI, we’ll send some teasers on our twitter https://twitter.com/@TeamVanillo (Shameless plug) sooner or later.