Skip to content

Migrate data from Filesystem to Postgres #81

Description

@nelsonic

At present the Node.js MVP saves data to the instance filesystem because that was the simplest way of storing data without having to manage any database.
see: hits-nodejs/lib/db_filesystem.js#L26-L68

This worked well for MVP as it streams the contents of the file each time a request is made and counts the lines in the file as the count. Node.js shines at this because fs.createReadStream is non-blocking.
Anyway, with the migration to phoenix, we need to:

  • write an Elixir Script that parses the data in the filesystem and inserts it into PostgreSQL

Tasks

I estimate that this will take me T4h because I have to:

  • Log-in to the Linode instance and inspect how many directories have been created
    (this is the number of people - GitHub usernames - using the hits badge)
  • zip the data on Linode instance to get it off the instance - because I will be running the Elixir script on my localhost.
  • download the data to localhost
  • unzip data on localhost
  • Download and install Postgres on Mac: https://postgresapp.com/downloads.html
  • write the script
    • insert data into hits_dev PostgreSQL on localhost
  • run the script
  • export the data from hits_dev PostgreSQL on localhost
  • load the data on the remote server

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions