Simple CRUD collections developed with several languages, without libraries, except the database driver and for basic http routing
- no libraries related to the database, only the database driver and for basic http endpoints
- 1gb ram as maximun
- 8gb of storage as maximun
- 1 node (horizontal scalling)
- no ssr and html, only rest endpoints (json)
- no wrong body will be sent in the stress
- port 8080
- no harcoded values, use env vars
- no oauth2 security
- validate mysql connection
- no cache
- linux compatibility
- docker for easy automation (JRichardsz will dockerize any project)
- no libraries in the workspace. Use npm, maven, nuget, composer, etc
- no specific os and IDE files in the workspace
- health endpoint for validations
- markdown readme with startup steps
- any backend error should not return http status 200. Should return 500
- pool max allowed connection = 100
- number of lines of code
- ram usage
- response time on 500, 10000, 100000 sequential requests
- response time on 500, 10000, 100000 parallel requests
| name | sample | description |
|---|---|---|
| DATABASE_HOST | 192.168.0.10 | mysql database host |
| DATABASE_USER | usr_admin | mysql database user |
| DATABASE_PASSWORD | changeme | mysql database password |
| DATABASE_NAME | demo | mysql database name |
| DATABASE_MAX_CONNECTIONS | 100 | mysql database pool max allowed connections if language support it |
| PORT | 8080 | microservice port |
CREATE TABLE customer (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
address VARCHAR(100) NOT NULL,
phone VARCHAR(15)
);
curl localhost:8080/customer -X POST -d '{"name":"foo", "address":"bar", "phone":"baz"}' -H 'Content-Type: application/json'
response:
{"code":200,"message":"success","content":{"insertId":9}}
curl localhost:8080/customer
response:
{"code":200,"message":"success","content":[{"id":2,"name":"foo","address":"bar","phone":"baz"},{"id":3,"name":"foo3","address":"bar3","phone":"baz3"}]}
curl localhost:8080/customer/9 -X PUT -d '{"name":"foo3", "address":"bar3", "phone":"baz3"}' -H 'Content-Type: application/json'
response:
{"code":200,"message":"success","content":{"affectedRows":1}}
curl localhost:8080/customer/1 -X DELETE
response:
{"code":200,"message":"success","content":{"affectedRows":1}}
curl localhost:8080/health
response:
{"code":200,"message":"success"}
- stats endpoint with ram usage
|
JRichardsz |