{"id":27086706,"url":"https://github.com/jordanrobo/api_speed_tests","last_synced_at":"2025-04-06T05:36:42.073Z","repository":{"id":242810962,"uuid":"810623069","full_name":"JordanRobo/API_Speed_Tests","owner":"JordanRobo","description":"Three HTTP API's built with PHP, Node.js and Rust to evaluate the performance and speed of each language when it comes to handling concurrent requests and serving content from a database.","archived":false,"fork":false,"pushed_at":"2024-06-10T23:15:51.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-11T01:57:14.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JordanRobo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-05T03:56:59.000Z","updated_at":"2024-06-10T23:17:17.000Z","dependencies_parsed_at":"2024-06-05T05:43:08.708Z","dependency_job_id":"f49039dd-56c0-456f-9440-59870086eb26","html_url":"https://github.com/JordanRobo/API_Speed_Tests","commit_stats":null,"previous_names":["jordanrobo/api_speed_tests"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JordanRobo%2FAPI_Speed_Tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JordanRobo%2FAPI_Speed_Tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JordanRobo%2FAPI_Speed_Tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JordanRobo%2FAPI_Speed_Tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JordanRobo","download_url":"https://codeload.github.com/JordanRobo/API_Speed_Tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247440955,"owners_count":20939233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-06T05:36:41.564Z","updated_at":"2025-04-06T05:36:42.057Z","avatar_url":"https://github.com/JordanRobo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Benchmarking\n\nThis repository contains a comparative analysis of building an API using three different programming languages: Node.js, PHP, and Rust. The purpose of this project is to evaluate the performance and speed of each language when it comes to handling concurrent requests and serving content from a database.\n\n## Overview\n\nThe Headless CMS API is designed to retrieve content from a PostgreSQL database and serve it as JSON responses. The API endpoints are implemented in Node.js, PHP, and Rust, allowing for a direct comparison of their performance characteristics.\n\nEach implementation follows a similar structure and uses the following technologies:\n\n- Node.js: Express.js, pg (PostgreSQL client)\n- PHP: Built-in web server, pg (PostgreSQL client)\n- Rust: Actix Web, Deadpool PostgreSQL, Tokio PostgreSQL\n\n## API Endpoint\n\nThe API exposes a single endpoint:\n\n- `GET /api/data`: Retrieves all content from the database and returns it as a JSON response.\n\n## Performance Testing\n\nTo assess the performance of each language implementation, the repository includes scripts and instructions for conducting benchmarking tests using Apache Bench (ab) or Siege. The tests measure the response times, throughput, and concurrency handling capabilities of each API.\n\nThe benchmarking process involves sending a specified number of requests with varying concurrency levels to each API endpoint and recording the results. The collected data is then analyzed and visualized to compare the performance metrics of Node.js, PHP, and Rust.\n\n## Getting Started\n\nTo run the APIs locally and perform benchmarking tests, follow these steps:\n\n1. Clone the repository: `git clone https://github.com/JordanRobo/API_Speed_Tests.git`\n2. Set up a PostgreSQL database and update the database configuration in each language's implementation.\n3. Install the necessary dependencies for Node.js, PHP, and Rust.\n4. Start the API servers for each language.\n5. Run the benchmarking tests using the provided scripts and tools.\n6. Analyze the results and compare the performance of Node.js, PHP, and Rust.\n\nDetailed instructions for each step can be found in the individual language directories.\n\n## Results\n\nThe benchmarking results, including graphs and tables comparing the performance metrics of Node.js, PHP, and Rust, are presented in the `results` directory. The findings showcase the strengths and weaknesses of each language in terms of handling concurrent requests and serving content efficiently.\n\n## Conclusion\n\nThis project demonstrates the capabilities of Node.js, PHP, and Rust in building a Headless CMS API. By evaluating their performance through benchmarking tests, developers can make informed decisions when choosing a language and framework for their Headless CMS projects. The results highlight the advantages of Rust's performance, concurrency handling, and safety features, making it a compelling choice for building high-performance and scalable Headless CMS backends.\n\nFeel free to explore the code, run the tests, and contribute to the project. Your feedback and suggestions are welcome!\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordanrobo%2Fapi_speed_tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordanrobo%2Fapi_speed_tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordanrobo%2Fapi_speed_tests/lists"}