Skip to content

Instantly share code, notes, and snippets.

View shu-yusa's full-sized avatar

Shusaku Yusa shu-yusa

  • Tokyo, Japan
View GitHub Profile

fukabori.fm #8

8. AWS Aurora、GCP Spannerへ辿り着くまでのDBの進化

  • 70年代 メモリが高価(1MB 100万円)でハードディスクが比較的安価(100MB 数十万円)の時代
    • バッファに乗り切らないデータをハードディスクに書き戻さないといけない。しかし復旧時にもトランザクションに矛盾を起こしてはいけないという課題があった。
    • 80年代にIBMがARIESを作り、その後の標準的な実装となった.
    • ARIESではログの仕方、バッファプールの仕方、リカバリの仕方は密結合になる。ARIESはSteal/No-forceの組み合わせでログを取る。
  • Steal: トランザクションをコミットする前にディスクにフラッシュすることを許容する。リカバリの際には、未コミットだけどフラッシュされたトランザクションはundoする
@shu-yusa
shu-yusa / coverage_markdown.sh
Last active July 6, 2022 02:16
Convert Python coverage output to GitHub Actions job summary
#!/bin/sh
## https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary
repo_url=https://github.com/your-user-id/your-repository/blob
branch=master
coverage report | sed "1,3 s/-\+/--|--|--|--/g" | \
sed "/-\{3\}/d"| \
sed "0,/TOTAL*/ s/ \+/|/g" | \
sed "0,/TOTAL*/ s/^/|/g" | \
sed "0,/TOTAL*/ s/$/|/g" | \
sed "1i # Test Coverage" | \
@shu-yusa
shu-yusa / parse_coverage.sh
Last active June 8, 2023 01:32
Covert output from `phpunit --coverage-text` into the table form in Markdown
#!/bin/bash
# This script is used to convert the output from "phpunit --coverage-text"
# into a markdown formatted table. It parses the coverage data,
# then generates a table with class names, statement counts, misses, and coverages.
# The output is designed to be easily readable and suitable for inclusion in
# markdown-based documents or reports.
# Ignore output until reaching coverage report
while IFS= read -r line