{"id":25919742,"url":"https://github.com/ardwiinoo/springcsv-compare","last_synced_at":"2025-09-03T03:32:21.229Z","repository":{"id":279716912,"uuid":"939716133","full_name":"ardwiinoo/springcsv-compare","owner":"ardwiinoo","description":"⚡ Compare Populating DataBase Using CSV in Spring Boot with CompletableFuture","archived":false,"fork":false,"pushed_at":"2025-03-06T02:07:51.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T03:20:02.719Z","etag":null,"topics":["completablefuture","java","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ardwiinoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-27T01:43:13.000Z","updated_at":"2025-03-06T02:07:55.000Z","dependencies_parsed_at":"2025-03-06T03:19:26.355Z","dependency_job_id":null,"html_url":"https://github.com/ardwiinoo/springcsv-compare","commit_stats":null,"previous_names":["ardwiinoo/springcsv-compare"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ardwiinoo/springcsv-compare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardwiinoo%2Fspringcsv-compare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardwiinoo%2Fspringcsv-compare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardwiinoo%2Fspringcsv-compare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardwiinoo%2Fspringcsv-compare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ardwiinoo","download_url":"https://codeload.github.com/ardwiinoo/springcsv-compare/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardwiinoo%2Fspringcsv-compare/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273385042,"owners_count":25096023,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["completablefuture","java","spring-boot"],"created_at":"2025-03-03T15:15:57.453Z","updated_at":"2025-09-03T03:32:21.197Z","avatar_url":"https://github.com/ardwiinoo.png","language":"Java","readme":"# springcsv-compare\n\nThis mini project tests the performance of Spring Boot applications using `CompletableFuture` to compare asynchronous and synchronous processing.\n\n## Requirements\n\n-   Java 17\n-   Maven 3\n-   PostgreSQL Database\n\n## Installation\n\n**1. Clone the repository:**\n\n```bash\ngit clone https://github.com/ardwiinoo/springcsv-compare.git\n```\n\n**2. Enter the directory:**\n\n```bash\ncd springcsv-compare\n```\n\n**3. Set up the .env file:**\n\nCopy `.env.example` and create a `.env` file with the following content:\n\n| Key                 | Example Value                              |\n| ------------------- | ------------------------------------------ |\n| `DATABASE_URL`      | `jdbc:postgresql://\u003chost\u003e:\u003cport\u003e/\u003cdbname\u003e` |\n| `DATABASE_USERNAME` | `postgres`                                 |\n| `DATABASE_PASSWORD` | `supersecretpassword`                      |\n\n**4. Run the application**\n\n**5. Access the application:**\n\n-   `csvapp` running on port `8888`\n-   `csvappfuture` running on port `8889`\n\n## Testing with JMeter\n\n**Testing Scenarios:**\n\nIn JMeter, `Thread Group` is used with the following specifications:\n\n**_[ A ]._**\n\n| Key                       | Value |\n| ------------------------- | ----- |\n| Number of threads (users) | 1     |\n| Ramp-up period (seconds)  | 5     |\n| Loop count                | 1     |\n\n**_[ B ]._**\n\n| Key                       | Value |\n| ------------------------- | ----- |\n| Number of threads (users) | 5     |\n| Ramp-up period (seconds)  | 5     |\n| Loop count                | 1     |\n\nTesting is conducted on both `csvapp` and `csvappfuture` services.\n\n**Additional Properties:**\n\nFor more varied comparisons, testing is conducted under two scenarios:\n\n**_[ 1 ]. Service with additional properties:_**\n\n```properties\nspring.jpa.properties.hibernate.jdbc.batch_size=1000\n```\n\nExplanation:\n\n-   `spring.jpa.properties.hibernate.jdbc.batch_size=1000`: Configures Hibernate to batch 1000 JDBC operations, improving performance by reducing database calls.\n\n**_[ 2 ]. Service without additional properties_**\n\nThis property is added to provide variation in testing or performance comparison between services.\n\n**Test Data:**\n\nTesting is performed by simulating HIT endpoints using the POST method with multipart/form-data, uploading a .csv file containing 31,627 records in each request.\n\n**Result**\n\n| Service        | Scenario | Average (ms) | Min (ms) | Max (ms) | Throughput (data/min) |\n| -------------- | -------- | ------------ | -------- | -------- | --------------------- |\n| `csvappfuture` | A + 1    | **2176**     | 2176     | 2176     | 27.6/min              |\n| `csvapp`       | A + 1    | 3175         | 3175     | 3175     | 18.9/min              |\n| `csvappfuture` | A + 2    | **5264**     | 5264     | 5264     | 11.4/min              |\n| `csvapp`       | A + 2    | 43771        | 43771    | 43771    | 1.4/min               |\n| `csvappfuture` | B + 1    | **3652**     | 1835     | 4854     | 34.8/min              |\n| `csvapp`       | B + 1    | 4625         | 4179     | 5079     | 36.7/min              |\n| `csvappfuture` | B + 2    | **16292**    | 9526     | 21714    | 11.7/min              |\n| `csvapp`       | B + 2    | 44653        | 44497    | 44872    | 6.1/min               |\n\n## References\n\n[1] M. H. Aissi, \"Populating DataBase in Spring Boot using CSV files and OpenCsv\" Medium, Jun. 16, 2024. [Online]. Available: https://medium.com/@mohamedhedi.aissi/spring-boot-csv-service-using-opencsv-5afd5c66c125. [Accessed: Feb. 27, 2025].\n\n[2] A. Sahni, \"Difference Between CompletableFuture And Future In Java,\" Hungry Coders, Sep. 14, 2024. [Online]. Available: https://www.hungrycoders.com/blog/difference-between-completablefuture-and-future-in-java. [Accessed: Mar. 01, 2025].\n\n[3] P. Ravvich, \"Hibernate Optimization with @BatchSize and batch_size Configuration,\" Medium, Mar. 2, 2024. [Online]. Available: https://medium.com/jpa-java-persistence-api-guide/hibernate-optimization-with-batchsize-and-batch-size-configuration-579bf759fc05. [Accessed: Mar. 03, 2025].\n\n[4] U. Kumari, \"How to Upload File in JMeter,\" Auriga IT, Jul. 5, 2022. [Online]. Available: https://aurigait.com/blog/how-to-upload-file-in-jmeter/. [Accessed: Mar. 01, 2025].\n\n[5] D. Smith, \"How Does Spring Boot Implement Asynchronous Programming? This Is How Masters Do It!\" Javarevisited, Sep. 11, 2024. [Online]. Available: https://medium.com/javarevisited/how-does-spring-boot-implement-asynchronous-programming-this-is-how-masters-do-it-e89fc9245928. [Accessed: Mar. 02, 2025].\n\n[6] A. Gola, \"Why have a CompletableFuture when we have an ExecutorService?,\" Medium, Feb. 21, 2023. [Online]. Available: https://medium.com/@anil.java.story/why-have-a-completefuture-when-we-have-an-executorservice-which-problem-did-it-solve-f1cf083f834c. [Accessed: Mar. 02, 2025].\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardwiinoo%2Fspringcsv-compare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fardwiinoo%2Fspringcsv-compare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardwiinoo%2Fspringcsv-compare/lists"}