{"id":20475409,"url":"https://github.com/ashwinpn/advanced-database-systems","last_synced_at":"2026-05-05T01:34:55.130Z","repository":{"id":201600062,"uuid":"303427455","full_name":"ashwinpn/Advanced-Database-Systems","owner":"ashwinpn","description":"Replicated Concurrency Control and Recovery project. ","archived":false,"fork":false,"pushed_at":"2021-02-03T14:10:10.000Z","size":17848,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-05T14:31:33.528Z","etag":null,"topics":["database","docker","python","reproducibility","reproducible-research","reprozip"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashwinpn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-10-12T15:03:37.000Z","updated_at":"2021-02-03T14:10:13.000Z","dependencies_parsed_at":"2023-10-20T01:53:53.481Z","dependency_job_id":null,"html_url":"https://github.com/ashwinpn/Advanced-Database-Systems","commit_stats":null,"previous_names":["ashwinpn/advanced-database-systems"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ashwinpn/Advanced-Database-Systems","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwinpn%2FAdvanced-Database-Systems","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwinpn%2FAdvanced-Database-Systems/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwinpn%2FAdvanced-Database-Systems/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwinpn%2FAdvanced-Database-Systems/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashwinpn","download_url":"https://codeload.github.com/ashwinpn/Advanced-Database-Systems/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwinpn%2FAdvanced-Database-Systems/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32632287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","docker","python","reproducibility","reproducible-research","reprozip"],"created_at":"2024-11-15T15:15:56.187Z","updated_at":"2026-05-05T01:34:55.116Z","avatar_url":"https://github.com/ashwinpn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advanced-Database-Systems\n\n\u003cins\u003eReplicated Concurrency Control and recovery project.\u003c/ins\u003e\n\nWe implement a distributed database, complete with multiversion concurrency control, deadlock detection, replication, and failure recovery.\nThen, we use reprozip, docker, vagrant, and virtual machines to make our project reproducible even across different architectures for all time.\n\n\n## Run Experiments\n - Running the code on a test case (say, test1.txt)\n```python\npython main.py --test test1.txt\n```\n- For debug mode,\n```python\npython main.py --debug True test1.txt\n```\n## Install dependencies\n```bash\n apt-get install python python-dev python-pip gcc libsqlite3-dev libssl-dev libffi-dev\n```\n\n## Troubleshooting\nIf you get this error:\n```bash\nE: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource\ntemporarily unavailable)\nE: Unable to acquire the dpkg frontend lock\n(/var/lib/dpkg/lock-frontend),\nis another process using it?\n```\n\n\u003cins\u003eRun\u003c/ins\u003e\n```bash\nsudo rm /var/lib/apt/lists/lock\nsudo rm /var/cache/apt/archives/lock\nsudo rm /var/lib/dpkg/lock*\n\nsudo dpkg --configure -a\n\nsudo apt update\n```\n\n## Reprozip and Reproducibility\n - After installing dependencies, install reprozip.\n ```bash\n pip install -U reprozip\n ```\n - Install reprounzip.\n```bash\npip install -U reprounzip[all]\n```\n- To collect traces, inside the project directory, run\n```bash\nreprozip trace python main.py --test \u003cfile_name\u003e.txt\n\n[When they ask you if you want to append to the trace, reply with ‘a’]\n```\n- Then pack\n```bash\nreprozip pack my_experiment.rpz\n```\n## Running the project\n- With reprounzip\n```bash\n$ reprounzip directory setup my_experiment.rpz mydirectory\n$ reprounzip directory run mydirectory\n```\n- With docker\n```bash\n$ reprounzip docker setup my_experiment.rpz mytemplate\n$ reprounzip docker run mytemplate\n```\n![Terminal](https://github.com/ashwinpn/Advanced-Database-Systems/blob/main/resources/db1.JPG)\n\n## Running with Vagrant\nFirst, install the plugin reprounzip-vagrant.\n```bash\n$ pip install reprounzip-vagrant\n```\nNote that (i) you must install reprounzip first, and (ii) the plugin requires having Vagrant\ninstalled. Then, use the prefix reprounzip vagrant to create and start a virtual machine\nunder the directory mytemplate:\n```bash\n$ reprounzip vagrant setup my_experiment.rpz mytemplate\n```\n\nTo execute the experiment, simply run:\n```bash\n$ reprounzip vagrant run mytemplate\n```\n\n- We also ran it on Windows with vagrant and Oracle Virtual Box (Use \u003cb\u003evagrant up\u003c/b\u003e and\n\u003cb\u003evagrant ssh\u003c/b\u003e to boot it up). You can find the vagrantfile and other files within the\nVagrant_DB folder.\n\n![Terminal](https://github.com/ashwinpn/Advanced-Database-Systems/blob/main/resources/data1.JPG)\n![Terminal](https://github.com/ashwinpn/Advanced-Database-Systems/blob/main/resources/data2.JPG)\n\n## Theory\n-  Use the available copies approach to replication using strict two phase locking (using read and write locks) at each site and validation at commit time.\n-  Detect deadlocks using cycle detection and abort the youngest transaction in the cycle. The system keeps track of the transaction time of any transaction holding a lock.\n-  Read-only transactions use multiversion read consistency.\n-  The system consists of two parts: a single transaction manager that translates read and write requests on variables to read and write requests on copies using the available copy algorithm described in the notes [CSCI-GA-2434]. The transaction manager never fails. The other part is the site [or the data manager]. If a site fails and recovers, the\ndata manager would decide which in-flight transactions to commit.\n- If a transaction T accesses an item (really accesses it, not just request\na lock) at a site and the site then fails, then T continues to execute\nand then aborts only at its commit time (unless T is aborted earlier due to\ndeadlock).\n\n## System Design\n\n![](https://github.com/ashwinpn/Advanced-Database-Systems/blob/main/resources/uml.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashwinpn%2Fadvanced-database-systems","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashwinpn%2Fadvanced-database-systems","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashwinpn%2Fadvanced-database-systems/lists"}