52
http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Building Petabyte Databases SQL+.Net Jim Gray Jim Gray Microsoft research http://research.microsoft.com/~ gray/talks VSlive! SQL To The Max 15 February 2002 @ San Francisco Objects are closer than they appear in the mirror Objects are closer than they appear in the mirror PhotoServer: Tom Barclay Ya Feng Sung TerraServer Tom Barclay USGS SkyServer Alex Szalay Ani Thakar Peter Kunszt Tanu Malik Jordan Raddick Don Slutz Jan vandenBerg Some Slides Robert Brunner

Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

Embed Size (px)

Citation preview

Page 1: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1

Building Petabyte Databases SQL+.NetBuilding Petabyte Databases SQL+.Net

Jim GrayJim GrayMicrosoft research

http://research.microsoft.com/~gray/talks

VSlive! SQL To The Max 15 February 2002 @ San Francisco

Objects are closer than they appear in the mirror

Objects are closer than they appear in the mirror

PhotoServer:Tom BarclayYa Feng Sung

TerraServer Tom Barclay USGSSkyServer Alex Szalay Ani Thakar Peter Kunszt Tanu Malik Jordan Raddick Don Slutz Jan vandenBergSome Slides

Robert Brunner

Page 2: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 2

SQLserver™: Past and Future HistorySQLserver™: Past and Future History

SQL 2000– SQL– XML– Replication x, y, z,

…– Auto Admin– Data

Transformation– OLAP – Data Mining– Text Indexing– English Query– Partitioning– Clusters

SQL 200x– Beta late this year

– Trustworthy:AvailabilityPrivacySecurity

– CLR (objects)

– XML (xQuery,….)

– Unify Files & Records

– Manageability,

– Scalability

.Net – XML schema support

– updategrams

– More xPath support

– SPs and templates as web services

WebReference.soap proxy = new WebReference.soap(); object[] results1 = proxy.StoredProcedure

(inParam, ref inoutParam, out returnValue); object[] results2 = proxy.Template(inParam);

Page 3: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 3

OutlineOutline

We will be able to store everything,– How do we represent it? (objects)– How will we find it (aka: who cares?)

PhotoServer: Objects vs records vs files,– XML++ gives us portable objects.– Similarity search: better than nothing!

Scalability: a solved problem,– but… Trustworthy & Manageable is not.

TerraServer and TerraService– Why put everything in the database?– A prototypical Web Service.

SkyServer and the World Wide Telescope – Data Mining science data– Serving Windows/Macintosh/Unix clients with .Net– Federating Archives with .Net

Page 4: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 4

Record Everything? What’s that?Record Everything? What’s that?

Disks will get 100x to 1,000x more capacity– 10x to 30x more bandwidth.

Other technologies in the wings:– mram,mems, …

The 20TB … 200TB disk drive!– Library of Congress (books)

– A billion photos

– 2…20 years of video (continuous)

Yotta

Zetta

Exa

Peta

Tera

Giga

Mega

KiloA BookA Book

.Movie

All Books MultiMedia

Everything!

Recorded

A Photo

All LoC books(words)

See Mike Lesk: How much information is there: http://www.lesk.com/mlesk/ksg97/ksg.htmlSee Lyman & Varian: How much informationhttp://www.sims.berkeley.edu/research/projects/how-much-info/

Page 5: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 5

Why Put Everything in Cyberspace?Why Put Everything in Cyberspace?

Low rentmin $/byte

Shrinks timenow or later

Shrinks spacehere or there

Automate processingknowbots

Point-to-Point OR Broadcast

Imm

edia

te O

R T

ime

Del

ayed

LocateProcessAnalyzeSummarize

Page 6: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 6

Gordon Bell’s shoebox: Scans 20 k “pages” tiff@ 300 dpi 1 GB Music: 2 k “tacks” 7 GB Photos: 13 k images 2 GB Video: 10 hrs 3 GB Docs: 3 k ppt, word,.. 2 GB Mail: 50 k messages 2 GB

16 GB

Most storage is personalMost storage is personal

90% of disks are IDE/ATA85% of bytes are

Page 7: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 7

How will we find it?How will we find it?Put everything in the DB (and index it)Put everything in the DB (and index it)

