Spatial Database
1.offers spatial data types:- points lines,regions.
2.Collection of objects: partition.
operators that evaluate to boolean 1. inside 2.intersect 3. adjacent
operators->spatial data types 1.intersection, plus,minus,contour.
operators returning numbers 1.dist,perimeter.
operators on set of objects1.sum,closest.
Relationships disjoint 1, in46,touch9 equal10, cover1214, overlap16.
Requirements for Graphical Representation.1.graphical display of query results.graphical combination.display of context on an image.query to select a part of an image.Legend.Label Placement.Scale Selection.
NEW THINGS REQUIRED IN DBMSspatial data types.Procs for data types.Spatial index structure.filter and refine techniques.spatial join operations. |
XML And Web
Sql is set oriented.prepared statements. SQL Injections.JSON Values. true,false,null,object,arrayeval and parse XML:- attribute name value pair. root,element,attribute,instructions,text,namespace,content.
DTD:- IDREFS : reference to IDS. <!ATTLIST><!ELEMENT> ?optional star optional repeatable + required repeatable.
Drawbacks of DTD: 1.inconvinient to build tools using them. don't capture main domains.ids not a good implementation. no way of OO inheritance.
XSD: using Xpath to for keys.
Simple element : no attributes,elements and not empty. |
Encryption and decryption.
Symmetric Encryption: all users know the key.
RSA: public and private key.L=P*Q;
e random number. s=d ^emod L;
decryption: de=lmod((p-l)(q-l))
Certifying Servers : SSL.certification authority. public key stored in browser. temp session key browser -> encodes it from amazon pub key.and sends to amazon.
Statistical DB Security:- information about individuals:each query must involve n number of rows. |
|
|
Spatial Indexing
approximation of geometries.Minimum bounding rectangles.
Two step operation:1.Selects all objects whose MBR satisfy the query. A superset of objects is returned. In the next step this superset is refined to return the object that is required. |
R Tree
Based on MBR. Used for 2d Objects.MBR of objects form the leaves of the tree.
R tree is a depth balanced.The root has atleast 2 entries.
Two types of queries:1.point query.2.window query. |
Quad tree based Indexing
Space based structures. Division of each space into 4 quadrants. the subdivision can be equal or unequal.
SPACE DRIVEN
Based on partitioning of the embedding 2D space into rectangular cells, independently of the object distribution. Objects are mapped to cells according to some pre-defined criterion.
Example: Quadtrees
DATA DRIVEN
Based on subdivision of the set of objects and not the embedding space. The subdivision adapts to the object distribution in the space.
Example: R-trees |
Sorting.
Data required in sorted order. grouping operations.sort merger join. duplicate removal. Bulk loading B+. External Merge Sort:- 2N ([log n ]+1)
Cost of merge sort:- _______________.
cost : ___________________. |
|
|
Storage
communication via page requests.query-> page requests.RAID 1.Level 0:- break a file into blocks,distribute amongst disks.simple to implement, no redundancy or error correction. Low MTTF. 2.Level 1 : Exact replica. Read performance can be improved. Write perf suffers. Expensive.twice space.3. Level 2:- Stripes data. bit interleaved.ECC. Multi disk record ECC, Parity disk.more disks required.[erfpr,ace/ECC code .one read at one time.
Raid Level 3:-Parity Disk is added. ECC codes with each sector.
Raid Level 4:- interleaves file blocks.allows small IO operations to be done at once.reads are simple to understand. write requires two reads and two writes.
Raid level 5:- stripes file data and check data over all the disks. write performance improves.high performance. most expensive.mirror each strip. |
Two phase locking
restrict access in some way. Balance between safety and efficiency. release the lock only after the entire transaction has completed.
Transaction must hold a lock. if another transaction conflicts then it will wait for the previous transaction to release the lock. @ phase locking blocking.leads to deadlock.
Deadlocks:- ostrich : ctrl+alt+del, timeout,detection and recovery, avoidance,prevention.
When deadlock is detected some transaction is rolled back.starvation:- same transaction may be aborted.solution: count no of times roll back.
Avoidance:- timestamping.
Lock manager:- process to send lock and unlock.responds-> lock grant.lock table-> hash table.new req end of table.unlock results in the entry being deleted and other entries taken care of. |
|
|
Transactions.
Concurrent access.Isolation: interleaved transactions.serializable transactions.Conflicts:- RW,WR,WW. READ Write transactions.:-SET TRANSACTION READ ONLY;.WR Conflicts: Dirty Reads: uncommitted transactions..RW Conflict :-unrepeatable read.transaction reads the same data and gets different ans.Overwriting uncommitted data..Phantom Problem.
Specifying Isolation levels:- default:- serializable.
Eg: Set transaction Read Write; Isolation level read uncommitted.
ST; Isolation level read committed;ST-> Isolation level repeatable read.
Read committed:- does not allow reading uncommitted data.
Repeatable Read:-if a tuple is retrieved once then once then it will be repeatable again.
Implementing Isolation Levels:- Using locks.shared lock and exclusive lock.
Read Uncommitted. allows to read without acquiring any lock. Read committed requires a lock. |
Theory of Serializability.
serial schedule. all steps occur consecutively. Well Formed Two phased transaction. acquires shared lock before reading and exclusive lock before writing. |
Security and authorization
Secrecy:- not see things, Integrity:- modify that supposed to. Availability.
Access control:- security policy and security mechanism.:- Discretionary and Mandatory Access control.
GRANT privilege ON object TO users [WITH GRANT OPTION].
If the creator of the view loses the SELECT then the view is dropped.
RBAC:-Mandatory Access Control. db object is given a class. The subject is also given a class. Rules based on object and subject.
Bell -La Padula Model.
TS>S>C>U top secret,secret,confidential,unclassified. |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by abirjepatil