Part 2 of Data Storage Method based on 3.14

Not sure if it would even work?

"3.14159265358979323846264338327950288419716939937510",

"use_formula": true,

"servers": 3,

"disks_per_server": 5

}’

# :magnifying_glass_tilted_left: Retrieve it back

curl http://localhost:8000/retrieve/YOUR_STORAGE_ID_HERE

# :collision: Simulate disk failure

curl -X POST http://localhost:8000/simulate-failure/2/3

# :bar_chart: Check system status

curl http://localhost:8000/status

# Example: Storing 1 million Pi digits

raw_digits = 1_000_000

raw_bytes = raw_digits # 1 byte per digit ASCII

# Hybrid approach:

# β€’ 70% matched as Pi sequences β†’ stored as formula refs (~24 bytes each for 100-digit chunks)

# β€’ 30% compressed β†’ ~40% of original after nibble+zstd

formula_chunks = (raw_digits * 0.7) / 100

formula_bytes = formula_chunks * 24

compressed_digits = raw_digits * 0.3

compressed_bytes = (compressed_digits * 0.5) # ~50% compression after nibble+zstd

total_stored = formula_bytes + compressed_bytes

ratio = (1 - total_stored/raw_bytes) * 100

print(f"Raw: {raw_bytes/1e6:.2f} MB")

print(f"Stored: {total_stored/1e6:.2f} MB")

print(f"Compression ratio: {ratio:.1f}%")

print(f"1 TB raw β†’ ~{(1e12 * (1-ratio/100))/1e12:.2f} TB stored")

FROM python:3.11-slim

RUN pip install fastapi uvicorn zstandard mpmath

COPY api_server.py .

CMD [β€œuvicorn”, β€œapi_server:app”, β€œβ€“host”, β€œ0.0.0.0”, β€œβ€“port”, β€œ8000”]