SQLSQL

More than a file system Unifies data and meta-

dataSimpler to manage Easier to subset and reorganize Set-oriented access Allows online updates Automatic indexing Automatic replication

Page 8: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 8

How do we represent it How do we represent it to the outside world?to the outside world?

File metaphor too primitive: just a blob Table metaphor too primitive: just

records Need Metadata describing data context

– Format– Providence (author/publisher/ citations/…)– Rights– History– Related documents

In a standard format XML and XML schema DataSet is great example of this World is now defining standard schemas

schema

Data ordifgram

<?xml version="1.0" encoding="utf-8" ?>

- <DataSet xmlns="http://WWT.sdss.org/">

- <xs:schema id="radec" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

<xs:element name="radec" msdata:IsDataSet="true">

<xs:element name="Table">

  <xs:element name="ra" type="xs:double" minOccurs="0" />

  <xs:element name="dec" type="xs:double" minOccurs="0" /> …

- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">

- <radec xmlns="">

- <Table diffgr:id="Table1" msdata:rowOrder="0">

  <ra>184.028935351008</ra>

  <dec>-1.12590950121524</dec>

  </Table>

- <Table diffgr:id="Table10" msdata:rowOrder="9">

  <ra>184.025719033547</ra>

  <dec>-1.21795827920186</dec>

</Table>

</radec> 

</diffgr:diffgram>

</DataSet>

Page 9: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 9

There is a problem: There is a problem: Need Standard Data AND MethodsNeed Standard Data AND Methods

XML data is GREAT!!!!– XML documents are portable objects– XML documents are complex objects– WSDL defines the methods on objects (the class)

But will all the implementations match?– Think of UNIX or SQL or C or…

We need conformance tests. That’s why Web Services Interoperability

is so important. http://www.ws-i.org/

Niklaus Wirth: Algorithms + Data Structures = Programs

Page 10: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 10

OutlineOutline

We will be able to store everything,– How do we represent it? (objects)– How will we find it (aka: who cares?)

PhotoServer: Objects vs records vs files,– XML++ gives us portable objects.– Similarity search: better than nothing!

Scalability: a solved problem,– but… Trustworthy & Manageable is not.

TerraServer and TerraService– Why put everything in the database?– A prototypical Web Service.

SkyServer and the World Wide Telescope – Data Mining science data– Serving Windows/Macintosh/Unix clients with .Net– Federating Archives with .Net

Page 11: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 11

SQL(for xml)

TemplatesSchema

PhotoServer: Managing PhotosPhotoServer: Managing Photos

Load all photos into the database Annotate the photos View by various attributes Do similarity Search Use XML for interchange Use dbObject, Template for access

DOM

SQL, Templates, XML data

XML datasets & mime data

IISjScript

Page 12: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 12

How Similarity Search WorksHow Similarity Search Works

For each picture Loader– Inserts thumbnails

– Extracts 270 Features into a blob

When looking for similar picture– Scan all photos comparing features

(dot product of vectors)

– Sort by similarity

Feature blob is an array– Today I fake the array with functions and cast

cast(substring(feature,72,8) as float)

– When SQL Server gets C#, we won’t have to fake it.

– And… it will run 100x faster (compiled managed code).

Idea pioneered by IBM Research,we use a variant by MS Beijing Research.

No black squares20% orange

…etc

many black squares10% orange

…etc

72% match 27% match

Page 13: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 13

Things I LearnedThings I Learnedfrom PhotoServerfrom PhotoServer

Data:– XML data sets are a universal way to represent

answers

– XML data sets minimize round trips: 1 request/response

Search– It is BEST to index

– You can put objects and attributes in a row (SQL puts big blobs off-page)

– If you can’t index, You can extract attributes and quickly compare

– SQL can scan at 2M records/cpu/second

– Sequential scans are embarrassingly parallel.

Page 14: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 14

OutlineOutline

We will be able to store everything,– How do we represent it? (objects)– How will we find it (aka: who cares?)

PhotoServer: Objects vs records vs files,– XML++ gives us portable objects.– Similarity search: better than nothing!

Scalability: a solved problem,– but… Trustworthy & Manageable is not.

TerraServer and TerraService– Why put everything in the database?– A prototypical Web Service.

