Continuing our conservation on things I learnt at FaceBookCampToronto…
As it turns out, developers are responsible for providing their own server for their Facebook application. I had simply assumed applications would be hosted directly on the Facebook servers either in sandboxed partitions or on separate dedicated servers sharing the same high-speed network. It appears Facebook has a BYOB policy (“Bring Your Own Box”).
In addition to APIs, the Facebook Platform allows developers to access user data using an SQL-like query language called Facebook Query Language (FQL). Compared with SQL, FQL has a number of noticeable limitations.
For instance, there is only a SELECT statement and
- only a single table can be specified in the FROM clause
- SELECT * cannot be used
- only indexed columns can be used in the WHERE clause
- GROUP BY and ORDER BY are disallowed
To me it seems these restrictions are intended for workload management (WLM). By preventing multiple table selection as well as GROUP BY and ORDER B, they have effectively eliminated intensive query processing operations like joins and sorts.
This is good news for quality of service. It helps prevent poorly written applications from slowing down Facebook with monster queries that chew up CPU cycles and spill large sorts to disk.
On the other hand, this is bad news for application developers that need this basic functionality. They are now forced to implement joins and sorts within their application. This is unfortunate. I know for a fact that sorting algorithms used in commercial DBMS software are highly optimized. I fully expect they would significantly outperform the built-in functions provided in most application libraries.
Another approach to ensuring quality of service is to provide WLM functionality within the database server. This is exactly what we’re doing in DB2 Viper 2. This allows application developers to take full advantage of the DBMS without bringing the system to it’s knees.
If you want to learn more about WLM in DB2, download the Introduction to DB2 Workload Management whitepaper, or check out these YouTube videos: