General Study Pt2. Flashcards

things i missed out

1
Q

Phantom Phenomena

A

Any transaction processing related commands need to be translated into basic and explicit reads and writes on database objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Sharing Phenomena

A

Running concurrent transaction through different isolation levels:

Serializable Read - Not possible Dirty Read/Inconsistent Read/Phantom Read

Repeatable Read - Not possible Inconsistent Read/Phantom Read

Read Committed - Possible Inconsistent Read/Phantom Read

Read Uncommitted - Possible Dirty Read/Inconsistent Read/Phantom Read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Wait for Graph

A

Draw a graph of the processes and what processes are waiting for what resources. If there are cycles then there is a deadlock.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Two Phase Locking (2PL)

A

2PL is a concurrency control mechanism used to manage locks, it is in charge of assigning locks and unlocks. It has two phases, growing and shrinking. During the growing phase it hordes locks, and during the shrinking phase it releases locks. This is a strict phase, after a lock is released, no more locks may be attained.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Conflict Serializable

A

A serializable schedule is conflict serializable if it can be transferred to a serial schedule by swapping non-conflicting operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Serial Schedules

A

A serial schedule executes transactions in their totality. It is correct. It doesn’t allow interleaving.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Recoverable Schedules

A

it is recoverable, no need to roll back. If no transaction T in S commits until all transactions Ti that have written an item that T reads have committed.(all changes are made before reading)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Cascading Rollback:

A

Abort a transaction, To avoid this, make sure that every transaction reads only transactions that were written by committed transactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Strict Schedule:

A

On top of cascading rollbacks, writes delayed until all transactions previously written are either committed or aborted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

List of common ports at…

A

Can find list of common ports at /etc/services on UNIX.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

IP

A

Internet Protocol is part of OS. Address in dotted decimal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

IP: TCP Specification in OS

A

Allocate local resources -> Define local and remote endpoints -> initiate communication -> send and receive data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Socket

A

API to TCP. Created on UNIX as a set of OS calls:
Communication connection point which can be named and addressed
Data Structure
Set of API functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

COM/OLE

A

COM (Component Object Model) and OLE (Object Linking and Embedding) are technologies developed by Microsoft for creating modular and extensible software components. In the context of distributed databases, COM/OLE can be used to facilitate communication and interaction between different software components or applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does a JAVA RMI work

A

It does as so:
1. Server sets up service and registers objects
2. Client looks for objects in registry
3. Client retrieves object stub
4. As client uses stub, communicates with server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Interoperability

A

Interoperability refers to the ability to be able to run a process or referencing a process on another platform or address space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Producer Consumer

A

Producers generate tasks or data and consumers process them. Communicate asynchronously through a buffer, preventing resource conflicts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Master Slave

A

Master slave is a model in which there is one node which is a master and a number of nodes which are the slaves. The master nodes distributes tasks amongst the slave nodes, in the form of parallel programming.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Creating Parallel Program

A

1) First we want to break down our task into sub tasks
2) We want to assign each of these sub-tasks to a process
3) We then want to orchestrate synchronization, communication and data access
4) Finally map processes to processors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Technology needed to design Physical DDB

A

DB Connection (FDW, stored procedures…)
Triggers
Views
Replication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Perils of Replication

A

Security
Consistency
Performance
Recovery

22
Q

2PC

A

Standards for two phase commit. Allows programmers to commit the entire transaction in one request with this request spanning over various systems and networks.

23
Q

Procedural Replication

A

Proc. Replication queues calls to procedure and then delivers to all relevant sites. Conflict handlers required.

24
Q

Multimaster Replication

A

Used if there is need to maintain a table at numerous sites with updates being reflected at all sites. Not good for massive data updates.

Uses synchronous for online data and asynchronous with queue for eventually delivered. Needs conflict resolution in async.

25
Q

Updatable Remote Views

A

