18.3 Question: Instead of storing shared structure in shared memory, an alternative architecture would be to store them in the local memory of a special process, and access the shared data by inter-process communication with the process. What would be the drawback of such architecture?
18.3 Answer: The drawbacks would be that two inter-process messages would be required to acquire locks, one for the request and one to confirm grant. Inter-process communication is much more expensive than memory access, so the cost of locking would increase. The process storing the shared structures could also become a bottleneck. The benefit of this alternative is that the lock table is protected well from erroneous updates since only one process can access it.
18.4 Question: In typical client-server systems the server machine is much more powerful than the clients i.e. its processor is faster, it may have multiple processors, and it has more memory and disk capacity. Consider instead a scenario where client and server machines have exactly same power. Would it make sense to build a client-server system in such a scenario? Why? Which scenario would be better suited to data-server architecture?
18.4 Answer: With powerful clients, it still makes sense to have a client-server system, rather than a fully centralized system. If the data-server architecture is used, the powerful clients can off-load all the long and compute intensive transaction processing work from the server, freeing it to perform only the work of satisfying read-write requests. Even if the transaction-server model is used, the clients still take care of the user-interface work, which is typically very compute-intensive. A fully distributed system might seem attractive in the presence of powerful clients, but client-server systems still have the advantage of simpler concurrency control and recovery schemes to be implemented on the server alone, instead of having these actions distributed in all the machines.
18.5 Question: Consider an object-oriented database system based on client-server architecture, with the server acting as data server.
a) What is the effect of the speed of the interconnection between client and the server on the choice between object and page shipping?
b) If page shipping is used, the cache of data at client can be organized either as an object cache or a page cache. The page cache stores data in units of a page, while the object cache stores data in units of object. Assume objects are smaller than page. Describe one benefit of an object cache over page cache.
18.5 Answer:
a) We assume that objects are smaller than a page and fit in a page. If the interconnection link is slow it is better to choose object shipping, as in page shipping a lot of time will be wasted in shipping objects that might never be needed. With a fast interconnection though, the communication overheads and latencies, not the actual volume of data to be shipped, becomes the bottleneck. In this scenario page shipping would be preferable.
b) Two benefits of an having an object-cache rather than a page-cache, even if page shipping is used, are: -
I. When a client runs out of cache space, it can replace objects without replacing entire pages. The reduced caching granularity might result in better cache-hit ratios.
II. It is possible for the server to ask clients to return some of the locks, which they hold, but don’t need (lock de-escalation). Thus there is scope for greater concurrency. If page caching is used, this is not possible.
18.8 Question: Suppose a transaction is written in C with embedded SQL, and about 80% of time is spent in SQL code, with the remaining 20% spent in C code. How much speedup can one hope to attain if parallelism is used only for SQL code? Explain.
18.8 Answer: Since the part, which cannot be parallelized, takes 20% of the total running time, the best speedup we can hope for has to be less than 5.
18.11 Question: Consider a network based on dial-up phone lines, where sites communicate periodically, such as every night. Such networks are often with a server site and multiple client sites. The client sites connect only to a server site, and exchange data with other clients by storing data at the server and retrieving data stored at server by other clients. What is the advantage of such architecture over one where a site can exchange data with another site only by first dialing it up?
18.11 Answer: With the central server, each site does not have to remember which site to contact when a particular data item is to be requested. The central server alone needs to remember this, so data items can be moved around easily, depending on which sites access which items most frequently. Other housekeeping tasks are also centralized rather than distributed, making the system easier to develop and maintain. Of course there is the disadvantage of a total shutdown in case the server becomes unavailable. Even if it is running, it may become a bottleneck because every request has to be routed via it.
No comments:
Post a Comment