GithubHelp home page GithubHelp logo

pedrolucasom / datamigration Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 538 KB

:computer: Spring Batch Application to migrate data from .csv files :bookmark_tabs: to a configured database with Docker :whale:.

Java 89.53% Shell 0.78% Dockerfile 9.69%
docker learning docker-compose spring-batch spring-batch-application spring-batch-jobs java-11 spring-batch-example mysql

datamigration's Introduction

Logo: DataMigration

Version documentation maintenance Twitter: PedroLucasOM

๐Ÿ’ป Spring Batch Application to migrate data from .csv files ๐Ÿ“‘ to a configured database with Docker ๐Ÿณ.

Topics

  1. About SpringBatch
  2. About the Project
  3. Author
  4. Contributing
  5. Show your support
  6. License

1. About SpringBatch

It is a framework that uses the Java Virtual Machine and the Spring Ecosystem to build batch applications. By definition, batch systems are systems that realize a process of a finite amount of data without interaction or interruption.

To learn more about this framework, view this article on the Notion: SpringBatch Article

2. About the Project

Implemented Job

It's a job responsible to execute two steps that will import people and banks from a .csv file to a configured datasource mysql.

These are the files that will be imported:

If some person of the file people.csv is invalid with name, email or birthDate wrongs, the person isn't inserted on the datasource. In this case, the application will build a file in the path /files/output with the name invalid-people.csv and put these invalid records represented by id.

Prerequisites

  • docker

Run

With the docker started, execute this command at the project root:

docker-compose up -d --build

Usage

Seeing the valid records in the datasource

Person records:

docker-compose exec database_app mysql -u root -papp#1234 -e "select * from app_batch.person;"

Bank records:

docker-compose exec database_app mysql -u root -papp#1234 -e "select * from app_batch.bank;"

Seeing the invalid records in the generated file

Navigate to /files/output/ inside of project root and open the file invalid-people.csv. You will see the invalid records id if exists.

Stop

To stop correctly:

docker-compose down -v

Remember to execute this command each time that you want change the parameter value.

3. Author

๐Ÿ‘ค Pedro Lucas

4. Contributing ๐Ÿค

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

5. Show your support

Give a โญ if this project helped you!

6. License ๐Ÿ“

Copyright ยฉ 2021 Pedro Lucas.

datamigration's People

Contributors

pedrolucasom avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.