SkyServer and the World Wide Telescope – Data Mining science data– Serving Windows/Macintosh/Unix clients with .Net– Federating Archives with .Net

Page 15: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 15

Big!Big! Servers Servers

ScaleUP: a BIG box

– SMP (32 cpus)

– 64 bit

ScaleOut: computing by the slice– 6 years ago: 8ktpmC, today 750ktpmC– SQL Server is #1, #2, #3 (Windows is best DB2 platform

too)

VLDB Management Availability:

– Clusters, remote logging, replication

Page 16: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 16

TPC measures peak performance and TPC measures peak performance and Price/PerformancePrice/Performance

Rank Company System tpmC price/tpmC Database OS TP Mon Date

1  ProLiant DL760-900-256P

 

709,220 14.96US$

Microsoft SQL Server 2000 Enterprise

Microsoft Windows 2000

Advanced  

Microsoft COM+

09/19/01 

2 IBM

eSeries370 c/s  

688,220 22.58US$ Microsoft SQL Server 2000  

Microsoft Windows 2000

Datacenter  

Microsoft COM+

04/10/01 

3  ProLiant DL760-900-192P

 

567,882 14.04US$

Microsoft SQL Server 2000 Enterprise  

Microsoft Windows 2000

Advanced  

Microsoft COM+

09/19/01 

7 HP HP 9000 Superdome

389,435 21.24US$Oracle 9i Enterprise

HP UX 11.i 64-bit BEA

Tuxedo6.4 12/21/01

14 Unisys

e-@ction Enterprise

Server ES7000

165,219 21.33US$

Microsoft SQL Server 2000 Enterprise  

Microsoft Windows 2000 Datacenter  LE 

Microsoft COM+ 

09/19/01 

32x8 900Mhz Xenon256GB ram59 TB disk

32 900Mhz Xeon 64GB ram 15TB disk

SQL Server always had best price Performance Now best of both (using scaleout) SMP performance also impressive

Source: http://www.tpc.org/tpcc/results/tpcc_perf_results.asp

Page 17: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 17

Scale OutScale Out: Buy Computing by the Slice: Buy Computing by the Slice709,202 tpmC! == 709,202 tpmC! == 1 Billion transactions/day1 Billion transactions/day

Slice: 8cpu, 8GB, 100 disks (=1.8TB) 20ktpmC per slice, ~300k$/slice

clients and 4 DTC nodes not shown

Page 18: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 18

ScaleUp: A Very Big System! ScaleUp: A Very Big System!

UNISYS Windows 2000 Data Center Limited Edition

32 cpus on 32 GB of RAM and 1,061 disks (15.5 TB) Will be helped by 64bit addressing

24fiber

channel

Page 19: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 19

OutlineOutline

We will be able to store everything,– How do we represent it? (objects)– How will we find it (aka: who cares?)

PhotoServer: Objects vs records vs files,– XML++ gives us portable objects.– Similarity search: better than nothing!

Scalability: a solved problem,– but… Trustworthy & Manageable is not.

TerraServer and TerraService– Why put everything in the database?– A prototypical Web Service.

SkyServer and the World Wide Telescope – Data Mining science data– Serving Windows/Macintosh/Unix clients with .Net– Federating Archives with .Net

Page 20: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 20

TerraServer – A SQL poster childTerraServer – A SQL poster child http://TerraServer.HomeAdvisor.Microsoft.comhttp://TerraServer.HomeAdvisor.Microsoft.com//

3 x 2 TB databases 18TB disk

tri-plexed (=6TB)

3 + 1 Cluster 99.96% uptime 1B page views

5B DB queries Now a .NET

web service

Page 21: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 21

Image DataImage Data

USGS Aerial photos “DOQ”USGS Topo Maps

EncartaVirtualGlobe

1 Km resolution

100 % WorldCoverage

All in the database 200x200 pixel tiles compressed

Spatial access z-Tranform Btree

12 TB95 % U.S. Coverage

1 m resolution

1 TB100% U.S. Coverage

2 m resolution

Page 22: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 22

TerraServer Traffic & Database GrowthTerraServer Traffic & Database Growth

Jan 2002Jan 2002

SQL 7.0SQL 7.0

