Skip to content

Commit

Permalink
read Epoxy
Browse files Browse the repository at this point in the history
  • Loading branch information
吳大均 authored and 吳大均 committed Dec 21, 2023
1 parent 3a51f01 commit b43c1c3
Show file tree
Hide file tree
Showing 18 changed files with 200 additions and 3 deletions.
10 changes: 10 additions & 0 deletions content/distributed-systems.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
+++
title = 'Distributed Systems'
date = 2023-12-18T13:59:39+08:00
draft = false
+++

# Distributed Systems - Maarten van Steen, Andrew S. Tanenbaum
![](/emergen-c/distsys/maarten-cover.jpg)


77 changes: 77 additions & 0 deletions content/posts/epoxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
+++
title = 'Epoxy: ACID Transactions Across Diverse Data Stores'
date = 2023-12-20T11:06:35+08:00
draft = true
+++
![](../../static/epoxy/epoxy-logo.jpg)
## Introduction
一個線上商店可能會在 Postgres 中處理客戶交易,但在 Elasticsearch 中存儲商品數據以實現快速搜索,並在 S3 中存儲圖片以節省存儲成本;這些專門系統對於此類任務比關係型數據庫(RDBMS)更有效。

## Objective
* Heterogenous Transaction (RDBMS, Dociment, Object Store...)
* MVCC 的方式管理 Heterogenous Txn
* 只需要有 Durable Write 的 Data Source 即可,不需要手動實作 2PC
* 實作 < 1K LOC: Postgres, Elasticsearch, MongoDB, Google Cloud Storage, MySQL
* Overhead (TPC-C, Micro-service workload)
* Read-mostly: 10%
* Write-heavy: 72%
* Require
* Exclusive mode -> Accessing Table
* Durable Write
## Compare to History
* 教科書做法: X/Open XA
缺點: 很多都不支援 2PC,例如: MongoDB, CockroachDB, and Redis
* 先前的作法: Cherry Garcia
缺點: Heterogenous 有 ACID 但只限於 Key-Value Operation
* 先前的作法: Skeena
缺點: 假設要在 share-memory 的條件下

## Concept
### Architecture
![](../../static/epoxy/epoxy-architecture.jpg)
### Requirements
* Primary: Isolation LeveL > Snapshot
* Secondary:
* Single-object Write: Durable, Linearizable
* Record 都有獨立的 Key
* Exclusive mode
* Records 可以被 Metadata Filtering
* 如果 Secondary Store 不支援,不是說不能做到,只是暗示了每一次都需要去 Primary 拿資料,Overhead 高到不切實際
### Interface & Example
![](../../static/epoxy/epoxy-interface.png)
![](../../static/epoxy/epoxy-example-code.png)

### Epoxy Protocol
#### Snapshot
![](../../static/epoxy/epoxy-snapshot-paper.png)
* xmin
* xmax
* rc_txns
#### Record Metadata
![Alt text](../../static/epoxy/epoxy-records.png)
* beginTxn
* endTxn

#### Epoxy Transactions
![Alt text](../../static/epoxy/epoxy-txn.png)
1. Begin Transaction
2. Data Operations
3. Validation
4. Commit or Abort Transaction
5. Optimizing Read-Only Transactions

### Evaluation
#### Baseline
* No Txns
* XA-Based Txn Manager

#### Workload
* Multi-DBMS TPC-C
* Hotel
* Cart
* Profile
* Many-Data Store Benchmark

## Reference
1. [How to Get Transactions Between (Almost) Any Data Stores](https://petereliaskraft.net/blog/epoxy)
2. [Epoxy: ACID Transactions Across Diverse Data Stores](https://petereliaskraft.net/res/p2732-kraft.pdf)
41 changes: 41 additions & 0 deletions content/posts/interest-social.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
+++
title = 'Interest Politics'
date = 2023-12-21T14:36:01+08:00
draft = false
+++

> 新自由主義是什麼 ?
新自由主義是一種政治和經濟理念,強調自由市場、貿易自由化、私有化、政府規模縮減和財政紀律。它主張減少政府對經濟的干預,增加個人和企業的自由和競爭。新自由主義在20世紀70年代末和80年代逐漸流行,對全球化和國際貿易政策產生了深遠影響。然而,這一理念也受到批評,尤其是對於其對社會不平等和經濟不穩定性的潛在影響。


> 馬克思的哲學理念是什麼 ?
馬克思的哲學理念主要基於唯物史觀和階級鬥爭理論。唯物史觀認為物質條件是歷史發展的決定性因素,而意識形態和社會結構則由這些物質條件所塑造。馬克思的階級鬥爭理論則指出,歷史上的主要社會變革都是由不同階級之間的矛盾和衝突推動的。他主張資本主義創造了壓迫工人階級的資產階級,這種階級矛盾最終會導致資本主義的崩潰和共產主義社會的建立。馬克思的哲學還包括對人的異化、勞動價值論和資本的批判。

> 當代經濟學派有哪些 ?

當代經濟學派主要包括:

新古典主義經濟學:強調市場機制、供求關係和效率。
凱恩斯主義:強調政府干預在穩定經濟和刺激需求中的作用。
行為經濟學:結合心理學和經濟學,研究人類行為對經濟決策的影響。
制度經濟學:關注社會和政治制度對經濟活動的影響。
發展經濟學:專注於發展中國家的成長和發展問題。
馬克思經濟學:基於馬克思的理論,關注資本主義的結構問題和階級鬥爭。
生態經濟學:強調經濟活動與環境可持續性之間的關係。

> 以上各個學派的學者有哪些 ?
新古典主義經濟學:阿爾弗雷德·馬歇爾、利昂·瓦爾拉斯。
凱恩斯主義:約翰·梅納德·凱恩斯。
行為經濟學:丹尼爾·卡尼曼、理查德·塞勒。
制度經濟學:索林頓·維布倫、約翰·R·康蒙斯。
發展經濟學:阿瑪蒂亞·森、埃斯特·杜芙洛。
馬克思經濟學:卡爾·馬克思、弗里德里希·恩格斯。
生態經濟學:赫爾曼·E·達利、羅伯特·科斯坦札。

> 歷史上的無政府主義學者或是國家有沒有例子 ?
歷史上著名的無政府主義者包括米哈伊爾·巴枯寧和彼得·克魯泡特金。巴枯寧是19世紀的俄羅斯革命家,對集體無政府主義有重大影響。克魯泡特金則是俄羅斯貴族出身的革命家,提倡互助作為社會進步的基礎。至於無政府主義的實際應用,雖然沒有成立長期穩定的無政府主義國家,但在一些歷史時期和事件中,例如西班牙內戰期間的一部分地區,曾經實驗過無政府主義社會的建立。
31 changes: 31 additions & 0 deletions content/posts/jailbreaking-the-simulation-with-george-hotz.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
+++
title = 'Jailbreaking the Simulation With George Hotz'
date = 2023-12-20T19:09:26+08:00
draft = false
+++
## 什麼是信仰?
> 信仰泛指那些無法被證明是正確或是錯誤的事情
## Simulation
> 一隻老虎 vs. 動物管理員, 上帝 vs. 人類
## PC 和 NPC 差別是什麼?
> PC 知道自己在遊戲中
## Simulation vs. Real
在模擬的世界中執行任何操作,都會影響到上層世界
ex: row hammer

## What are you doning in your life?
> Power over Nature, not power over People
## 大腦中的大象
只有以下兩種情形,隱藏動機才會起作用
1. 當他人窺見了你的部分心理之時
2. 當他人基於從你心裡所「窺見」的信息對你進行評判或賞罰之時

## 馬基雅維利智力假說
與心智能力相當,有時卻極為惡毒的生物相處,會大大提升認知需求

## Reference
1. [Jailbreaking the Simulation with George Hotz | SXSW 2019](https://www.youtube.com/watch?v=ESXOAJRdcwQ)
23 changes: 23 additions & 0 deletions content/posts/paper-notion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
+++
title = 'Paper Notion for Technical Writing'
date = 2023-12-21T11:33:31+08:00
draft = false
+++
## Introduction
用一個情境說明(勾引)讀者,這也是唯一能讓你發揮創意的地方

## Objective
* **解釋這篇論文的主要貢獻和主要解決的問題** (讓讀者可以 Filter 自己想要的主題)
* 可以附上論文的實作例子
* **教科書的作法** (主要是要求讀者要有預先知識,如果連最簡單的教科書命題討論都沒看過,很難去消化當前的知識)
* **先前的作法** (提供讀者比較這個領域的演進,也提供更多的想像,如果沒有比較的情境下,人類容易照單全收)

## Concept & Architecture
* **Concept** (要能夠在一個段落內說明主要概念)
* **Architecture** (只要是圖形有益於理解,但不要畫看起來很漂亮,卻沒有意義的圖)
* **Algorithm** (要有範例)

## Experiments
* **實驗方式和實驗結果** (挑關鍵的解釋)


5 changes: 5 additions & 0 deletions content/rainforest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = 'Rainforest'
date = 2023-12-14T21:43:56+08:00
draft = true
+++
2 changes: 1 addition & 1 deletion content/papers.md → content/researchs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = 'Papers'
title = 'Researchs'
date = 2023-12-14T20:26:16+08:00
draft = false
+++
14 changes: 12 additions & 2 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,22 @@ name = "Tinygrad"
url = "/tinygrad"
weight = 6

[[menu.main]]
name = "Distirbuted Systems"
url = "/distributed-systems"
weight = 7

[[menu.main]]
name = "Research"
url = "/research"
weight = 8

[[menu.main]]
name = "About"
url = "/about"
weight = 7
weight = 9

[[menu.main]]
name = "Tags"
url = "/tags"
weight = 8
weight = 10
Binary file added static/distsys/maarten-cover.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/epoxy/epoxy-architecture.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/epoxy/epoxy-example-code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/epoxy/epoxy-example.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/epoxy/epoxy-interface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/epoxy/epoxy-logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/epoxy/epoxy-records.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/epoxy/epoxy-snapshot-paper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/epoxy/epoxy-snapshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/epoxy/epoxy-txn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b43c1c3

Please sign in to comment.