Transaction Processing Foundations


Transaction Processing Foundations

Anna
Welcome back. Today we're exploring a talk by Jim Gray about astronomy, enormous scientific datasets, and the idea of a Virtual Observatory. But before Gray begins, Butler Lampson introduces him as a pioneer of databases and transaction processing. Lampson describes transaction processing as almost like pixie dust: applied to an ordinary sequential program, it can make the program concurrent, fault tolerant, automatically scheduled, and load balanced.

Michael
And Lampson gives a memorable example of why transaction processing matters. He once received bank statements showing two identical ATM withdrawals, followed by a later entry canceling one of them. Someone had corrected the mistake manually, but the system had not handled the operation transactionally. The point is that transaction processing is designed to keep operations reliable even when failures or concurrency create problems.

Anna
Gray had moved beyond transaction processing into systems for managing huge quantities of data. One earlier project was TerraServer, or TerraService, a web service containing satellite imagery of the world. At roughly one-meter resolution, users could zoom in on their own homes and see objects such as cars, although large cars might occupy several pixels.

Michael
The new project Gray presents is astronomy: building something like a World Wide Telescope or Virtual Observatory. Instead of treating each telescope's archive as an isolated resource, the goal is to make astronomy archives accessible through a federated database. In that sense, the best telescope in the world might become the internet, because people could use it to reach observations collected by many instruments.

Anna
Gray says the database community had spent many years polishing the same core technologies. His advice was to broaden the field by working with applications involving text, geospatial information, images, data analysis, data mining, and visualization. Astronomy became a useful application area because it raises demanding research questions rather than simply providing another routine database workload.

Michael
He also places this work in the history of science. There is theoretical science, based on models, and empirical science, based on observation. Over the last fifty years, computational science became increasingly important, mostly through simulation: researchers built models of physical, mechanical, or biological systems and ran them on computers.

Anna
But Gray emphasizes a second branch of computational science: data mining. Traditionally, astronomers looked through telescopes, recorded what they saw, or examined photographic plates. In the newer approach, an instrument collects enormous amounts of data, a pipeline processes it into objects and spectra, and researchers later analyze the resulting corpus.

Michael
That changes the role of the scientist. The universe itself supplies the experiment or simulator, while computers process the observations. Since no individual can inspect all the data, automated analysis becomes essential. Researchers may search for unusual objects, trends, or relationships across a massive collection.

Anna
The scale is driven by improvements in both telescopes and detectors. Gray compares astronomy to Moore's law: the amount of captured data roughly doubles every two years. Astronomers were already dealing with about a petabyte of useful data, along with additional data whose provenance was uncertain, and even a relatively basic full-sky image could require several terabytes.

Michael
Astronomy data is also unusually rich. Researchers can observe the same region at different times and in different parts of the electromagnetic spectrum. Unlike a particle such as the Higgs boson, whose properties do not substantially change from one day to the next, stars and galaxies can vary over time. So astronomy has important temporal and spectral dimensions.

Anna
Some questions are relatively straightforward: find objects with unusually high redshift that might be quasars, or search for very cold objects such as brown dwarfs. These searches can identify candidates for more detailed study. Many objects that were poorly understood fifteen years earlier became easier to characterize once large collections of examples were available.

Michael
A major advantage is that astronomers have a culture of sharing data. Astronomy observations have little direct commercial value, unlike retail, technology, or some Earth-observation data, and they do not usually involve the same privacy concerns as medical images. Archives are commonly published, often in FITS files, so researchers around the world can use them.

Anna
However, simply making a file downloadable does not make the data easy to use. A person with a slow telephone connection cannot realistically download a petabyte, and even someone who can download it must find somewhere to store and process it. More importantly, users need to know what the numbers mean, including their units, precision, error bars, and the processing steps that produced them.

Michael
Gray illustrates this with the joke that the answer to everything is 42. An answer without a question, units, precision, error estimate, or explanation of how it was derived is not very useful scientifically. Scientific data needs provenance: users should be able to understand where it came from and what transformations it underwent.

Anna
His proposed solution is to leave data in archives managed by the groups that collected it. A radio telescope should maintain its radio archive, the Hubble Space Telescope should have its archive, and the Sloan Sky Survey should have its own. Users would then query these archives as though they formed a consistent, homogeneous collection.

Michael
That creates two kinds of challenges. There are infrastructure problems such as storing, loading, and indexing petabytes. But Gray considers publication and access even more difficult: astronomers want to publish scientific results, not become database administrators. The system must therefore make it easy for archives to publish and for consumers to ask questions.

