This project, Rinha de Backend 2024 Q1, is a banking system simulation developed in Java using the Spring Boot framework. It provides functionalities such as account management, transaction handling, and balance inquiries. The system is designed to handle multiple accounts and transactions concurrently, ensuring data consistency and reliability. The project uses an SQL database for data persistence and Maven for dependency management. It's designed for developers who want to understand how to build a robust and scalable banking system using Spring Boot and Java.
If you want to check more about of the challenge, please check the Rinha de Backend 2024 Q1.
- Java
- Spring Boot
- Maven
- SQL
- JUnit
- Postgres
- Docker
- Nginx
In this project, you will:
- Learn how to build a banking system using Spring Boot and Java.
- Understand how to handle transactions and account management in a banking system.
- Learn how to use an SQL database for data persistence.
- Understand how to use Docker to run a database.
- Learn how to use Nginx as a reverse proxy server.
Concurrent programming learning:
- Understand how to handle concurrent transactions and account management.
- Learn how to ensure data consistency and reliability in a concurrent environment.
- Understand how to handle multiple requests concurrently.
- Learn how to use locks and synchronization to ensure data consistency.
- Understand how to use transactions to ensure data reliability.
- Learn about problems of deadlocks and how to avoid them.
- Understand how to use thread pools to handle multiple requests concurrently.
Prerequisites:
- Basic knowledge of Java and Spring Boot.
- Basic knowledge of Postgres.
- Basic knowledge of Docker.
- Basic knowledge of Nginx.
- Basic knowledge of Maven.
Study Materials:
- Spring Boot Documentation
- Java Documentation
- Postgres Documentation
- Docker Documentation
- Nginx Documentation
- Concurrency in Java
- Java Multithreading
- Java Thread Pools
- Java Synchronization
- Java Transactions
- Concurrency Programming
- Concurrency Problems
To run this project, you need to have Java 11 and Maven installed on your machine. You also need to have a Postgres database running. You can use Docker to run the database. Here are the steps to install and run the project:
- Clone the repository:
bash git clone https://github.com/franklaercio/rinha-de-backend-java
- Navigate to the project directory:
bash cd rinha-de-backend-2024-q1
- Run the database using Docker:
bash docker-compose up -d
- Run the project using Maven:
bash mvn spring-boot:run
- The project will start running on
http://localhost:8080
. You can use Postman or any other API client to test the endpoints. - To stop the database, run:
bash docker-compose down
- To run the tests, run:
bash mvn test
-
To create a transaction, send a POST request to
http://localhost:8080/clientes/{id}/transacoes
with the following JSON body:{ "valor": "1000", "tipo": "d", "descricao": "test" }
-
To get a statement, send a GET request to
http://localhost:8080/clientes/{id}/extrato
.
If you want to contribute to this project, you can follow these steps:
- Fork the project.
- Create a new branch with your changes:
git checkout -b feature/my-feature
- Save your changes and create a commit message telling what you did:
git commit -m "My changes"
- Push your branch:
-
git push origin feature/my-feature
- Open a pull request with a description of your changes.
- After your changes are approved, they will be merged into the project.
This project is licensed under the MIT License. See the LICENSE file for details.
If you have any questions about this project, please contact me at e-mail.