CPSC 416: Distributed Systems    Syllabus - 2024/25 W 2

Course Description

Leslie Lamport, a computer scientist who won the 2013 ACM Turing Award, gave the following definition of a distributed system.

A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable.

Yet, distribution provides numerous benefits. A system becomes more fault tolerant if there no single-points of failure or centralized components. By extending the system with more physical nodes the system gains performance and becomes more scalable, capable of handling more load. Distribution can also improve latency, by improving geographic diversity, by placing resources closer to clients who use the system.

Achieving these benefits is not easy. As the quote above illustrates, distributed systems can fail in complex ways and these systems are more difficult to build, test, and understand than centralized systems.

This course will introduce you to a broad range of topics in distributed systems. The topics are listed in the schedule below. For the most part this is a lecture-style course. However, distributed system concepts are notoriously challenging to internalize without first-hand experience. The emphasis of this course, therefore, will be on building distributed system prototypes, small and large.

Course pre-requisites: CPSC 317 (networks) and CPSC 313 (computer hardware and operating systems).

Learning Goals

The course will provide an opportunity for students to:

Logistics

Staff

Name Role Contact Info Office
Mike Feeley Instructor feeley@cs.ubc.ca ICCS 393
Arun Balamurali TA arun.sfc@outlook.com
Mishaal Kazmi TA mkazmi@cs.ubc.ca
Ken Li TA
Praveen Gupta TA
Ryan Wang TA ryanwangubc@gmail.com

Office Hours

Who When Where
Mike Tue 9:30-10:30 & We 10:30-11:30 ICCS 393 (feeley@cs.ubc.ca)
Ryan Tue 3:30 - 4:30 pm ICCS X341 (ryanwangubc@gmail.com)
Mishaal Thu 11:00 am - 12:00 noon Zoom: https://ubc.zoom.us/j/67277605526?pwd=Y7sbFzqkzoOTEFXubDunuaSTTfY134.1 (mkazmi@cs.ubc.ca )
Arun Thu 3:30 - 4:30 pm ICCS X341 (arun.sfc@outlook.com)

Communication

Piazza is the main place for formal, academic Q&A and discussion with each other and with the teaching staff.

Discord is a good place for informal, non-academic discussions with each other (without us there). Join via the following invite link https://discord.gg/akzSjGmA.

Textbook

Distributed Systems. Van Steen, Maarten, and Andrew S. Tanenbaum. 4th edition, distributed-systems.net, 2023.

Go Resources

In this course we will exclusively use the Go programming language for all course work. Learning a new programming language is an important skill. You will practice it in this course. For the most part I will expect that you learn this language on your own. We will be using Go version 1.23.4 (available at /cs/local/bin/go on ugrad servers). If you use a personal machine, make sure to install this exact version. Though, please note that all homework solutions will be tested on the ugrad server machines.

Go is a systems language originally introduced by Google. It is especially well suited to building distributed systems. Like with any language, the fastest way to become proficient at Go is to put in the time writing programs in Go. Here are some resources to get you started:

Amanda Carbonan and Stewart Grant led an in-class Go tutorial in the 2017. Here is the recorded version: Part 1, and Part 2.

After you install the correct version of Go, you can now install an IDE of your choice. For example, VS Code provides good support for Go. Another popular option is JetBrain's GoLand (free to students; register here with your UBC email).

GitHub and Lab Submission

Syllabus, Lecture slides etc.

We will use an enterprise version of GitHub at UBC for all assignment/project code and writeup submissions. Log into github.students.cs.ubc.ca and connect to the CPSC416-2024W-T2 organization. Lecture slides, sample code, the syllabus and other resimilar information is found in the shared repository.

Starting on a Lab

Each group should create one private repo for each lab by following the Step-by-Step Instructions listed below.

The repo must be named labX_cwl0_cwl1 hereX is the lab number (e.g., 1 or 4a) and cwl0 and cwl1 are the CWL IDs of the two group members.

The template contains starter code. Be sure to select that you want to include all template files, when you create your repo.

Step-by-Step Instructions

  1. Go to https://github.students.cs.ubc.ca/organizations/CPSC416-2024W-T2/repositories/new
  2. Under Repository template select CPSC416-2024W-T2/labX whereX is the lab number (e.g., 1 or 4a)
  3. Name the repository labX_cwl0_cwl1 where X is the lab number and cwl0 and cwl1 are the CWL IDs of the two group members (e.g. lab1_alice_bob).
  4. Choose Private
  5. Press Create repository
  6. Give your partner Write access by selecting Settings, then selecting Collaborators and teams, then pressing Add people, and then entering their CWL ID and giving them Write privilages.

Warning

