https://github.com/reginaldojunior/interview-cache
Project in Symfony
https://github.com/reginaldojunior/interview-cache
Last synced: 11 months ago
JSON representation
Project in Symfony
- Host: GitHub
- URL: https://github.com/reginaldojunior/interview-cache
- Owner: reginaldojunior
- Created: 2018-04-21T16:24:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-22T16:11:23.000Z (about 8 years ago)
- Last Synced: 2025-01-30T03:41:14.635Z (over 1 year ago)
- Language: PHP
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
EasyTaxi Cache Failover
========
Instructions
------
Hello, this is a simple challenge to test your skills on Symfony, PHPUnit and Cache.
You will see that we have a Controller\CustomerController. It basically gives you the following capabilities:
* Create multiple customers by sending an json to /customers/ endpoint
* Delete all customers
* Consult all customers
So what do you have to do?
* We want you to obtain the reponse of GET customers method from a Cache Server.
* Since you know that this information is immutable until someone hits POST/DELETE customer methods, you shall not hit the Database if cache information is available.
* To let the things a little bit interesting you will have to implement an failover: If Cache Server goes down, you have to hit the Database and this needs to be transparent to our end user, not an Error page!
* Make Unit and Functional tests to ensure everything is working fine.
* You will recieve a thumbs up for good Commit Messages and SOLID knowledge.
Minimum Requirements
---------
* PHP 5.4
* [MongoDB driver](http://php.net/manual/en/mongo.installation.php#mongo.installation.nix)
* Mongo 2.6
* Redis 3
Installation
------
* $ git clone git@bitbucket.org:easytaxi/interview-cachefailover.git
* $ cd interview-cachefailover/
* $ composer install
* $ php app/console server:run
* Open http://127.0.0.1:8000/customers in your browser (check if everything is fine)
* You can test your database operation by doing a POST into /customers/
* $ curl http://127.0.0.1:8000/customers/ -X POST -d '[{"name":"leandro", "age":26}, {"name":"marcio", "age":30}]'
* Then check your MongoDB collection to see if customers were created or just call the action
* $ curl http://127.0.0.1:8000/customers/
Running tests
------
* Install PHPUnit
* In project root run: phpunit