CM10228 / Programming Ib:   Lecture 17

Databases and Reliability

-I.  Houseclearing

  1. Be sure to come to revision lecture next week.
    1. I will talk for ~20 minutes about the unit & the exam
    2. Those of you who have finished all the coursework should already have begun revising, and come asking questions.
    3. Those of you who spent the weekend finishing coursework should still come & listen to my lecture & my answers to the other student's questions.
  2. Be sure to submit all your coursework by Monday, whatever you have by then, just hand it in.
    1. It is really pretty easy to get 20% on the coursework.
    2. It is really a lot easier to get 60% on the exam than 80%.
    3. We will try to work out how to get CWs marked if you missed the last lab.

I. What You Should Have Learned Last Week

  1. About relations
    1. Databases are no longer one big table -- those were redundant and incomplete at the same time.
  2. the basic ideas of SQL
    1. Search
      • select * from otters
      • select * from otters where name = fred
      • select age from otters where name = fred
      • select name, age into cutenames from otters -- create a new table that's a subset of the big table
    2. Join
      • select * from otters, habitatregions where otter.habitat = habitatregion.habitat
      • select * from otters, habitatregions hr where otter.habitat = hr.habitat
      1. this can get arbitrarily complicated
      2. Some people have trouble thinking about this, but
      3. this is how you reconstruct your big tables out of properly relational databases so it really should be intuitive.
    3. Update
      • update otters set health = fine  where name = fred
      • update otters set health=hazard from otters, habitatregions hr  where otter.habitat = region.habitat.
  3. that AI really works and is in a lot of our technology
    1. Django was doing a lot for you.
    2. It can't hold a conversation or prove it's concious, but neither can chimpanzees.

II.  How Do You Save Things Forever?

  1. There's no point in storing data somewhere if you can't be sure it's going to be there in the morning.
  2. This is an outline of a bunch of slides I showed you:  selected highlights of the database course I wrote (and you'll get next year).
    1. What kind of threats are there?
    2. Where do you physically store your data?
    3. How can you be sure your data is really safe?
    4. How can you change your data and still know it's OK?
      1. This has to do with transactions and logging.
      2. This is very related to Corruption Locking & Synchronisation in Lecture 8.
  3. Here are the slides.

III.  Summary

  1. You can never be sure that your data is safe, but there are a lot of ways to make it safer.
  2. Be sure to start studying before the revision lecture on Tuesday so you have questions.

page author: Joanna Bryson
6 May 2010