1.0 TB Db1.0 TB Db

SQL 2000SQL 2000

1.0 TB Db1.0 TB Db

SQL 2000SQL 2000

1.0 TB Db1.0 TB Db

SQL 2000SQL 2000

1.0 TB Db1.0 TB Db

SQL 2000SQL 2000

2.0 TB Db2.0 TB Db

SQL 2000SQL 2000

2.0 TB Db2.0 TB Db

SQL 2000SQL 2000

2.0 TB Db2.0 TB Db

1 Server / Win NT 4.0 EE1 Server / Win NT 4.0 EE 22ndnd Server / Win 2k DataCenter Server / Win 2k DataCenter 4 Node / Win2k Datacenter 4 Node / Win2k Datacenter Failover ClusterFailover Cluster

SQL 7.0SQL 7.0

1.0 TB Db1.0 TB Db

217 m Rows217 m Rows

SQL 7.0SQL 7.01 Server1 Server1.5 TB Db1.5 TB Db

SQL 2000SQL 20001 Server1 Server.8 TB Db.8 TB Db

298 m Rows298 m Rows

SQL 7.0SQL 7.0.75 TB Db.75 TB Db

173 m Rows173 m Rows

678 m Rows678 m Rows

SQL 2000SQL 2000

.8 TB Db.8 TB Db

231 m Rows231 m Rows

900 m Rows900 m Rows

Sessions Page Views Image Tiles Db Queries Bytes Xfered

Average Day

44,320879,720

3,786,5514,566,024

59 GB

Peak Day

277,292

12,388,10410,475,674

163 GB

2,401,209

1998 -2001

44,851,547890,277087

3,831,989,8874,620,815,913

59 TB

Page 23: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 23

HardwareHardware

SQL\Inst1SQL\Inst1

SQL\Inst2SQL\Inst2

SQL\Inst3SQL\Inst3

SpareSpare

F GLKP Q

E EJ JO O

IHM NR S

22002200 22002200 22002200

220022002200220022002200

22002200 22002200 22002200

One SQL database per rackOne SQL database per rackEach rack contains 4.5 tbEach rack contains 4.5 tb261 total drives / 13.7 TB total261 total drives / 13.7 TB total

Meta DataMeta DataStored on 101 GBStored on 101 GB““Fast, Small Disks”Fast, Small Disks”(18 x 18.2 GB)(18 x 18.2 GB)

Imagery DataImagery DataStored on 4 339 GBStored on 4 339 GB““Slow, Big Disks”Slow, Big Disks”(15 x 73.8 GB)(15 x 73.8 GB)

To Add 90 72.8 GBTo Add 90 72.8 GBDisks in Feb 2001Disks in Feb 2001to create 18 TB SANto create 18 TB SAN

8 Compaq DL360 “Photon” Web Servers8 Compaq DL360 “Photon” Web Servers

Fiber SANFiber SANSwitchesSwitches

4 Compaq ProLiant 8500 Db Servers4 Compaq ProLiant 8500 Db Servers

Page 24: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 24

TerraServer Lessons LearnedTerraServer Lessons Learned Hardware is 5 9’s (with clustering) Software is 5 9’s (with clustering) Admin is 4 9’s (offline maintenance) Network is 3 9’s (mistakes, environment)

Simple designs are best 10 TB DB is management limit

1 PB = 100 x 10 TB DBthis is 100x better than 5 years ago.

Minimize use of tape– Backup to disk (snapshots)– Portable disk TBs

9 9 9 999 9 9 999 9 999 9 9

Page 25: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 25

TerraServiceTerraServicehttp://TerraService.Net/http://TerraService.Net/

Added .NET web services to TerraServer– A great way to learn what Web

Services are

– And what .Net is.

Image server– Gives arbitrary rectangle/zoom

of US

– Overlays features (hospitals, schools,..)

Census service You can use it in your app. USDA is using it today.

Demo Tour API Demo map maker Mention location and census services

Page 26: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 26

OutlineOutline

We will be able to store everything,– How do we represent it? (objects)– How will we find it (aka: who cares?)

PhotoServer: Objects vs records vs files,– XML++ gives us portable objects.– Similarity search: better than nothing!

