Ucha.se makes learning fun. It is an online platform, on which pupils and students learn and prepare for school. Pupils learn faster, improve their results and get inspired. The platform allows students to watch videos, take tests, ask questions and share comments. Learning is represented with gamification components like drawings, playful narration, dashboards with the best students, etc. It is available on the web and is extending to mobile. Ucha.se is well recognized by the parents and teachers in Bulgaria. In November 2012 Ucha.se was awarded as the best website in Bulgaria in the field of Education and Science.
Nikolay Zheynov is leading the IT team which maintains and expands the web platform. He shared with me some of the internals.
Main technologies used are PHP, MySQL, Nginx, jQuery and jQueryUI.
Server-side development is done with PHP 5. The main reason for choosing PHP is that the IT team working on the platform had long experience with the language. Ucha.se has developed their own PHP framework which is constantly expanding. This allows flexible programming and easier application maintenance. Nginx is the web server of choice.
MySQL 5 is used for the database because PHP + MySQL is like bread and butter. While the site usage was growing the team had to optimize their DB layer and switched from MyISAM storage engine to InnoDB.
On the client-side standard web technologies are used - HTML5, CSS3 and JavaScript. The main goal when doing the website design was to match expectation from different user groups - pupils, teachers, parents and students. jQuery and jQueryUI are widely used on the client side.
True to our agile approach to incrementally enhance the product and the technology that goes along with it, we strongly believe in the scaling on demand practices. Ucha.se's own framework reflects exactly to that. It allows us to meet our growing user demands and provides at the same time, the dev-team with enough flexibility to quickly react on new business opportunities and technological (r)evolutions.
Nikolay Zheynov
If you’d like to hear more from Ucha.se please comment below. I will ask them to follow this thread and reply to your questions.
There are comments.
Image CC-BY-SA, Michael Mandiberg
I found two good blog posts about investigating MySQL internals: Researching your MySQL table sizes and Finding out largest tables on MySQL Server. Using the queries against my site Difio showed:
mysql> SELECT CONCAT(table_schema, '.', table_name),
-> CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
-> CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
-> CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
-> CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
-> ROUND(index_length / data_length, 2) idxfrac
-> FROM information_schema.TABLES
-> ORDER BY data_length + index_length DESC;
+----------------------------------------+-------+-------+-------+------------+---------+
| CONCAT(table_schema, '.', table_name) | rows | DATA | idx | total_size | idxfrac |
+----------------------------------------+-------+-------+-------+------------+---------+
| difio.difio_advisory | 0.04M | 3.17G | 0.00G | 3.17G | 0.00 |
+----------------------------------------+-------+-------+-------+------------+---------+
The table of interest is difio_advisory
which had 5 longtext
fields. Those fields were
not used for filtering or indexing the rest of the information.
They were just storage fields - a `nice' side effect of using Django's ORM.
I have migrated the data to Amazon S3 and stored it in JSON format there. After dropping these fields the table was considerably smaller:
+----------------------------------------+-------+-------+-------+------------+---------+
| CONCAT(table_schema, '.', table_name) | rows | DATA | idx | total_size | idxfrac |
+----------------------------------------+-------+-------+-------+------------+---------+
| difio.difio_advisory | 0.01M | 0.00G | 0.00G | 0.00G | 0.90 |
+----------------------------------------+-------+-------+-------+------------+---------+
For those interested I'm using django-storages on the back-end to save the data in S3 when generated. On the front-end I'm using dojo.xhrGet to load the information directly into the browser.
I'd love to hear your feedback in the comments section below. Let me know what you found for your own databases. Were there any issues? How did you deal with them?
There are comments.