An API server that lets users upload CSV data to perform analytical queries on it, using either ClickHouse or Elasticsearch as the backing database. Built as part of hermannm's master's thesis in Computer Science.
apidefines the API endpoints exposed by the servicedbdefines theAnalysisDBinterface, allowing us to toggle between database implementations while sharing common functionalityclickhouseimplementsAnalysisDBfor ClickHouseelasticsearchimplementsAnalysisDBfor Elasticsearch
csvimplements data type and field delimiter deduction for CSV filesconfigimplements configuration parsing from environment variables
Certain files in the api, clickhouse and elasticsearch packages follow a common pattern:
analysis.gohandles execution of analytical queriesingestion.gohandles data ingestion, i.e. creating new database tables and inserting data into themschema.gohandles storing and fetching of table schemas
-
Install Go (version 1.21.1 or later): https://go.dev/dl/
-
Install Docker: https://docs.docker.com/desktop/
-
Clone the repository:
git clone https://github.com/hermannm/analysis.git -
Create a
.envfile by copying.env.exampleat the root of the repository -
Set the
DATABASEfield in the.envfile to eitherclickhouseorelasticsearch -
Start the database with Docker (in the
analysisdirectory):-
For ClickHouse:
docker compose up clickhouse -
For Elasticsearch:
docker compose up elasticsearch
-
-
Run the server (in the
analysisdirectory):go run .
- Ignite for their technical expertise and guidance provided during the development process