Seen from outside, eyeOS is a web that only requires a browser and an Internet connection to use it. Yet why not take a glimpse at the technology behind eyeOS, get to know it and find out how it works?
System structure
The system is clearly divided into components that run on JavaScript and those that run on PHP.
Applications are divided into two parts: the part that runs on the client system (Web browser) and the part interpreted by PHP (Web server). The client side is used to draw the user interface using JavaScript, and when an operation needs to be carried out, e.g. read the database, the part interpreted by PHP is run on Ajax request (xmlhttprequest).
Components
The system contains 5 distinct parts:
- Kernel: core component that manages the implementation of the remaining components that form the eyeOS “engine”.
- Services: essential components of the system needed for eyeOS to work and manage its own internal operation. For example, a component that is responsible for managing users would be a service.
- Libraries: small components of the system that are responsible for providing support and security to the eyeOS system.
- Frameworks: the highest-level components in the system. A framework is a non-essential component that adds functionality to eyeOS, but does not provide eyeOS operations of its own. e.g. Office converter
- Bootstrap: responsible for loading the entire system before any operation takes place.
All eyeOS modules fit within one of these five categories.
In the diagram, the outer layers are more intimately linked with domain logic, while those closer to the center are lower-level components, further from domain logic and more related with system or environment-related issues.
Compiled with HipHop
Programming the backend of eyeOS in PHP provides many advantages. PHP is simple to learn, write and to debug thanks to different tools created, meaning PHP has become a programming language that changes and evolves fast, as can be seen in webpages as famous as Facebook. Despite all that, it is not a light or efficient language, something which could affect eyeOS performance.
To win efficiency and make eyeOS run well on servers with lower performance, the code is complied using HipHop. HipHop is a project developed by Facebook that transforms PHP code into C++. This way, pages can be developed in PHP, with the ease involved in that and the number of people who know the language, and then converted into C++ using a translation program. The result is C++ code that is run as an extension of PHP, meaning that the code doesn’t have to be interpreted every time a request is made.
The main advantages that HipHop provides are:
1. It reduces CPU use 50%
2. It lets eyeOS serve twice as much traffic, using 30% less CPU.
3. It transforms PHP source code directly into C++, converting it into native machine code.
Qooxdoo
Web applications are typically developed using XHTML, CSS or other similar technologies. However, the application code on eyeOS is programmed in JavaScript using a graphics library called Qooxdoo (“qx” for short). Qooxdoo is a graphics library to create user interfaces similar to those in other desktops by using toolkits like Qt, GTK+, or Swing, which enables a GUI to be developed using JavaScript instead of XHTML and CSS. Qooxdoo’s approach calls for developers to develop an interface similar to how a desktop interface would be. Qooxdoo is an open-source software project independent from eyeOS, available at: qooxdoo.org
However, eyeOS includes it without developers having to download or add anything. All eyeOS applications are developed using this graphic library. A review of Qooxdoo’s tutorial is important in developing and understanding the libraries.
Application development can be summed up as creating the graphic interface in JavaScript using Qooxdoo and calling the application’s required PHP file functions, with which services or frameworks can be called.
Database Connectivity
eyeOS’ flexibility in terms of databases is evident. Thanks to its abstraction layer, it can operate with any standard SQL database engine, giving the solution even more possibilities and allowing it to adapt to the reality of your company. By default, the virtual appliance shipped operates with MySQL database engine.
What’s more, if an application needs to connect to the database to create its own tables and store information, there are two ways of doing it:
Converting Office documents
eyeOS’ office document conversion engine is made up of three basic parts: the master, the slave and the conversion engine.
The master and the slave can have multiple conversion servers, among which the load will be distributed to achieve maximum performance and resource usage. Each slave can manage itself to ensure the integrity of the machine where it is being run.
The conversion engine is Calligra, an office suite developed by the KDE community that provides excellent conversion quality, while giving greater control over the source code (it’s small), enabling a better and faster solution of problems.
Finally, Calligra is lighter on resources than other solutions (using the OpenOffice engine, for example), which enables us to convert more documents at lower costs.
