2

A friend and I would like to create a website to manipulate Facebook data.

The structure is:

  • a PHP web role (contains the web page, user OAuth login, interacts with queues, and interacts with SQL Azure database)
  • an F# worker role (does statistics and quite heavy data extractions)

The process is (assuming a new user):

  • user arrives on the web page and logs onto Facebook via OAuth, the PHP web role then posts a message in a worktodo queue with the login info and token.

  • F# worker role reads the message off the worktodo queue and starts doing data crunching (using the Facebook API) and stats, then it writes the results to a SQL Azure database. Finally it posts a message to the workdone queue stating it has succeeded in doing the data processing for the user.

  • Finally the PHP web role reads the workdone queue and notices the work is done, and displays the algorithm results.

I have two questions:

  • Is there a big flaw in this design?

  • What is the best way to collaborate: one person will write the PHP and another the F#, is there a way to use development storage from two different machines?

Thanks a lot! (Apologies if some find this stuff too basic, I am very much a beginner in all these matters).

2 Answers 2

2

If you wanted to follow a bit more experimental path, you could also try looking at Phalanger. This is a project that compiles PHP code to .NET, so it may be possible to run it directly on Azure and nicely collaborate with F# (Phalanger has a few language extensions that allow you to call any .NET objects and some API for calling Phalanger objects from C#).

I was involved in the project some time ago, but it is now beign developed by other people (and as you can see from the check-ins, it is quite active again and they would surely be interested in collaborating to resolve possible Azure issues). If you were interested, let me know - I can give you some contacts, so that you can discuss the Phalanger status on Azure with them.

2
  • Unless you want to call into .NET code from your PHP code, I don't see why he would use Phalanger instead of regular PHP.
    – user94559
    Oct 30, 2010 at 1:32
  • as @smarx says the Php does not need to directly call the .Net code. In anycase thanks for offering to put me in contact.
    – jlezard
    Oct 31, 2010 at 10:58
1

I don't see anything wrong with this plan.

I don't think there's a way to have two machines pointing at the same development storage, but you can just use cloud storage (even when running locally). I do that all of the time; you will pay for bandwidth and storage transactions, but for most apps in testing, this cost is trivial.

2
  • I am having a problem with how the worker role lets the web role know it is done. The queue thing will not work unless there is a queue for each user(otherwise lots of messages not related to the user). I could check the datbase to see if has been filled for the user (with a timer), or I could create a blob when the work is done and check for existence of this blob. These could work but seem a bit unatural, is there a better solution ? Thanks a lot!
    – jlezard
    Nov 1, 2010 at 10:51
  • Is the web role going to maintain a connection this whole time? The typical pattern is to have the client poll (via AJAX), and then it seems quite natural for the web role to in turn poll a blob or a table to see if the work is done.
    – user94559
    Nov 1, 2010 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.