Quantcast
Viewing latest article 2
Browse Latest Browse All 2

OLAP Case Study

The best way to learn about OLAP is to take look at an example of where it would be useful. You can use this case study as a way to think about your own project. Just instead of trips we could be talking about sales, atmospheric changes, astronomical phenomena, or practically anything.

Case Study:

A company exists that is in charge of keeping track of vehicles via satellite sensors installed in their machine. The purpose is to be able to track all different sorts of statistics about the car and the drivers. When they turn their engines on a unit called a “trip” is started. When they turn their engine off, the “trip” is ended. These trips and all the data associated with them are sent via the sensors into a central SQL Server database.

The company would like to glean from this “sensor data”, information regarding the trip. For example they expect to view the following information:

  • Who the driver was
  • How much fuel was consumed
  • Where they drove
  • How well the driver drove
  • In the case of a transport vehicle carrying refrigerated items, what the temperature was in the storage compartment

Depending on how sophisticated the sensors are, this data, as well as a myriad of other information, can be tracked and stored in the database. To simplify, we will take a few simple points of interest.

Database Overview:tblVehicles – Has a primary key called VehicleID

tblDrivers – Has a primary key called DriverID

tblTrips – Has a primary key called TripID. tblTrips is has many field that pertain to the upkeep and maintentance of the vehicle for a particular trip. For example: Fuel used, engine temperature, clutch movement, distance traveled, etc., Also the trip table stores which vehicle and driver is associated with the trip.

tblEvents – Has a primary key called EventID. tblEvents stores different types of events that can occur when driving a car. For example: Speeding, Passing, Wide turns etc.,

tblTripEvents – Has a duplicate key TripID, EventID. This table tblEvents stores the occurrences of these particular events that occurred during a trip.

tblTripsGrades – Has a triplicate key TripID, GradeType, GradeID. This table stores grades that are determined by computing the number of event occurrences for a certain trip. For example, Grade Type: Fuel Consumption, GradeType: Driver Safety

Specification:
The sensor company has many customers that own and operate many cars, transport vehicles. Every day the database fills with tremendous amounts of data regarding all the trips that each customer’s vehicles have travelled. They want to allow their customers to log on to a website and be able to view every detail about the vehicles, drivers and trips at lightning speed. They want to generate reports based on time periods so that can view how well a driver is doing, how many trips happened and grade the efficiency of the vehicles and drivers.

Attack:
We have all the information the customer needs stored in the database. The issue is that there may be hundreds of thousands if not millions of trips accumulated over a relatively short period of time. We need speedy access to this data. The first obvious approach is to define indexes on important fields in these tables and to write some scripts that join these fields to reveal the information.

The bottom line is: Regular indexes and “joins” in SQL Server scripts will not be fast enough. We need a way to view the information almost instantaneously. OLAP will allow you to create different views of this information from the perspective of dimensions and access them directly.

The next step is to define what the dimensions should be and how to use them.


Viewing latest article 2
Browse Latest Browse All 2

Trending Articles