Scalability: a solved problem,– but… Trustworthy & Manageable is not.

TerraServer and TerraService– Why put everything in the database?– A prototypical Web Service.

SkyServer and the World Wide Telescope – Data Mining science data– Serving Windows/Macintosh/Unix clients with .Net– Federating Archives with .Net

Page 27: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 27

Computational Science Computational Science The Third Science Branch is EvolvingThe Third Science Branch is Evolving

In the beginning science was empirical. Then theoretical branches evolved. Now, we have computational branches.

– Has primarily been simulation– Growth area data analysis/visualization

of peta-scale instrument data.

Computational Science– Data captured by instruments

Or data generated by simulator– Processed by software– Placed in a database / files– Scientist analyzes database / files

Page 28: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 28

Exploring Parameter SpaceExploring Parameter SpaceManual or Automatic Data MiningManual or Automatic Data Mining

There is LOTS of data – people cannot examine most of it.– Need computers to do analysis.

Manual or Automatic Exploration– Manual: person suggests hypothesis,

computer checks hypothesis– Automatic: Computer suggests hypothesis

person evaluates significance

Given an arbitrary parameter space:– Data Clusters– Points between Data Clusters– Isolated Data Clusters– Isolated Data Groups– Holes in Data Clusters– Isolated Points

Nichol et al. 2001Slide courtesy of and adapted from Robert Brunner @ CalTech.

Page 29: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 29

What’s needed?What’s needed?(not drawn to scale)(not drawn to scale)

Scientists Miners

ToolsPlumbersDatabases to

Store DataAnd

Execute Queries

Science Data & Questions

Question & AnswerVisualization

Data Mining Algorithms

Page 30: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 30

Some science is hitting a wallSome science is hitting a wallFTPFTP and and GREPGREP are not adequate are not adequate

You can GREP 1 MB in a second You can GREP 1 GB in a minute You can GREP 1 TB in 2 days You can GREP 1 PB in 3 years.

Oh!, and 1PB ~10,000 disks

At some point you need indices to limit searchparallel data search and analysis

This is where databases can help Goal Make it easy to

– Publish: Record structured data– Find: Find data anywhere in the network

Get the subset you need– Explore datasets interactively

You can FTP 1 MB in 1 sec You can FTP 1 GB / min (= 1 $/GB)

… 2 days and 1K$ … 3 years and 1M$

Page 31: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 31

Web Services are The KeyWeb Services are The Key

Web SERVER:– Given a url + parameters

– Returns a web page (often dynamic)

Web SERVICE:– Given a XML document (soap msg)

– Returns an XML document

– Tools make this look like an RPC.

F(x,y,z) returns (u, v, w)

– Distributed objects for the web.

– + naming, discovery, security,..

Internet-scale distributed computing

Yourprogram

DataIn your address

space

Web Service

soap

object

in xml

Yourprogram Web

Server

http

Web

page

Page 32: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 32

Federation

Data Federations of Data Federations of Web ServicesWeb Services

Massive datasets live near their owners:– Near the instrument’s software pipeline

– Near the applications

– Near data knowledge and curation

– Super Computer centers become Super Data Centers

Each Archive publishes a web service– Schema: documents the data

– Methods on objects (queries)

Scientists get “personalized” extracts Uniform access to multiple Archives

– A common global schema

Page 33: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 33

Why Astronomy Data?Why Astronomy Data?

It has no commercial value–No privacy concerns–Can freely share results with others–Great for experimenting with algorithms

It is real and well documented–High-dimensional data (with confidence intervals)–Spatial data–Temporal data

Many different instruments from Many different places and Many different timesFederation is a goalThe questions are interesting

–How did the universe form?

There is a lot of it (petabytes)

IRAS 100

ROSAT ~keV

DSS Optical

2MASS 2

IRAS 25

NVSS 20cm

WENSS 92cm

GB 6cm

Page 34: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 34

Web Services & Grid Enable Virtual ObservatoryWeb Services & Grid Enable Virtual Observatoryhttp://www.astro.caltech.edu/nvoconf/http://www.astro.caltech.edu/nvoconf/

http://www.voforum.org/http://www.voforum.org/

The Internet will be the world’s best telescope:– It has data on every part of the sky

