Skip to main content

On This Page

Floci: A High-Fidelity AWS Emulator with 24ms Startup

2 min read
Share

These articles are AI-generated summaries. Please check the original sources for full details.

The Floci philosophy: stay tiny, feel like real AWS

Hector Ventura has developed Floci to solve the trade-off between fast-but-fake and heavy-but-faithful AWS emulators. The system utilizes a Quarkus native binary that achieves a 24ms cold start and consumes only 13 MiB of memory at idle.

Why This Matters

Traditional emulators often force developers to choose between lightweight mocks that lack accuracy or heavy runtimes that bloat CI pipelines and slow down development cycles. Floci addresses this by splitting services into a lightweight in-process control plane and a ‘real engine’ data plane, ensuring that if a test passes locally, it maintains production-grade fidelity. By using right-sized engines like DuckDB for analytics and real containers for databases, Floci provides a technical reality that mirrors AWS behavior without the overhead of a full cloud environment.

Key Insights

  • Native Binary Core: Floci uses a Quarkus native binary to handle control planes for S3, SQS, and DynamoDB with an idle footprint of only 13 MiB.
  • Embedded Data Planes: For analytics services like Athena and Firehose, Floci utilizes floci-duck, a Rust wrapper around DuckDB for real columnar SQL execution.
  • On-Demand Docker Integration: Heavy services like RDS, MSK, and ElastiCache spin up real containers (Postgres, Kafka, Redis) on-demand via the Docker socket.
  • Stateless In-Process Execution: Metadata-heavy services are implemented in-process to maintain speed, while engine-backed services avoid re-implementation to prevent ‘lying’ mocks.
  • Protocol Fidelity: Floci focuses on wire-protocol fidelity for the control plane while delegating the data plane to the smallest real engine available, such as using DuckDB instead of a full Presto cluster.

Working Examples

Run Floci with Docker socket access to enable engine-backed services like RDS and Lambda.

docker run --rm -p 4566:4566 -v /var/run/docker.sock:/var/run/docker.sock floci/floci:latest

Practical Applications

  • Use case: Rapid local unit testing where developers spin up Floci per-test due to its 24ms cold start time.
  • Pitfall: Mocking database behavior with fake engines can lead to production bugs; Floci avoids this by running real RDS/Postgres containers.
  • Use case: Cost-effective CI/CD pipelines utilizing free-tier runners that are constrained by memory but require high-fidelity AWS service emulation.
  • Pitfall: Relying on simulated SQL engines for Athena; Floci uses DuckDB to provide real SQL execution for Athena queries against S3 data.

References:

Continue reading

Next article

Strategic Acquisition of Snapchat Accounts for Scalable Digital Marketing

Related Content