If local changes to a remote view are required, we have to send these changes to the master site which builds the remote view.

26
Q

Remote Read Only Views

A

Copy part of a database into local database, used when connection dependency is high.

27
Q

In logical replication, a publisher can:

A
  • Broadcast its updates
  • Can be a number of subscribers to the same broadcast
  • Can control what updates to show
  • Response time and latency at subscriber are OK.
28
Q

Logical Replication

A

Can publish row changes over one or more persistent tables in a source database to a number of interested parties through a subscription. Source DB must declare a named object as a publication.

29
Q

Client Set Up

A
  1. Install a client software on a client machine
  2. Check client machine can ping servers
  3. Check current assigned IP is in range
  4. Add a connection
30
Q

Server Set Up

A
  1. Install postgreSQL server
    1.1 Adjust start-up files
  2. Restart PostgreSQL server
  3. Extract the following details
    3.1 Server Ip and listening port
    3.2 DB name
    3.3 DB username
  4. Check local instance
31
Q

PGSQL Shell \q

A

\q Remark quit shell

32
Q

PGSQL Shell \I

A

\l Remark list of databases …

33
Q

PGSQL Shell \c

A

\c scott Remark … connect to database scott

34
Q

How do you create a table

A

CREATE TABLE name

35
Q

How do you create a view

A

CREATE OR REPLACE VIEW name
AS SELECT * FROM scott.emp
WHERE emp.no = 10;

36
Q

Input text Postgres in SQL

A

COPY table_name FROM ‘/path/to/input/file.csv’ WITH CSV HEADER;

37
Q

Output text postgres in SQL

A

COPY table_name TO ‘/path/to/output/file.csv’ WITH CSV HEADER;

38
Q

Foreign Data Wrapper enable functionality

A

CREATE EXTENSION postgres_fdw;

39
Q

Create FDW server

A

CREATE SERVER fdw_database_server FOREIGN DATA WRAPPER postgres_fdw OPTIONS ( host ‘127.0.0.1’, port ‘5432’, dbname ‘dm’ );

40
Q

Create DBlink Extension SQL

A

CREATE EXTENSION dblink;

41
Q

Get DBLink connections SQL

A

SELECT dblink_get_connections();

42
Q

Disconnect DBlink SQL

A

SELECT dblink_disconnect(‘’con2tastrade’);

43
Q

Copy data from other DB using DBLink SQL

A

SELECT * FROM dblink( ‘port=5432 dbname=server_b user=postgres password=?’, ‘select * from test.t1’) AS t1 (a int, b varchar(50));

44
Q

Design Quirk

A

In Postgres, all databases are isolated from each other, even if they are on the same server.

45
Q

State of Play

A

Use a middleman to connect components and apps to ease communications.

46
Q

Speedup

A

Measures Decrease in Response Time when adding more distributed nodes. Linear speedup is ideal.

47
Q

Scale Up

A

Measures how long response time can be maintained when adding more workload and nodes. Ideally remains the same.

48
Q

Size Up

A

Measures the proportionality of response time to increase of workload

49
Q

Design Considerations

A

3 Dimensions of design considerations:

Level of Sharing: We can choose between no sharing, data sharing or data+program sharing.

Behaviour of Access Patterns: Static or Dynamic

Level of Knowledge on Access Pattern Behaviour

50
Q

Components of DDBMS

A
  • User Processor
    • UI: I/O of end users
    • Semantic Data Controller: Integrity
    • constraints & authorizations
    • Global Query Optimizer & Decomposer
    • Distributed Execution Monitor
  • Data Processor
    • Local Query Optimizer
    • Local Recovery Manager
    • Run Time Support Processor
51
Q

DBMS Architectural Model

A

Distribution of Data: Each node is a fully fledged DBMS

Autonomy of Data: DBMS manages DBMSs that run in total isolation.

Heterogeneity: DDB is made up of DBMS’s that vary in data modelling, query languages etc.