– In every measured spectral band: optical, x-ray, radio..

– As deep as the best instruments (2 years ago).– It is up when you are up.

The “seeing” is always great (no working at night, no clouds no moons no..).

– It’s a smart telescope: links objects and data to literature on them.

W3C & IETF standards Provide – Naming

– Authorization / Security / Privacy

– Distributed ObjectsDiscovery, Definition, Invocation, Object Model

– Higher level services: workflow, transactions, DB,..

Page 35: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 35

Steps to Virtual Observatory PrototypeSteps to Virtual Observatory Prototype

Define a set of Astronomy Objects and methods.– Based on UDDI, WSDL, XSL, SOAP, dataSet

Use them locally to debug ideas – Schema, Units,…– Dataset problems– Typical use scenarios.

Federate different archives – Each archive is a web service– Global query tool accesses them

Working on this plan with– Sloan Digital Sky Survey and CalTech/Palomar.

Especially Alex Szalay et. al. at JHU

Page 36: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 36

Sloan Digital Sky Survey Sloan Digital Sky Survey http://www.sdss.org/ http://www.sdss.org/

For the last 12 years astronomers have been building a telescope (with funding from Sloan Foundation, NSF, and a dozen universities). 90M$.

Y2000: engineer, calibrate, commission: now public data.– 5% of the survey, 600 sq degrees, 15 M objects

60GB, ½ TB raw.– This data includes most of the known high z quasars.– It has a lot of science left in it but….

New the data is arriving: – 250GB/nite (20 nights per year) = 5TB/y.– 100 M stars, 100 M galaxies, 1 M spectra.

http://www.sdss.org/

Page 37: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 37

Demo of Sky ServerDemo of Sky Server

http://skyserver.sdss.org/

Demo sky serverDemo ExplorerExplain need for Unix/Mac clientsDemo Java SQLQA?

Talk about federation plan.

Work is product of Alex Szalay @ Johns HopkinsTanu Malik did SQLQA.

Page 38: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 38

Two kinds of SDSS data in an SQL DBTwo kinds of SDSS data in an SQL DB(objects and images all in DB)(objects and images all in DB)

15M Photo Objects ~ 400 attributes

50K Spectra with ~30 lines/spectrum

Page 39: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 39

Spatial Data Access – SQL extensionSpatial Data Access – SQL extension(Szalay, Kunszt, Brunner) http://www.sdss.jhu.edu/htm(Szalay, Kunszt, Brunner) http://www.sdss.jhu.edu/htm

Added Hierarchical Triangular Mesh (HTM) table-valued function for spatial joins.

Every object has a 20-deep Mesh ID.

Given a spatial definition:Routine returns up to ~10 covering triangles.

Spatial query is then up to ~10 range queries. Very fast: 10,000 triangles / second / cpu. Based onSQL Server Extended Stored

Procedure

2

2,2

2,1

2,0

2,3

2,3,0

2,3,12,3,2 2,3,3

2

2,2

2,1

2,0

2,32,2

2,1

2,0

2,3

2,3,0

2,3,12,3,2 2,3,3

2,3,0

2,3,12,3,2 2,3,3

2

Page 40: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 40

Data LoadingData Loading

JavaScript of DB loader (DTS) Web ops interface & workflow system Data ingest and scrubbing is major effort

– Test data quality

– Chase down bugs / inconsistencies

Other major task is data documentation– Explain the data

– Explain the schema and functions.

If we supported users, …

Page 41: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 41

Scenario Design Scenario Design Astronomers proposed 20 questions

– Typical of things they want to do– Each would require a week of programming in tcl / C++/

FTP

Goal, make it easy to answer questions DB and tools design motivated by this goal

– Implemented utility procedures– JHU Built GUI for Linux clients

Q11: Find all elliptical galaxies with spectra that have an anomalous emission line.

Q12: Create a grided count of galaxies with u-g>1 and r<21.5 over 60<declination<70, and 200<right ascension<210, on a grid of 2’, and create a map of masks over the same grid.

Q13: Create a count of galaxies for each of the HTM triangles which satisfy a certain color cut, like 0.7u-0.5g-0.2i<1.25 && r<21.75, output it in a form adequate for visualization.

