Você está na página 1de 19

bUSINESS iNFORMATION TECHNOLOGY

Contents
Python object relational mapping software (ORM)..........................................................2
NoSQL Analysis........................................................................................................ 3
CSI (Continual Service Improvement)..........................................................................5
Database Design...................................................................................................... 8
Data Normalisation................................................................................................ 9
Table Design and Relationships............................................................................. 10
Class Diagram..................................................................................................... 11
SQL +................................................................................................................ 11

Report and Database Design


Simran Kundra Project Manager Main Code & Db Design
Simran Rai Report & Class implementation
Safiyah Khan - Report & Class implementation
Aqueel Ditta Project Plan & CSI ITIL

Python object relational mapping software (ORM)


Object relational mapping software (ORM) in simplified terms is a process whereby
software Objects are mapped to tables in a relational database. (Oracle docs 2015)
A more in depth explanation of object relational mapping software is a programming
method which enables the conversion of data between incompatible systems into
object orientated programming languages (Python central 2013). Object relational
mapping enables the user to encapsulate necessary data to manipulate and query
the dataset, whereby SQL is no longer required and it is instead an object within the
programming language of choice (stackoverflow 2010)
Python utilises types which cannot contain more than one value these are known as
non- scalar, non-scalar values are values which cannot be expressed in the simplest
form possible e.g. as integers or strings. To contextualise the complexity of the
issue, we can use the example of a Person object which contains the following list
objects: an Address object and a list of phone number objects (Python central 2013).
More so, an address object may be associated with a StreetName object and a
StreetNumber object. Whilst StreetNames may be expressed as a primitive type
using strings, a Person object and a Address object are more complex and cannot
be expressed using primitive types such as: strings and integers (Python central
2013). More so, the above mentioned objects may utilise classes which cannot be
expressed using a type.
In order to overcome the complexity of dealing with objects a new class of systems
was created called ORM object relational mapping (Python Central 2013). Using the
previously mentioned example, in order to overcome the complexity of the objects,
the Person class, Address class and PhoneNumber class, each of these classes
would equate to a table in a database (Python Central 2013).
Detailed below are example of different mappers available for usage:

When utilising the Python programming language - Django ORM or


SQLAlchemy
When utilising Java Hibernate (Stackoverflow 2010)
When utilising PHP Propel or Doctrine (Stackoverflow 2010)

With regards to web utilising an ORM in web programming entire framework stacks
are available such as the following:

Symfony (PHP, using Propel or Doctrine) (Stackoverflow 2010)


Django (Python, using a internal ORM) (Stackoverflow 2010)

ORM is advantageous in the following ways:

As the data model is in one place, the code is easily maintainable, reusable
and updatable (Stackoverflow 2010)
Allows a level of flexibility as you are utilising a programming language of your
own choice and hence by default your natural way of coding (Stackoverflow
2010)
The database system is abstracted hence enabling you to make changes
when required (Stackoverflow 2010)
Utilising this system enables you to use advantageous features of OOP such
as: data inheritance without errors (Stackoverflow 2010)

In contrast, Using ORM is disadvantageous for the following reasons:

In order to effectively utilise it you have to learn how to use it and these
specific tools are not lightweight (Stackoverflow 2010)
Similarly with learning how to use it, the same issue arises when setting the
mapper up (Stackoverflow 2010)
Whilst abstraction of the database can be beneficial it necessitates you to
know what is occurring behind the scenes or else you become trapped
(Stackoverflow 2010)
With regards to normal queries performance will be reasonable but will always
perform better with substantial work implemented (Stackoverflow 2010)

References:
Oracle Docs (2015) Chapter 7. Object- Relational Mapping [online] available from <
http://docs.oracle.com/cd/E13189_01/kodo/docs316/ref_guide_mapping.html#
ref_guide_mapping_mappingtool > [09 Februrary 2015]
Python Central (2013) Introductory Tutorial of Pythons SQLAlchemy [online]
available from <
http://www.pythoncentral.io/introductory-tutorial-python-sqlalchemy/ > [09
February 2015]
Stackoverflow (2010) What is an ORM and where can I learn more about it? [online]
available from <
http://stackoverflow.com/questions/1279613/what-is-an-orm-and-where-can-ilearn-more-about-it > [16 February 2015]

