Team members and contributions Jeffrey Wong xterase2001gmailcom Highlevel design parsing of places data Tilak Paija Pun paijapunseattleuedu Highlevel design design of IDLs and Makefile and implementation of PlacesLookup ID: 760110
Download Presentation The PPT/PDF document "3-Tiered Airport Lookup Service" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
3-Tiered Airport Lookup Service
Team members and contributions:
Jeffrey Wong (xterase2001@gmail.com)
High-level design, parsing of places data
Tilak Paija Pun (paijapun@seattleu.edu)
High-level design, design of IDLs and Makefile and implementation of PlacesLookup
Yan Yang (yangy2@seattleu.edu)
High-level design, parsing of airport data, and implementation of AirportSearch
Slide2Topics of Presentation
Startup
3-Tier Design
Client
Place Server
Airport Server
What we learned
Future Work
Summary
Questions
Slide3Server Startup
Read in files from text document
PlacesServer
AirportServer
Slide43-Tiered Design
Interaction between servers
client
place_server
airport_server
Slide5Client Formatting
Sends a
struct
to
place_server
Contains City and State Abbreviation
Expects a
struct
returned from
place_server
Contains a
struct
with original query and associated latitude and longitude
Contains an array of
structs
with each
struct
containing the closest 5 airports relative to associated latitude and longitude
Slide6Place Server Formatting
Receives query
struct
from
client
Creates a new query
struct
adds latitude and longitude in addition to the received query
struct
from client and forwards to
airport_server
Expects a
struct
from
airport_server
Extracts all
struct
data and creates a new
struct
to return to
client
all data received from
airport_server
Adds no new data, unless empty return
Slide7Place Server Design
In-memory data structure to provide fast longitude and latitude lookup for a query
tuple
(“state code”, “place name prefix”)
Builds a map<
statecode
, sorted places> upon start-up
For a user query of state code and a prefix of place name, first do a lookup based on a state code with constant cost O(1) and
binary_search
O(m log n) for prefix match where m is the length of the input value
Slide8Place Server Design Limitations
Lookup cost of O(m log n) may not be adequate for large dataset
Data not evenly partitioned, for example, Texas has over 1500 places while Rhode Island has less than 30.
Slide9Challenges for airport server
Need to handle duplicated inputs in airport data
Design and implement efficient sort algorithm to return the nearest airports
Slide10Airport Server Formatting
Expects a
struct
from
place_server
Contains City and State Abbreviation
Contains latitude and longitude of above city
Returns a
struct
to
place_server
Contains all data received from
place_server
Contains nearest 5 airports relative to latitude and longitude
Stored as an array of
structs
One
struct
for each airport
Slide11Airport server design
Store airport data in memory for efficient closest airports search
Airport data storage:
map<string,
struct
AirportPos
>
Key: airport code
Value: airport physical information
Struct
AirportPos
{
double latitude;
double
longtitude
;
string city;
string state;};
Slide12Airport search algorithm
Pseudo code
Procedure findNearest5
A[n] <- List of all airports and their distances to the given place
for (
i
= 0;
i
< 5;
i
++) {
for ( k = n – 1; k >
i
; k--) {
if A[k].distance < A[k-1].distance
swap (A[k], A[k-1])
}
}
Pseudo bubble sort to find the 5 nearest airports
O(n * 5)
It is more efficient than
quicksort
(
nlogn
)
Code design is very small relative to other search algorithms
Slide13What we learned?
Further understanding of designing
Makefile
Further understanding of distributed system based on RPC
Implementing efficient lookup algorithms
Slide14Future Work
Perhaps separate out the servers to work on remote systems, currently only works on same
localhost
Handle load balancing in case of multiple available servers that fulfill the request
Need better quality of service for handling remote server failure
Try another server
Retry
Slide15Summary/Conclusion
3-Tier Airport Lookup service is possible with RPC
Search algorithm of data for each server is dependent on the data stored and purpose of the server
Data structure used is dependent on the type of data stored and the purpose of the data
Slide16Questions?