Anna
The data is high-dimensional, time-varying, multiresolution, and often dirty. An airplane, a cosmic ray, or some other interference can appear in an image and be confused with an astronomical object. Observations from different instruments may also look completely different even when they represent the same object.

Michael
The Crab Nebula shows why multiple wavelengths matter. In radio, optical, infrared, and X-ray observations, the same object has very different visible structures. Even a single image presented in false color may combine several optical bands. To understand an object, researchers need to connect these different observations and account for changes over time.

Anna
This creates an object-identification problem. A collection of observations must be divided into meaningful clusters, and researchers must determine which measurements correspond to the same astronomical object. Historically, astronomers did this by hand, then with computer plots and increasingly with data-mining and clustering algorithms.

Michael
Gray describes the current workflow as manual transmission. Astronomers create many two-dimensional plots, comparing one variable against another, and use their eyes to find lines or trends. A more powerful system would provide automatic transmission: the database could examine the data, search many combinations of dimensions, and suggest patterns, including possible false positives that humans could investigate.

Anna
This matters because people are good at spotting patterns in two dimensions, but much less effective at finding relationships across three, four, or five dimensions. A Virtual Observatory could combine automated searching with human judgment. The computer would scan the large space of possibilities, while researchers would evaluate the interesting candidates.

Michael
The Virtual Observatory would put much of the world's astronomy data online. It would provide observations across the sky and across measured spectral bands, with quality comparable to the best instruments from earlier periods. Because new instruments often take a decade or more to build, the scientists who build them typically receive an initial period to work with the data before it becomes public.

Anna
The internet changes the experience of observing. It is available whenever the researcher is available, rather than only during a scheduled telescope session, and poor weather does not ruin an online search. It can also act as a smart telescope: a user could select an object and retrieve related observations from several observatories, along with literature about that object or similar objects.

Michael
Gray's initial plan was incremental. First, put two surveys online as web services. Then federate them, which requires agreement about shared units and data representations. One prototype used Palomar data in an interface resembling TerraServer: users could pan across the sky, zoom into an object, inspect other observations, and connect the object with astronomical literature databases such as NED, VizieR, and SIMBAD.

Anna
The Sloan Sky Survey provided a particularly useful test case. It had around three terabytes of raw data and roughly fifty gigabytes of processed data representing about fifteen million objects, with many attributes attached to each. Gray wanted astronomers to query this processed collection directly instead of writing C programs and scripts to scan large ASCII files.

Michael
The SkyServer also supported education. It included material for students from primary and secondary school levels, with activities involving the Hubble diagram, redshift, spectra, error bars, and the possibility of false answers in scientific data. Students could work with real public data and learn data analysis while exploring astronomy.

Anna
The same tools were useful to professional astronomers because their existing tools were often poor. Users could specify a right ascension, declination, and radius or bounding box to retrieve objects from a region of the sky. They could inspect images, summary information, detailed records, and spectra; an individual object could have around four hundred associated attributes.

Michael
The system could also display spectra collected from telescope plates. A plate represented observations taken at one time, and the processed data included extracted spectral lines. Rather than only seeing an image of a galaxy or star, users could examine the spectrum and query information derived from it.

Anna
Gray's database experiments involved about twenty representative astronomical queries. The goal was to return answers in less than a minute, instead of requiring about a week to write and run a specialized C program. SQL could express the questions at a high level, while the database optimizer selected indexes and parallel execution strategies.

Michael
One example involved finding moving objects that might be asteroids. The telescope captured five spectral bands at different times as an object moved across the detector. A fast-moving object might appear in different locations in the blue, red, and green observations, creating several apparent objects that had to be recognized as one moving object.

Anna
A conventional query could find objects with sufficiently high measured velocity. But extremely fast objects caused a harder problem: they might not be matched across frames at all. Gray's team searched for separated, elongated detections that lined up across the different exposures. A previous script had taken three days and twelve pages of code; the database query found three candidates in about eleven minutes, two of which appeared to be genuine objects rather than a cosmic ray.

Michael
Most of the twenty queries ran in about a minute, although some took seconds and others up to roughly half an hour. Many were needle-in-a-haystack searches requiring a scan of the entire database. Parallel processing was therefore important: SQL could automatically divide the work across processors, and the system processed data at hundreds of megabytes per second.

