Skip to content

Bambleweeny is lightweight key-value store and message broker based on HTTP/REST.

License

Notifications You must be signed in to change notification settings

u1i/bambleweeny

Repository files navigation

Python 3.x GitHub release docker pulls GitHub license GitHub issues

Bambleweeny is a lightweight HTTP/REST based key-value store and message broker that offers identity, access & quota management. It's fast, easy to use, and well-documented.

Written in Python, using a Redis backend, deployable in a tiny container.

Use cases: NoSQL database, web cache, data ingestion, quick prototyping, mocking API endpoints, webhooks, configuration management and coordination across distributed systems.

Run Bambleweeny

docker run -d -p 8080:8080 u1ih/bambleweeny

This gives you a single, stateful and self-contained instance. Good enough for demos and tests. See the Documentation Index for infos on how to run it as a topology, in Kubernetes and OpenShift.

Simple HTTP based Key/Value Access

Bambleweeny has a nice command-line interface. Here we'll show you some cURL examples, since everything happens over HTTP:

Get 'foo'

curl http://b9y/keys/foo -H AUTH

Set 'foo' = 'bar'

echo bar | curl -X PUT -d @- http://b9y/keys/foo -H AUTH

Make 'foo' public, so anyone can read

echo '{"key":"foo", "content_type":"text/html"}' | curl -X POST -d @- http://b9y/routes -H AUTH

/routes/125e6a6f-c3f3-403b-b096-89978773139b

curl http://b9y/routes/125e6a6f-c3f3-403b-b096-89978773139b

bar

Upload binary files

curl --upload-file image.png http://b9y/keys/pic -H AUTH

Create a counter - 'pick a number'

curl http://b9y/incr/ticket_number -H AUTH

Message Broker

Push a message to a queue

echo test_message | curl -X POST http://b9y/lists/my_queue -H AUTH

Pop a message from a queue

curl http://b9y/lists/my_queue -H AUTH

The Getting Started Guide helps you get going quickly.

Using the REST API

The endpoint /swagger gives you the Swagger file. Check out the Getting Started Guide and the API Documentation for detailed information on managing users, keys and lists.

Performance (Apache Bench)

  • ~45 reads per second, ~29 writes per second - Raspberry Pi 3 Model B, ARMv7 1GB RAM
  • ~540 reads per second, ~400 writes per second - 1x vCPU 1 GB RAM (AWS t2.micro)
  • ~800 reads per second, ~530 writes per second - MacBook Pro 2.9GHz i7 16GB RAM

Behind the Scenes

Design Principles:

  • minimal use of external libraries
  • readable code over performance
  • simplicity over feature overload

Stack & Tools

  • Python, Bottle WSGI Framework, CherryPy thread-pooled webserver
  • Redis
  • Docker

Where does the name come from?

About

Bambleweeny is lightweight key-value store and message broker based on HTTP/REST.

Resources

License

Stars

Watchers

Forks

Packages

No packages published