I’ve really enjoyed experimenting with Meteor recently and so far i’ve found it to be a really neat little app. I’ve decided to migrate an old application over to meteor and have already made some good progress. The application is a live score updates application. While i’ve been able to demonstrate the concept i’ve found 2 issues which may prevent me from using it.
1) Data previously existed in a mySQL database so i’ve written a script to export the data into .js files. For those that might want to do similar, the main part of the PHP code is here.
$handle = fopen($output_file, "w");
foreach ( $tables as $key => $table ) {
$query = "SELECT * FROM $table_prefix$table";
$res = mysql_query($query);
while ( $row = mysql_fetch_assoc($res) ) {
$newTableName = "";
$parts = explode("_", $table);
foreach ( $parts as $k => $v ) {
$newTableName .= ucfirst($v);
}
$string = $newTableName.".insert({";
$first = true;
foreach ( $row as $columnName => $value ) {
if ( !$first ) { $string .= ", "; }
$string .= "$columnName : \"$value\"";
$first = false;
}
$string .= " });";
print $string . "<br>";
}
}
While this has worked for most of the tables, i have one table in particular which contains all the event information. This separate .js file contains 3600 lines of insert statements and it would seem that when this is in the application, the application breaks. If i rename the file to be ‘event.js.save’ for example, then the application is fine. More specifically, with this .js file in place, when i deploy the application i get..
mac:app user$ meteor deploy <domain>.meteor.com
Deploying to <domain>.meteor.com. Bundling ...
Errors prevented deploying:
Exception while bundling application:
RangeError: Maximum call stack size exceeded
So, Question number 1 is – how much has been done to test the scalability of this appliction?
2) The second issue i have is regarding mobile performance. I’ve spent a long time getting a stylesheet looking good on all platforms and have been really disappointed to see how quickly the battery on a mobile goes down.
When i load a page in Safari the ‘progress’ animation in the top right is constantly spinning and from what i’ve seen 5% of battery goes in probably 10 minutes.
Question number 2 – how is the connection kept alive for browsers? Is there anything that can be done to reduce the impact on mobile browsers?
Thanks.
1:
Applications are very scalable in the case that the meteor site managed the launch just fine with a massive amount of traffic all in one day when they had not planned for it.
The reason for your error is that you can’t call that many statements that are the same in a row as far as I’m aware as js thinks it is crashing. I think there are ways to change this however or get round it.
As far as testing they have done I’m unsure, personally I would import the data by itterating through the data and inserting it rather than having it as that many calls (I think that is the issue).
2:
That is a bug that it is spinning however it is constantly checking over ajax or similar methods.
In future sockets will be used which I expect will be more efficient.
Perhaps there will be a way to tune down the number of queries and network intensive it is in the future.