Software Engineering Excellence: MVP for a geo-distance, weighted ranking algorithm
Story of hackaton and development
Inspiration
Create the best performans for amaizing user experience.
What it does
- Find the best service providers using ranging algorithm, that takes into accont distance and provider's scores.
- Change server providing description, picture score or maximum driving distance by provider id.
How we built it
- Figure out app atributes we can preprocess once and then use. For example we enrich longitute and latituge with potGis Point, which reduced the time required for calculating distances between two points.
- Found a tree alghorithm to filter as much unpossible pairs (postcode - service provider) as possible, but then found the same concept withing SQL alghorithm and choose the last one :) The performance became 10 times faster.
- Save the result (2) as a pre-calculated table with all possible PLZ for the every service provider (with a 5km tolerance) in order to cover the worse cases.
- Write an scripts to calculate ranged list of service provider by given PZL and for abdating service provider & (3) tables.
- Indexes metter for faster search. 9s vs 100ml for the table with 120M rows.
- Add backend...
- Frontend...
- And a little bit (a lot of) beauty for the users
Challenges we ran into
- It difficult (very very long and unproductive) to directly calculate matrix of distances with 68000x8000 dimention from nummerical point of view.
- All PLZ neighbourhoods have different squares and form, therefore they can not be represented with mean cercles or squares.
- Learn frontend, backend, sql and docker within a day.
- Calculating even optimized matrix of sever providers over poscodes and then inserting the data to the database during the start of docker-compose was a tough task for our laptops.
Accomplishments that we're proud of (quotes)
- It works.
- I've seen frontent and backend first time in my live and developed them in JS.
- I've found out the power of indexes in SQL.
- User dont have to wait 5 hours to recieve the answer))) they dont have to wait even 5s either.
- We didn't give up... and didnt sleep.
What we learned
- JS, HTML, CSS, Docker, SQL, Node.js
- Not to give up and not to give in... (to sleep)
What's next for Kak-nibud
- Sleep :)
- Analyse the experience and decide what skills we need to improve
- Improve skils :)
- Repeat
In case of project: UI, more features, dags for data predprocessing and scaling
App TIY: Try It Yourself
How to start the app
- Clone the project
- Run
npm install - To start
docker-compose up -d --build - To stop
docker-compose stop - And then open http://localhost:3000/ in browser.
How the application get data?
Database is filling when you run the application for the first time. The valume of database is about 1.3Gb. Look at postgreSQL container log in order to see whether process is running. This process might have time (10 min), but we'll explane how to make it better.
Log in or sign up for Devpost to join the conversation.