Sign inSign up

koroslak/nifi

By koroslak

•Updated over 6 years ago

Image
0

384

koroslak/nifi repository overview

⁠What is it ?

It's a framework for small scale out-of-the-box BI infrastructure.

Each compoment can be replaced by a technology of you choice. Don't like postgres ? replace it with Oracle. The principles will still be the same.

⁠How to run it

  1. Install docker https://docs.docker.com/install/⁠
  2. From root folder run. docker-compose up
  3. Wait until the containers are running.
  4. Done :)
ContainerLinkCredentialsNote
NiFihttp://127.0.0.1:8080/nifi⁠NoneTODO: OpenLDAP in the future
Postgreshttp://127.0.0.1:5432⁠postgres:secret123to view the schema I added a https://dbschema.com/⁠ project. /postgres/dwh/dbschema_dwh_project.dbs
Metabasehttp://127.0.0.1:3000⁠You create your own
PgAdminhttp://127.0.0.1:8090⁠admin:admin
openldaphttp://127.0.0.1:38999⁠None
jira-apihttp://127.0.0.1:8000⁠NoneMock of https://<your server>/rest/api/3/ API
pipedrive-apihttp://127.0.0.1:8100⁠NoneMock of https://developers.pipedrive.com/docs/api/v1/⁠ API
restcountries-apihttp://127.0.0.1:8200⁠NoneMock of https://restcountries.eu/⁠ API

⁠Core Components

⁠NiFi
  • Fetch data
  • Store them in Postgres
  • Execute Postgres stored procedures
  • Single point of scheduling/dataflow
⁠Postgres
  • Data store - staging
  • Clean integrated data - core
  • Reports - mart
  • +Transformations between areas
⁠Metabase
  • View Reports/tables stored in mart
  • Make aggregates/filters
  • Share them via URLs

⁠NiFi

  • I'm using NiFi as a batch ingest tool and orchestrator for Data Warehouse.

⁠Principles

From 2 years of working and trying to make workflow as generic, modularized and simple to understadnd here are my principles I used to archive it.

  1. Every logical step should output only 1 flow file. e.g. One Processor group that ingests data from a source system and outputs one flow file into success or error connection.
  2. Speficy credentials only once. e.g. If you use InvokeHTTP processor, create a workflow so that there won't be 2 InvokeHTTP processors with the same credentials set.
  3. If you can, create a Processor group that will act as a blackbox. Show the user what's going on without going to unnecessary detail.

⁠Naming Convention:

ComponentNaming ConventionNote
flow file attriutelowerCamelCasethisIsAnExampleForYou
connectionall lovercase separated with spacethis is an example for you
processor groupInitial CapsThis Is An Example For You
input portinalways use only this one name
output portsuccess, erroruse always only these two names
connectionsuccess, error (whenever possible)breaking rule example: Parsing log files and routing each line on log level: Info, Warn, Error

⁠Postgres

⁠3 schemas
NameUsage
stagehere are data loaded as is from source systems
corecleaned integrated (foreign keys) data
martvery flat tables, reports
⁠4 table types (defined by postfixes)
PostfixNameusage
_iinputcontains temporary data used during etl
_ttodayalways has current data
_ihinput historizedscd2 historization of _i tables
_dexact copy (snapshot) of _i tablesbackup
withoput_postfixreportOnly in mart schema (will be changed to _r)

⁠Metabase

Tag summary

Content type

Image

Digest

Size

1.5 GB

Last updated

over 6 years ago

docker pull koroslak/nifi