I’m a ninja in a company where we are building a e-commerce virtual world, and we decided to start inside Facebook Canvas.
I think the FB canvas is a pain to work with and here is why:
1- Cookies are broken. Seriously, If you want to build something inside Facebook canvas, you can’t trust the cookies. Every browser thinks you are a popup spawning, click hijacking, demon spawn, nasty advertising company since you are inside an iframe in a different domain and they try really hard to block you from functioning properly.
You either have to work around by redirecting the user multiple times to your domain until you get your cookie writing permissions or you should just abandon them completely.
2- Since the cookies are broken, server side sessions are broken. You can never count on your server-side session since you can never be sure about your cookies.
3- Page size a bitch. Seriously, if your page is too small, canvas height will be higher than yours so your users will see a white block under your page when they scroll. If your page is bigger there are 2 scrollbars on page, which is confusing for your users. And don’t even get me started on autoGrow feature.
4- So say you have users with variable width monitors, some of them has 1680 some of them have 1380. Don’t try to be responsive. Since your page height also varies as your page responds to user screen width you begin to depend on facebook to resize your content iframe and oh, god that works weird.
So, your best option is to have a fixed height, fixed width single page app, which only works with flash games.
Eh, I don’t mean these things are impossible to solve or work around, nor they BREAK the environment. And I know Facebook cares. Also, being inside facebook is probably still worth the work, but it kinda reminds me of IE6, with all the time used to get your app to work “acceptably well” inside the FB canvas.
All in all, Facebook Canvas is not developer friendly enough IMHO but yeah, I guess we and people like us will be working to get our applications to work properly inside it for a bit more.
I’m pretty sure most of the people reading this blog post are familiar with both node.js and the hype around it.
I was looking for a weekend challenge and I was challenged by @enginerenturk to build a turn-based game server on node.js.
So it began.
I came home at around 8-9pm Friday night and immediately started working on the weekend challenge. I started with creating a project on Cloud9 and started with hacking together a basic HTTP server, which was ridiculously easy, being the though j2ee developer I am.
(Time references from now on refer to actual work-hour spent working.)
At around 1 hour mark, HTTP server was up and handling JSON objects in requests.
At around 10 hour mark, a basic tictactoe server was up and running, handling user joins, matching users, creating rooms.
At around 14 hour mark, I was playing tictactoe with a friend! (I built a basic html client with jQuery, communicating with nodejs over HTTP & JSON.)
At this point, I must admit, I was pretty impressed with performance and the rapid ability of nodejs to work as an application backend and decided to move on forward to see what will come out of this weekend challenge.
Some refactoring took place, made tictactoe logic an extension, fixed some bugs, cleaned up the server code, created a github account (Yeah, I know, I should have done that before.) , got a free tier micro instance from AWS, added some Facebook JS API magic, created an app on FB.
And so, here we are around ~20 hours mark.
I know OyunJS still has a very long way to go into production, many lines to code, many bugs to fix, but I’m hoping it will get somewhere nice eventually. Please don’t hesitate to contact me about any feedback, any advice, any bug or the fact, how much I suck at JS/nodejs.
Please, please do give some feedback!
Feel free to fork it/use it!
Remzi - @ankthepot
For the curious reader:
- Application on Facebook: http://apps.facebook.com/ticky_tacky_toe/
- “Oyun” means “Game” in Turkish.
Bijk.com offers a nice and useful service at first look. I quickly signed up for an account, added my colleagues and started adding servers right away.
Adding servers is pretty easy with bijk, their website provides the commands step by step for the most of the distros out there. In our particular case we are using ubuntu at our servers.
The first problem I had with bijk was that push method, which doesn’t require you to open up your ssh port to bijk outbound ips and should be your first choice as a sysadmin, didn’t work for us, so we ended up opening up our ssh port to Bijk outbound ips and started waiting for data.
Bijk offers nice and detailed graphs about your servers, the interface is nice and self-explanatory, and offers a pretty useful plugin base including mysql, postgresql, apache, nginx and memcached plugins. So you end up monitoring the required services pretty quick.
However, our experience with Bijk didn’t go on that seamless, on one of our Database servers, bijk-node (the agent you install on your servers to provide bijk with data) wasn’t reporting any data for mysql. After a week of mailing (which was only 3 or 4 consecutive mails long) with bijk staff, a purge&re-install of the bijk-node package fixed the problem.
So, we were getting data from our servers, the graphs were shiny and useful, alerts sounded nice, so we decided to upgrade to a paid plan.
At first our data receive interval wasn’t updated, which resulted in a 15 min poll frequency, which is a bit too low, whereas it should have been 5 mins. It took us a support ticket and a days wait to get our data poll interval to 5 mins.
After all the hassle, Bijk provides a pretty useful and rigid monitoring tool. Other than the problems setting up (and one more thing I will explain in a second), we didn’t have any problems for the last month.
The problem is, bijk has a minimum of 5 minute data poll frequency, and when you set up your alarms, say, for a CPU load of 3, bijk doesn’t send the alarm message if the load of 3 occurs between the data polls. Let me clear things up.
Server X has an average load of 0.1 - 2.5.
We set up our alarm for a CPU load of 3.
Bijk polls data at 19:00, which shows a CPU load of 2.0.
CPU load spikes to 4.2 at 19:03 which ends 30 seconds later at 19:03:30 and goes back to normal range.
Bijk polls data at 19:05, which shows a CPU load of 2.2 again and since 2.2 is still in the normal range, you don’t receive an alarm.
This doesn’t sound too bad since the CPU load faded back to normal value range and indeed everything is fine by 19:05. But if you want to, say, monitor users logged in, a ssh session occurring between 19:01 and 19:04 can go a long way unnoticed if you don’t check the graphs.
So, after all, monitoring is a dirty job. The required work to have a well enough monitoring software up and running is worth the time, but not affordable in dire situations like a close deadline or a product release. Bijk is affordable both price-wise and ease-to-use-wise. Bijk has been a valuable solution to our server stack and hope it gets even better over time.
Bijk is worth a try.
More reading on monitoring and why it sucks: