P2P for Servers

https://tailhook.github.io/ciruela-presentation/

Agenda

Why?

DB

Cache

Source Code

Source Code

Source code can contain data:

  1. Gender options
  2. Shop products
  3. Game content
  4. Site news

Source Code

Takeaway

Source code is your DB until you have > 5 users.

DB? Cache? Code?

Currency Rates

(updated daily)

DB? Cache? Code?

Categories

Categories

Thats It!

Hashes+Hardlinks

ciruela sync \
 --append ./local1:/dir1/v1.0.0 \
 --replace ./local2:/dir2/current \
 cluster1.org cluster2.org

Security Warning

Use Cases

… and to do's

Always Available

… and dynamic

Always Available

with open("/sync/cur/data.json") as f:
    return json.load(f)

no network calls on start of app

Cheap to Check

dir = Path("/sync/cur")
if dir.stat().st_ctime != old_time:
    return cache

Push New Data

with tempfile.TemporaryDirectory() as d:
  with open(d.name+'/data.json', 'w') s f:
     json.dump(data, f)
  subprocess.check_call([
      'ciruela', 'sync',
      '--replace', d.name+':/sync/cur',
      'entry-point.example.org'])

Refreshable Things

… removing file works!

Limitations

… within single folder

Distributed Data

🕺 Edit on 100 Servers

ciruela edit \
 -d /sync/cur -f /data.json \
 cluster1.org cluster2.org

Basic Things

🕺 Debian Repository

Container Audit

🕺 Transactional FS

Questions

https://tailhook.github.io/ciruela-presentation/

Presentation

https://ciruela.rtfd.org/Documentation
1
SpaceForward
Right, Down, Page DownNext slide
Left, Up, Page UpPrevious slide
GGo to slide number
POpen presenter console
HToggle this help