NoSQL Analysis
NoSQL interpreted as Not Only SQL, (Structured Query Language).
NoSQL is a database that provides a mechanism for storage and recovery of data
that is modelled in other means than the tabular relations used in relational
databases.
The aim for this approach was to make a simple design, horizontal scaling and to
create finer control over availability. NoSQL databases are increasingly used in big
data and real-time web applications, it is also emphasized that they support SQL-like
query languages.
NoSQL makes use of various database technologies that were developed in
response to increasingly large volumes of data being stored, the frequency in which
it was being accessed and the processing needs of the data, in contrast to relational
databases which were not designed to cope with the scale and agility that modern
applications challenge databases with.
In contrast to relational databases, NoSQL databases are farther scalable and
provide greater performance, their data model addresses several issues that the
relational model was not designed to meet:
Large volumes of structures, semi-structured and unstructured data.
Agile sprints, quick iteration and frequent code pushes
Object-orientated programming that is easy to use and flexible.
Efficient scale-out architecture instead of expensive, monolithic architecture.
SQL databases requires to know what is being stored in advance, unlike relational
databases which require that schemas be defined before you can add data. Fitting
poorly with agile development approaches, each time a new feature is completed the
schema of the database also needs to be changes.
Differences between SQL and NoSQL databases:
SQL databases have only one type with minor variations, whereas NoSQL have
many different types including key-value stores, document databases, wide-column
stores and graph databases.
NoSQL was developed in the 2000s after the 1970s version of SQL was limited,
particularly the concerning scale, replication and unstructured data storage.
The data storage model for NoSQL varies based on the database type. E.G. keyvalue stores functions similarly to SQL databases however, they only have two
columns (key and value) with more complex information. SQL databases store
individual records as rows in tables with each column storing specific data, similar to
spread sheets.
Document databases on the other hand rid of the table-and-row model and store all
relevant data together in a single document in formats that are able to nest values
hierarchically, such as JSON or XML.

There are many types of NoSQL databases, including key-value stores, document
databases, wide column stores and graph databases. Developed in the 2000s in aid
to deal with the limitations of the SQL databases, particularly concerned with the
scale, replication and unstructured data storage. The data storage model varies
based on the database type, E.G. key-value stores function similarly to SQL
databases, but have two columns- key and value
NoSQL, unlike SQL is horizontally scaled, meaning that to add capacity, a database
administrator simply has to add more commodity servers or cloud instances. The
database spreads data across the necessary servers automatically.
NoSQL Database Types:
Document Database:
That pairs each key with a complex data structure known as a document/ documents
can contain several different key value pairs, key-array pairs or nested documents.
Graph Stores
Used to store information about networks, e.g. social connections. Including Neo4j
and Hypergraph DB.
Key-Value Stores
The simplest of NoSQL databases. Each item is stored as an attribute name or key,
with its value.
Wide Column Stores
E.G. Cassandra and HBase are enhanced for queries over large datasets, and store
columns of data together- instead of rows.
Examples of SQL databases/
MySQL, Postgres, Oracle Database
Examples of NoSQL databases/
Mongo dB, Cassandra, H Base, Neo4j

References:
Mongo DB inc. (2015). NoSQL Databases Explained. Available:
http://www.mongodb.com/nosql-explained. Last accessed 04th March 2015.
Unknown. (2014). Practical Examples of Databases. Available:
http://stackoverflow.com/questions/18198960/practical-example-for-eachtype-of-database-real-cases. Last accessed 04th March 2015.

CSI (Continual Service Improvement)


Within this report we are going to be investigating the data processing tool which we
have created in our last project and assess if we need any continual improvements
added to it in order for it to serve us better. This service fits into our business as it is
used daily throughout the business to achieve success.
The data processing tool has a primary goal of filtering financial data for the
customer(s) based on their preference, this could be sorted by sector or by the
needs of the organisation. Secondary goals of the data processing tool would be to
sort the data into categories, to open parts of the data set or view all of the data and
to export the data into a CSV file type. These secondary goals of the processing tool
are to provide a convenient way for the client to view their data. The targets our
business would want the processing tool to have would be to work every time and
with minimum faults. This could be that we as a business do not want much lagging
and want the data to be loaded in record time for the client as this improves business
and customer relations as the service is being provided to a good level. In order for
the data processing tool to work the client must input their financial data into the
code, this could be through a web link which they may have all of their financial
information on. This data must be complete and current, if not the processing tool will
only load financial data up to the date given by the client. The output that the
processing tool would give is the end result of all of the clients collated data in one
table which will be sorted in accordance to the clients needs.
Currently we as an intelligence company are not meeting the requirements set by
ourselves. The data processing tool is not at fault as it provides the necessary
functions required although we as a business want more from the tool. We now want
more information to be readily available to the client. This would make some
changes within the SLA as we would be introducing a new service and terms would
need to be agreed with the customer. These would all fall under the SLA although
the terms must be so that our service targets are not only manageable but adaptable
as it is a new service it may be prone to errors. This would fall under the lean
business strategy which our intelligence company has chosen to follow. Another
reason why we wish to improve this service is because we feel that the data
processing tool lags when large amounts of data are being processed by it thus if we
add in a database then the information would be spread across the two programs
and would help as there would be more data manipulation so we could query
multiple tables.
The problem is that currently we have a data processing tool which is basically a
calculation tool which operates via API. This allows for the client to sort all of their
readily on hand financial data. We want the client to be able to access more data
and be given a more in-depth understanding as to where their business stands. This
would aid the client much more and would generate more profit for our business. We
would do this by building an SQL database for our clients. This would contain
relations tables and would enable us to run SQL queries in order to build a picture of
the whole project over a period of time. It would also state how long and employee
has worked on a work-package, their role and charging rate.