Q14: Find stars with multiple measurements and have magnitude variations >0.1. Scan for stars that have a secondary object (observed at a different time) and compare their magnitudes.

Q15: Provide a list of moving objects consistent with an asteroid.Q16: Find all objects similar to the colors of a quasar at

5.5<redshift<6.5.Q17: Find binary stars where at least one of them has the colors of a

white dwarf.Q18: Find all objects within 30 arcseconds of one another that have

very similar colors: that is where the color ratios u-g, g-r, r-I are less than 0.05m.

Q19: Find quasars with a broad absorption line in their spectra and at least one galaxy within 10 arcseconds. Return both the quasars and the galaxies.

Q20: For each galaxy in the BCG data set (brightest color galaxy), in 160<right ascension<170, -25<declination<35 count of galaxies within 30"of it that have a photoz within 0.05 of that galaxy.

Q1: Find all galaxies without unsaturated pixels within 1' of a given point of ra=75.327, dec=21.023

Q2: Find all galaxies with blue surface brightness between and 23 and 25 mag per square arcseconds, and -10<super galactic latitude (sgb) <10, and declination less than zero.

Q3: Find all galaxies brighter than magnitude 22, where the local extinction is >0.75.

Q4: Find galaxies with an isophotal surface brightness (SB) larger than 24 in the red band, with an ellipticity>0.5, and with the major axis of the ellipse having a declination of between 30” and 60”arc seconds.

Q5: Find all galaxies with a deVaucouleours profile (r¼ falloff of intensity on disk) and the photometric colors consistent with an elliptical galaxy. The deVaucouleours profile

Q6: Find galaxies that are blended with a star, output the deblended galaxy magnitudes.

Q7: Provide a list of star-like objects that are 1% rare.Q8: Find all objects with unclassified spectra. Q9: Find quasars with a line width >2000 km/s and 2.5<redshift<2.7. Q10: Find galaxies with spectra that have an equivalent width in Ha

>40Å (Ha is the main hydrogen spectral line.)

Page 42: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 43

An Easy OneAn Easy OneQ15: Find asteroids Q15: Find asteroids

Sounds hard but there are 5 pictures of the object at 5 different times (color filters) and so can “see” velocity.

Image pipeline computes velocity. Computing it from the 5 color x,y would also be fast Finds 1,303 objects in 3 minutes, 140MBps.

(could go 2x faster with more disks)

select objId, dbo.fGetUrlEq(ra,dec) as url --return object ID & url sqrt(power(rowv,2)+power(colv,2)) as velocity from photoObj -- check each object.where (power(rowv,2) + power(colv, 2)) -- square of velocity

between 50 and 1000 -- huge values =error

Page 43: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 44

Find near earth asteroids:

Finds 3 objects in 11 minutes– (or 52 seconds with an index)

Ugly, but consider the alternatives (c programs an files and…)

Q15: Fast Moving ObjectsQ15: Fast Moving Objects

SELECT r.objID as rId, g.objId as gId, dbo.fGetUrlEq(g.ra, g.dec) as url

FROM PhotoObj r, PhotoObj gWHERE r.run = g.run and r.camcol=g.camcol

and abs(g.field-r.field)<2 -- nearby-- the red selection criteriaand ((power(r.q_r,2) + power(r.u_r,2)) > 0.111111 )and r.fiberMag_r between 6 and 22 and r.fiberMag_r < r.fiberMag_g and r.fiberMag_r < r.fiberMag_iand r.parentID=0 and r.fiberMag_r < r.fiberMag_u and r.fiberMag_r < r.fiberMag_zand r.isoA_r/r.isoB_r > 1.5 and r.isoA_r>2.0-- the green selection criteriaand ((power(g.q_g,2) + power(g.u_g,2)) > 0.111111 )and g.fiberMag_g between 6 and 22 and g.fiberMag_g < g.fiberMag_r and g.fiberMag_g < g.fiberMag_iand g.fiberMag_g < g.fiberMag_u and g.fiberMag_g < g.fiberMag_zand g.parentID=0 and g.isoA_g/g.isoB_g > 1.5 and g.isoA_g > 2.0-- the matchup of the pairand sqrt(power(r.cx -g.cx,2)+ power(r.cy-g.cy,2)+power(r.cz-g.cz,2))*(10800/PI())< 4.0and abs(r.fiberMag_r-g.fiberMag_g)< 2.0

