📜 ⬆️ ⬇️

Fake S3 for offline development and money saving

Curtis Spencer (Curtis Spencer) and colleagues from Spool have developed a lightweight Fake S3 server that behaves like a real Amazon S3 and helps test projects without driving data to the cloud and not spending money on traffic. In addition, for testing Fake S3 is more reliable, because it works locally. Spencer says that thanks to Fake S3, they saved about $ 1000 in the last month on traffic alone.

Installation

gem install fakes3 

To start the server you need to specify the host and port
')
 fakes3 -r /mnt/fakes3_root -p 4567 

Sample Client Code

 require 'rubygems' require 'aws/s3' include AWS::S3 AWS::S3::Base.establish_connection!(:access_key_id => "123", :secret_access_key => "abc", :server => "localhost", :port => "10001") Bucket.create('mystuff') ('a'..'z').each do |filename| S3Object.store(filename, 'Hello World', 'mystuff') end bucket = Bucket.find('mystuff') bucket.objects.each do |s3_obj| puts "#{s3_obj.key}:#{s3_obj.value}" end Bucket.delete("mystuff",:force => true) # Delete your bucket and all its keys 

It is even possible to emulate network conditions, for example, the maximum channel width.

 fakes3 -r ~/fakes3_root -p 10001 --limit=50K 

This command will limit the bandwidth for GET requests to 50K / s per request.

The developers emphasize that their server is designed specifically for testing projects, and not for replacing S3. If you want to make a S3 replacement, then they recommend using other tools for this: Ceph , ParkPlace (supports bitorrent), Boardwalk (S3 interface before MongoDB) and RiakCS .

Source: https://habr.com/ru/post/142566/


All Articles