Anna
The database was also useful for quality assurance. Because the data pipeline produced imperfect data, queries sometimes revealed zeros, implausible error bars, or other anomalies. Researchers could report these problems to the pipeline developers. In this way, making the data easier to query also made it easier to discover defects in the data-production process.

Michael
Another success involved selecting targets for new spectra. Astronomers wanted more examples of a poorly characterized class of galaxy. Instead of modifying a complicated program that controlled how holes were drilled in an aluminum observation plate, they wrote a SQL query. It achieved about a ninety-nine percent success rate and expanded the relevant sample from roughly ten objects to roughly one thousand.

Anna
That example captures the practical benefit of a database interface. C and ASCII files are computationally powerful in principle, but some tasks become difficult and slow to change. A high-level query language can reduce the time from months of program modification to an evening of query writing, followed by much faster data ingestion and analysis.

Michael
Publishing the data still requires more than XML documents or a schema. Gray argues that data alone is an incomplete abstraction: scientific publication should include the methods used to operate on the data. Rather than exposing source code, a service can publish callable methods and descriptions of the objects, attributes, and operations it supports.

Anna
TerraService illustrates this approach. A program can discover the service, learn its available methods and schemas, and request something such as an image for a geographic bounding box. The request is marshaled into XML, sent across the internet, processed against the database, and returned as an image or structured result. The client can use language-specific objects or inspect the raw XML.

Michael
The astronomy services were intended to work similarly. A client could obtain a handle to a SkyServer and call a method such as GetObjects, receiving attributes in its own program. The design question was how much should be fixed at compile time, known as early binding, and how much should remain flexible XML that can support later changes, known as late binding.

Anna
That flexibility is necessary because the astronomical schema is not finished. Researchers continually discover new attributes and new ways to classify objects. Some common properties can be standardized, such as position, time, velocity when measurable, spectral measurements, and units, while XML can provide an escape mechanism for information that does not yet fit the shared model.

Michael
Metadata remains an unsolved problem. It includes not only scientific attributes and units, but also provenance: who collected the data, which survey produced it, and what processing steps were applied. Gray's approach was deliberately bottom-up, studying real astronomy data and using XML schemas and existing standards where possible, while acknowledging that any common schema would continue to evolve.

Anna
That evolution also affects software culture. Astronomers often retrieve data from several archives, place it in private working space, modify it, and eventually publish results or even code along with the data. A fixed object definition cannot anticipate every future field, so systems must support changing schemas and user-defined extensions.

Michael
The Virtual Observatory would not eliminate traditional astronomy. Telescopes, instrument builders, mission planners, data curators, tool developers, and researchers looking for trends would all remain important. Instead, astronomy could divide into overlapping communities, with some people operating instruments, others managing archives, and others creating algorithms and analyses.

Anna
Gray also points out that remote access does not make telescope observing fully interactive. Exposures and image processing take time, and researchers still need people who understand the instruments and plan observations. The internet changes how data is accessed and analyzed, but it does not remove the need for instruments or observational expertise.

Michael
He ends with a call to action. Visualization was a major weakness, and he invited visualization researchers to work on the problem. Database researchers could use the astronomy data as a demanding test case, distributed-systems researchers could study how to federate web services, and educators could use the public data to teach astronomy, programming, and data mining.

Anna
The broader lesson is that the value of a scientific archive comes not only from storing more bytes. It comes from making those bytes discoverable, interpretable, queryable, visualizable, and connected to their provenance. Astronomy provides an unusually strong setting for this work because it combines enormous public datasets, multiple dimensions, changing observations, and a community willing to share.

Michael
And Gray briefly compares the situation with genomics. Both fields involve large datasets and could benefit from database technology, but the important operations differ. Astronomy relies heavily on spatial queries and relationships across wavelengths, while genomics centers more on sequences, similarity, distance, and matching. The same general strategy of giving researchers powerful high-level queries may transfer, even when the data structures and visual metaphors are different.

Anna
So the central idea is simple but ambitious: turn distributed astronomy archives into an accessible, federated, computational observatory. Let databases handle scale, services handle access, metadata explain meaning and provenance, algorithms search for patterns, and humans decide which discoveries matter.

Michael
Exactly. The telescope still gathers the photons, but the internet, databases, and data-mining tools let far more people explore what those photons reveal. In Gray's vision, astronomy becomes not only an observational science, but also a public laboratory for large-scale computation, education, and discovery.

Ask anything
We've read this whole study set, so questions about it get the best answers.