Page 44: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 45

Page 45: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 46

Page 46: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 47

Page 47: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 48

Performance (on current SDSS data)Performance (on current SDSS data)

time vs queryID

1

10

100

1000

Q08 Q01 Q09 Q10A Q19 Q12 Q10 Q20 Q16 Q02 Q13 Q04 Q06 Q11 Q15B Q17 Q07 Q14 Q15A Q05 Q03 Q18

seco

nd

s

cpu

elapsedae

Run times: on 15k$ COMPAQ Server (2 cpu, 1 GB , 8 disk)

Some take 10 minutes Some take 1 minute Median ~ 22 sec. Ghz processors are fast!

– (10 mips/IO, 200 ins/byte)

– 2.5 m rec/s/cpu

cpu vs IO

1E+0

1E+1

1E+2

1E+3

1E+4

1E+5

1E+6

1E+7

0.01 0.1 1. 10. 100. 1,000.CPU sec

IO c

ount 1,000 IOs/cpu sec

~1,000 IO/cpu sec ~ 64 MB IO/cpu sec

Page 48: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 49

Sequential Scan Speed is ImportantSequential Scan Speed is Important

In high-dimension data, best way is to search. Sequential scan covering index is 10x faster

– Seconds vs minutes

SQL scans at 2M records/s/cpu (!)MBps vs Disk Config

0

50

100

150

200

250

300

350

400

450

500

1disk 2disk 3disk 4disk 5disk 6disk 7disk 8disk 9disk 10disk 11disk 12disk 12disk2vol

MB

ps

memspeed avg.

mssql

linear quantum

64bit/33MHz pci bus

1 disk controler saturates

1 PCI bus saturates

SQL saturates CPU

added 2nd ctlr

added 4th ctlr

Page 49: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 50

What we learned from the 20 QueriesWhat we learned from the 20 Queries

All have fairly short SQL programs -- a substantial advance over (tcl, C++)

Many are sequential one-pass and two-pass over data

Covering indices make scans run fast Table valued functions are wonderful

but limitations are painful. Counting, Binning, Histograms VERY common Spatial indices helpful, Materialized view (Neighbors) helpful.

Page 50: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 51

Memory in GB

1.0

10.0

100.0

1000.0

10000.0

100000.0

0 10 20 30 40 50 60 70 80 90 100

No of galaxies in Millions

CP

U t

ime

(hrs

)

1

4

32

256

year

decade

week

day

month

Cosmo: Cosmo: Computing the Cosmological ConstantComputing the Cosmological Constant

Compares simulated galaxy distribution to observed distribution

Measure distance between each pair of galaxiesA lot of work (108 x 108 = 1016 steps)

Good algorithms make this ~Nlog2N Needs LARGE main memory Using Itanium

donated by Compaqand SQL server for data store

(this is Alex Szalay, Adrian Pope,… of JHU).

Page 51: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 52

SummarySummary We will be able to store everything,

– The challenge is organizing and finding answers.

PhotoServer: Objects vs records vs files,– XML++ gives us portable objects.

– Similarity search: better than nothing!

Scalability: a solved problem,– but… Trustworthy & Manageable is not.

TerraServer and TerraService– Why put everything in the database?

– A prototypical Web Service.

SkyServer and the World Wide Telescope – Data Mining science data

– Serving Windows/Macintosh/Unix clients with .Net

– Federating Archives with .Net

Page 52: Http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 1 Building Petabyte Databases SQL+.Net Jim Gray Microsoft research gray/talks

http://gray.microsoft.com/~gray/talks/PetabyteDatabasesSql+.Net1.ppt 53

ReferencesReferences

These Slides– http://research.Microsoft.com/~Gray/talks/

TerraServer & TerraService– http://terraService.Net/

Virtual Observatory (aka World Wide Telescope)– http://www.voforum.org/

SkyServer – http://SkyServer.SDSS.org/

– See documents at http://SkyServer.SDSS.org/en/help/download/

Download “personal SkyServer” (1GB) – http://research.Microsoft.com/~Gray/sdss/