Ensure that your repo conforms to the following constraints.

  1. It is correctly named (see above). Incorrectly named repos will be automatically deleted.
  2. It is private and only you and your partner have access (and course staff, but we'll take care of that).
  3. Your CWL is listed on exactly one repo. If there are duplicates, your grade might be based on whichever one the TAs find first.

Submitting Lab Solutions

Work in your group's repo and push commits frequently. We will grade your last commit. If that commit occurred after the deadline, a late penalty of 2% per full hour will be apply. The deadline for each Lab is 11:59pm on the designated deadline day. So, for example, commits between 11:59pm and 12:59am receive no penalty. Those between 1:00am and 1:59am receive 2%. And so on.

Important

Push Commits Frequently.

You are required to show incremental changes to your code to demonstrate your evolving work product.

While we grade your last commit, we will also examine this history to see how your work evolved.

A single commit that contains a fully-formed solution will be flagged as suspicious and may result in a mark of zero for the lab and trigger an academic-integrity investigation.

Schedule

Topics

Unit Topic / Slides ‡ Textbook Papers
0 Introduction
1 RPC § 4.2, 8.3.2 Implementing RPC
Grapevine
2 Consistency § 7.1, 7.2.1, 7.2.3, 7.3 Linearizability
Release Consistency
3 Time § 5.2, 5.3.1-5.3.3 Time, Clocks, and the Ordering of Events in a Distributed System
Why Logical Clocks are Easy
Upcalls
4 Replication § 7.5.1, 7.5.5, 8.4 An Effective and Reliable Broadcast Protocol
Lightweight Causal and Atomic Group Multicast
Flexible Update Propagation for Weakly Consistent Replication
5 Consensus § 5.44, 8.1, 8.2 PAXOS: The Partime Parliament
PAXOS Made Simple
Raft
FLP
CAP
6 Transactions § 8.5
7 Naming § 6.1-6.3 AFS
Chord
8a Dynamo Dynamo
DynamoDB
8b ZooKeeper Zookeeper
8c GFS The Google File System
9 Byzantine Failure § 8.2.5 Byzantine Generals
PBFT

‡ Slides can change up to day of lecture; check git for the latest version.

Calendar   (Subject to Change Throughout the Term)

Date Topic Lab Released Lab Due Quiz
J07 Intro Lab 0
J09 RPC
J14 RPC
J16 RPC Lab 1
J21 RPC & Consistency
J23 Consistency
J28 Consistency & Time
J30 Time Lab 2 Lab 1
F04 Snow Day
F06 Time & Replication Quiz 1
F11 Replication Lab 3 Lab 2‡
F13 Replication
BREAK
F25 Replication & Consensus Lab 4a‡ Lab 3‡
F27 Consensus
M04 Consensus
M06 Consensus Lab 4b Lab 4a‡
M11 Consensus & Transactions
M13 Transactions & Naming Quiz 2
M18 Naming Lab 4c‡ Lab 4b‡
M20 Naming
M25 DynamoDB
M27 DynamoDB & Zookeeper Lab 5 Lab 4c
A01 Zookeeper
A03 Zookeeper & GFS
A08 GFS & Byzantine Failure Lab 5

‡ Some lab dates are not on Tu/Th; actual dates shown below in Labs section.

Labs

Lab Topic Released Due Weight
0 Go... J07 0%
1 RPC J16 J30 16%
2 Time J30 F12 14%
3 Replication F11 F26 14%
4a Raft: Leader Election F26 M07 14%
4b Raft: Logging M06 M17 14%
4c Raft: Persistence M17 M27 14%
5 Relaiable Key-Value Store (Using Raft) M27 A08 14%

Quizzes and Final Exam

Exam Date Topics
Quiz 1 F06-08 RPC – Time
Quiz 2 M13-15 Replication – Consensus
Final A14-17 Comprehensive

Exams are closed-book. Duration is 50 minutes for quizzes and 150 minutes for the final. All are administered online through Prairie Test in the Computer-Based Testing Facility (CBTF) at a self-scheduled time on the dates listed above.

In accordance with University guidelines, final exam scores will not be visible during the final-exam period. They will be posted to the Prarie Learn Gradebook on April 28, 2025. Opporunites to review your final exam solution in the CBTF will be provided after this date. Details will be emailed to your University-registered email address.

Grades

Component Percentage Notes
Labs 38% Late penalty is 2% per full hour
Quizzes 32% Improve to 80% of related Final exam questions
Final 30%

UBC Values and Policies

UBC provides resources to support student learning and to maintain healthy lifestyles but recognizes that sometimes crises arise and so there are additional resources to access including those for survivors of sexual violence. UBC values respect for the person and ideas of all members of the academic community. Harassment and discrimination are not tolerated nor is suppression of academic freedom. UBC provides appropriate accommodation for students with disabilities and for religious and cultural observances. UBC values academic honesty and students are expected to acknowledge the ideas generated by others and to uphold the highest academic standards in all of their actions. Details of the policies and how to access support are available at https://senate.ubc.ca/policies-resources-support-student-success.

Academic Integrity

Labs can be completed in pairs. You must not share any portion of your assignent with anyone other than your lab parter. If you change parters part way through a lab, you must contact course staff for permission to share any part of your previous work with your new partner.

You must not consult online or other resources that include any portion of a solution to a lab. You must not use a tutor for help with a lab. You must not use large language model, generative AI tools (e.g., ChatGPT or GitHub Copilot) to write lab code. All work that you submit must be entirely original to you and/or your partner unless you explicitly indicate otherwise and must not, for example, contain any generated code.

Course material is provided for registered students only. You must not provide this material to anyone else in any form.

Violation of these course rules constitutes academic misconduct. Other examples of misconduct and a more detailed description can be found on the department page on collaboration and on the University Academic Integrity page.