[a Scaleable A/B testing backend in ~100 lines of code (and for free*)](http://blog.gingerlime.com/2016/a-scaleable-ab-testing-backend-in-100-lines-of-code-and-for-free/)
## What is it?
an A/B testing backend using AWS Lambda/API Gateway + Redis
* Highly scalable due to the nature of AWS Lambda
* High performance and low memory footprint using Redis HyperLogLog
* Cost Effective
## What does Gimel mean?
Gimel (גִּימֵל) is the 3rd letter of the Hebrew Alphabet. The letter (ג) also looks visually similar to the greek Lambda
Alephbet might send duplicate events, but each event should include a `uuid` to allow the backend to de-duplicate it. More below
### Data Store - Redis HyperLogLog
The data store keeps a tally of each event that comes into the system. Being able to count unique events (de-duplication) was important to keep an accurate count. One approach would be to store each event in an entry / database row / document, and then run some kind of a unique count on it. Or we could use a nifty algorithm called [HyperLogLog](https://en.wikipedia.org/wiki/HyperLogLog). HyperLogLog allows you to count unique counts without storing each and every item.
In terms of storage space, redis HyperLogLog offers a fixed size of 12k per counter. This gives us ample space for storing experiment data with low memory footprint.
### Backend - AWS Lambda / API Gateway
The backend had to take care of a few simple types of requests:
* track an event - receive a (HTTP) request with some json data -- experiment name, variant, goal and uuid, and then push it to redis.
* extract the counters for a specific experiment, or all experiments into some json that can be presented on the dashboard.
* copy `config.json.template` to `config.json`
* update `config.json` with your redis settings and save it
* zip the entire folder and upload to AWS Lambda
* Plug the 3 main entry points to lambda functions / API Gateway resources:
- `gimel.track` - for tracking events from the client
- `gimel.experiment` - for reporting experiment results for a single experiment
- `gimel.all` - for reporting all experiment results
Watch this screencast for more information
[![Installing Gimel on AWS Lambda Screencast](https://img.youtube.com/vi/FcgKr4OWJpw/0.jpg)](https://www.youtube.com/watch?v=FcgKr4OWJpw&vq=hd1080)
Run your own A/B testing framework. Check out [Alephbet](https://github.com/Alephbet/alephbet).
Gimel is distributed under the MIT license. All 3rd party libraries and components are distributed under their
respective license terms.
Copyright (C) 2016 Yoav Aner
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.