Closed

Server-to-Server PHP script

This project received 19 bids from talented freelancers with an average bid price of $190 USD.

Get free quotes for a project like this
Employer working
Skills Required
Project Budget
$30 - $250 USD
Total Bids
19
Project Description

I have two servers (remote from each other), each one of the servers is running Apache, PHP and MySQL.

The first server I call an "Edge server", which serves requests from end-users via Apache, while the second server I call a "Back-end server", which serves requests from the Edge server via Apache.

I would like you to implement communication routines between the two remote servers, while the Edge queries the Back-end for database records, then the Edge caches the results, and reponds to the end-user. Which means, before it actually queries the Back-end, it must query its own local cache.

For implementing these routines, use a "user" record of the following fields:
User name (string)
Password - as hash (string)
First name (string)
Last name (string)

On the edge server, implement a function in PHP to look up a user's information given a user name. It should:

1. Check the local cache in the local mysql server for the user's record.
2. If the info is not cached, make a call to the back-end to get the record.
3. Populate the local cache with the returned info, and respond.

On the edge server, implement a function to modify a user record. This function will just make a call to the back-end
to update the user's information.

On the edge's web server, make a couple of PHP/HTML pages to test the user lookup and modify functions.

On the back-end server make a function to look up a user's information. This function should:

1. Look up the information in the database.
2. Return the info to the edge server.

A second function on the back-end should modify a user's information. It should:

1. Update the information in the database.


####


Edge Server
-----------

Implement the following in PHP:

UserRecord
{
string username;
string pwd_hash;
string firstname;
string lastname;
}

UserRecord lookup_user( string username )
{
// check cache. if not cached
// make call to back-end to get
// record. populate cache.
}

void modify_user( UserRecord rec )
{
// make call to back-end to update
// record.
}

In PHP/HTML make pages to call these functions:
1. Page to look up a given user.
2. Page to modify a user record.


####


Back-end Server
---------------

Implement the following in PHP:

UserRecord lookup_user( string username )
{
// called by edge server. Look up
// info in the database and respond.
}

void modify_user( UserRecord rec )
{
// update info in database.
}

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online