In terms of service targets and goals we as a business feel that this implementation
process would not take a considerable amount of time as it is not a complicated task.
We would set ourselves targets to achieve and complete each stage of the ITIL cycle
within a designated time, we feel that each lifecycle stage would take roughly the
same amount of time to complete. We would complete one stage after the other as
was designed although we would be doing to continual process improvement
throughout.
Implementing
We as a business must monitor this change as part of our overall plan, this is known
as the Service Transition stage of the ITIL package. This process links in mainly with
the design and operation processes. Its function continues throughout the process
and is to give the client additional data in the form of graphs and charts. This would
help the client depict their financial data more quickly and easily thus making the
data processing tool a beneficial tool to our business. This would be carried out
through the various aspects of service transition, one of the main process would be
the validation and testing process as this ensures that the changes meet the needs
of the business. Another would be the transition planning and support as this
lifecycle is where we as a business build and test the service/product. This is also
important as this particular stage handles the day to day aspects of the transition
stage.
Measuring/Monitoring the solution
In order to measure our data processing tool we have to go through the service
operation processes and functions within the ITIL lifecycle. In order for us to measure
this process we would need to ensure the quality and efficiency of the
service/product which is being monitored within this lifecycle stage. This would be
done through various stages within the function and processes stage within the
operational stage of ITIL. Within the function stage of operations we would need to
assess the service desk, technical management, application management and IT
operations management. These functions would bring a team of workers together in
order to create the data processing tool. The processes of operations then comes
into play which consists of event management, incident management, request
management, problem management, and access management. Within the
processes function, objectives of testing the quality and efficiency of the data
processing tool would be established and these inputs would then be turned into
defined outputs with the results that our business needs.

For the report


We have created a CSI report for our company as it details and highlights the steps
and impacts that can occur whilst introducing the new product or service. This is
beneficial to us as introducing a new service or product to our business can either be
beneficial or can harm the revenue. The CSI report determines the improvements it
would make and if any improvements are needed. This is important as if no
improvements as needed then the business can make use of the money elsewhere.

We also go through implementing and monitoring the new feature. This aids in the
planning of the new feature as it highlights the main areas which the business needs
to configure if the change is to be made. Additionally the report highlights how and
why monitoring the feature is important thus the business can benefit from this when
it comes to that stage in the lifecycle of the product or service.

Database Design
From the project brief:

Each project is for a specific client and has a nominated project manager.
The project is divided into a number of work packages and employees bill
their time and expenses against a work package.
Each employee has a specific role, which defines the charging rate for the
client.
Over time, an employee can work on several work package associated with
the same project.
In addition, most, but not all work package have a number of associated
documents as deliverables, each of which may be written by more than one
employee.

Here is the ERD (Entity Relationship Diagram) based on the above points from the
brief:

Data Normalisation
0NF
clientID
firstName
lastName
address
dob
contactNumber

1NF
tblClient
clientID
firstName
lastName
address
dob

2NF
tblClient
clientID
firstName
lastName
address
dob

projectID
projectName
startDate
endDate
projectCost

contactNumber
projectID
projectName
startDate
endDate

contactNumber
projectID
projectName
startDate
endDate

actualCost
workPackageID
title
time
actualExpenses
estimatedExpenses

projectCost
actualCost

projectCost
actualCost

tblEmployee
employeeID
empl_firstName

tblEmployee
employeeID
empl_firstName

documentID

empl_lastName

empl_lastName

name
type

empl_address
empl_dob

status
employeeID
empl_firstName
empl_lastName
empl_address
empl_dob
empl_contactNumb
er
roleID

empl_contactNumber
roleID
roleName
chargingRate

empl_address
empl_dob
empl_contactNu
mber
roleID
roleName
chargingRate

tblWorkpackage

tblDocument

workPackageID
projectID*

documentID
name

roleName

documentID*

type

chargingRate

employeeID*
title
time

status

actualExpenses

workPackageID

estimatedExpenses
name

projectID*
documentID*

tblWorkpackage

