q segmentsetup.q

Look at the structure:

/am -- top level directory
 /2009.01.01
  /t
  /q
 /2009.01.02
  /t
  /q

/nz -- another top level directory
 /2009.01.01
  /t
  /q
 /2009.01.02
  /t
  /q
 
  
q /db
can do queries

select from t where date=2009.01.01, sym=`ibm

Chapter 2 (for assignments 2 and 3)
Move segments around and adjust par.txt

Chapter 3:

Let's see how to duplicate a database.

cp -r /db /db2
cp -r /am /am2
cp -r /nz /nz2

q /db2

select from t where date=2009.01.01, sym=`ibm

Identical results from before.

Round-robin broker to route queries to different servers.
So, client communicates with broker which communicates with servers.

Thus, server performs a 
q /db
and waits.

server2 performs
q /db2
and waits.

The only thing we change is that the servers each can respond
to an interprocess procedure call that includes an sql statement.

Chapter 4: One server has an error and sends back an error signal.
Broker goes to another server.


Broker repairs a problem by copying in databases.
At this point, copy in whole database.
At some point in the future, copy in just the partition that is at issue.

Chapter 5: Use the broker to update all databases.
Broker keeps order among queries and updates, so if an update hits
the broker before a query, the query will see the effect of that update.


Now that we know how to do segmentation and how to query,
we can start replicating.
The effect we want is to have one process run on /db
but if there is a problem then go somewhere else.
Then try to copy things.

So, we have a client and several servers.
Each server controls a different database.
Client does a query an that routes to a server class.
The server class goes to one of several redundant servers.


Spread data over multiple data by just replicating the data
and adjusting par.txt.

Moving stuff is just OS level mv/cp.

@[h;"presval[10; 100 200 100 300]";"function doesn't exist"]