3NF
tblClient
clientID
firstName
lastName
address
dob
contactNum
ber
tblProject
projectID
clientID*
projectNam
e
startDate
endDate
projectCost
actualCost
tblDocumen
t
documentI
D
name
type
status
tblRole
roleID
roleName
chargingRat
e
tblEmploye
e
employeeI
D
roleID*
empl_firstName
empl_lastNa
me
empl_addre
ss
empl_dob

type
status

employeeID*
title
time
actualExpenses
estimatedExpens
es

Table Design and Relationships


MS Access tables and relationships:

Design explained:

Client can have 1 or more projects

Project can have 1 or more workpackages

Workpackage can have 1 or more documents

empl_contactNumbe
r
tblWorkpackage
workPacka
geID
projectID*
documentID
*
employeeID
*
title
time
actualExpen
ses
estimatedExpenses

Employee can work on 1 or more workpackages

Employee can have 1 role (lookup table) e.g. Project Manager

Class Diagram
A class diagram is a visual structure representing a system structure by outlining its
classes, attributes, operations and the relations between each object.
The diagram above conveys the classes in our system, their respective their
attributes and how they are retrieved using python, which is outlined by the
operations.
Each member of our group will implement at least one of these classes into Python.
We will be using the ORM SqlAlchemy to connect our database to python.

SQL +

Creating SQL Tables

Alter table to add foreign key:

This process was repeated for all other tables with appropriate data types and
constraints as shown previously in the first screenshots showing the tables.

Adding Data to Tables


Below is an example from our table Project where we have used the Insert SQL
statement to add data to tables.
insert into PROJECT (PROJECTID, CLIENTID, PROJECTNAME, STARTDATE,
ENDDATE, PROJECTEDCOST, ACTUALCOST) values (1, 1, 'Youbridge',
'5/26/2014', '8/2/2014', 38, 785);
insert into PROJECT (PROJECTID, CLIENTID, PROJECTNAME, STARTDATE,
ENDDATE, PROJECTEDCOST, ACTUALCOST) values (2, 2, 'Wikivu',
'11/26/2014', '12/27/2014', 938, 412);
insert into PROJECT (PROJECTID, CLIENTID, PROJECTNAME, STARTDATE,
ENDDATE, PROJECTEDCOST, ACTUALCOST) values (3, 3, 'Realpoint',
'3/4/2015', '4/16/2014', 810, 531);
insert into PROJECT (PROJECTID, CLIENTID, PROJECTNAME, STARTDATE,
ENDDATE, PROJECTEDCOST, ACTUALCOST) values (4, 4, 'Skilith',
'5/17/2014', '12/12/2014', 969, 879);
insert into PROJECT (PROJECTID, CLIENTID, PROJECTNAME, STARTDATE,
ENDDATE, PROJECTEDCOST, ACTUALCOST) values (5, 5, 'Topiclounge',
'8/17/2014', '6/14/2014', 147, 168);
insert into PROJECT (PROJECTID, CLIENTID, PROJECTNAME, STARTDATE,
ENDDATE, PROJECTEDCOST, ACTUALCOST) values (6, 6, 'Thoughtbeat',
'1/11/2015', '6/23/2014', 638, 553);
insert into PROJECT (PROJECTID, CLIENTID, PROJECTNAME, STARTDATE,
ENDDATE, PROJECTEDCOST, ACTUALCOST) values (7, 7, 'Leenti',
'3/27/2014', '10/4/2014', 269, 897);

insert into PROJECT (PROJECTID, CLIENTID, PROJECTNAME, STARTDATE,


ENDDATE, PROJECTEDCOST, ACTUALCOST) values (8, 8, 'Yabox',
'12/24/2014', '12/3/2014', 930, 713);
insert into PROJECT (PROJECTID, CLIENTID, PROJECTNAME, STARTDATE,
ENDDATE, PROJECTEDCOST, ACTUALCOST) values (9, 9, 'Youbridge',
'8/21/2014', '3/13/2014', 876, 68);
insert into PROJECT (PROJECTID, CLIENTID, PROJECTNAME, STARTDATE,
ENDDATE, PROJECTEDCOST, ACTUALCOST) values (10, 10, 'Demimbu',
'11/6/2014', '1/24/2015', 30, 27);

SQL Queries

List of all records in each table

SELECT * FROM CLIENT;

SELECT * FROM PROJECT;

SELECT * FROM WORKPACKAGE;

SELECT * FROM DOCUMENT;

SELECT * FROM EMPLOYEE;

SELECT * FROM ROLE;

Total cost of Actual Cost for a Work Package in a given month

Total Projected Cost for a Project in a year

List of Employees and their Assigned Project Name

Você também pode gostar