Post Data
{
  "title": "Pathfinder API",
  "date": "2022-06-14T07:00:00.000Z",
  "slug": "pathfinder-app",
  "author": {
    "name": "Lucas Steinmacher"
  },
  "content": "<h2>One of my passion projects.</h2>\n<p>This wasn't always about hiking but has over time morphed into the project over time. I originally wanted to learn how to make a simple image upload so a user could upload an image, it would be stored in some database, then displayed on the client side. Pretty simple yet I had not worked with anything of this nature since I had started my career so I started to plan it out.</p>\n<p>At first I found a naive solution that entailed converting the file/image into a byte array and store it on a database and just retrieve it and convert it back to a file and display it on the client side. The issue with this approach is that the amount of data in the database would grow exponentially and bog down the server with too many images. Alternatively I found that storing the actual byte array in a BLOB storage such as Amazon Simple Storage Service (AWS S3 for short) is a much more efficient way of storing large amounts of images and retrieving them. All the SQL database would need to do is save the pointer, in this case a universal resource locator(URL), to the image and display that on the client side. There are pros and cons to this that I will cover now.</p>\n<p><strong>Pros</strong></p>\n<ul>\n<li>It is easier to keep the BLOB data synchronized with the remaining items in the row.</li>\n<li>BLOB data is backed up with the database. Having a single storage system can ease administration.</li>\n<li>SQL Server Full Text Search (FTS) operations can be performed against columns that contain fixed or variable-length character (including Unicode) data. You can also perform FTS operations against formatted text-based data contained within image fields—for example, Microsoft Word or Microsoft Excel documents.</li>\n</ul>\n<p><strong>Cons</strong></p>\n<ul>\n<li>Retrieving an image from a database incurs significant overhead compared to using the file system.</li>\n<li>Disk storage on database SANs is typically more expensive than storage on disks used in Web server farms.</li>\n</ul>\n<p>After I had implemented the image upload and was successfully showing them on a rudimentary front end I sat on the project for a while to decide what to do with this project.</p>\n<p>I finally came upon the idea for this hike finding app after using other apps that lacked a few features that I desired such as tags for types of hikes such as \"Dog Walking\" or \"Running\" as well as heatmaps to tell which trails are not occupied heavily at the time.  An issue that comes up often on the trails near where I live in the Pacific NorthWest where hiking is quite popular.</p>\n<p>This is an ongoing project that I will work on often and try to keep this site up to date on its status.</p>\n<hr>\n<h4>Features That I want the api to provide</h4>\n<p>Including but not limited to:</p>\n<ul>\n<li>It will have a comprehensive list of hikes, trails, and walks that are in a given distance that the user specifies</li>\n<li>The users may comment, rate, and upload pictures of trails</li>\n<li>The users may contact the admin to request a new trail be added to the database\n<ul>\n<li>The admin will be able to add the trail to the database</li>\n</ul>\n</li>\n<li>Show some sort of \"Traffic\" display that shows how busy the trail is\n<ul>\n<li>For this I will be calling to the <a href=\"http://www.besttime.app\">www.besttime.app</a> API</li>\n<li>This has not been integrated in the current iteration of the app</li>\n</ul>\n</li>\n<li>Show weather of the trails trailhead\n<ul>\n<li>For this the api will call the external api of <a href=\"http://www.openweathermap.org/\">www.openweathermap.org/</a></li>\n<li>Api call being made with Java WebClient</li>\n</ul>\n</li>\n<li>The user will have the ability to filter hikes by\n<ul>\n<li>Length of the trail</li>\n<li>Type of trail</li>\n<li>Distance from the User</li>\n<li>Popularity of the trail (mainly in my mind to find unpopulated hikes.)</li>\n<li>Weather (Or to filter out trails with adverse weather.)</li>\n</ul>\n</li>\n<li>The user may \"Save\" their place on a list of hikes as well as save hikes to their hearted list\n<ul>\n<li>This has not been integrated in the current iteration of the app</li>\n</ul>\n</li>\n</ul>\n<hr>\n<h4>Stack</h4>\n<ul>\n<li>Services written in Java with Spring Boot using Maven</li>\n<li>File storage on AWS S3</li>\n<li>Database is PostgreSQL</li>\n</ul>"
}

Pathfinder API

2022-06-14

4 min read

Written by: Lucas Steinmacher

One of my passion projects.

This wasn't always about hiking but has over time morphed into the project over time. I originally wanted to learn how to make a simple image upload so a user could upload an image, it would be stored in some database, then displayed on the client side. Pretty simple yet I had not worked with anything of this nature since I had started my career so I started to plan it out.

At first I found a naive solution that entailed converting the file/image into a byte array and store it on a database and just retrieve it and convert it back to a file and display it on the client side. The issue with this approach is that the amount of data in the database would grow exponentially and bog down the server with too many images. Alternatively I found that storing the actual byte array in a BLOB storage such as Amazon Simple Storage Service (AWS S3 for short) is a much more efficient way of storing large amounts of images and retrieving them. All the SQL database would need to do is save the pointer, in this case a universal resource locator(URL), to the image and display that on the client side. There are pros and cons to this that I will cover now.

Pros

  • It is easier to keep the BLOB data synchronized with the remaining items in the row.
  • BLOB data is backed up with the database. Having a single storage system can ease administration.
  • SQL Server Full Text Search (FTS) operations can be performed against columns that contain fixed or variable-length character (including Unicode) data. You can also perform FTS operations against formatted text-based data contained within image fields—for example, Microsoft Word or Microsoft Excel documents.

Cons

  • Retrieving an image from a database incurs significant overhead compared to using the file system.
  • Disk storage on database SANs is typically more expensive than storage on disks used in Web server farms.

After I had implemented the image upload and was successfully showing them on a rudimentary front end I sat on the project for a while to decide what to do with this project.

I finally came upon the idea for this hike finding app after using other apps that lacked a few features that I desired such as tags for types of hikes such as "Dog Walking" or "Running" as well as heatmaps to tell which trails are not occupied heavily at the time. An issue that comes up often on the trails near where I live in the Pacific NorthWest where hiking is quite popular.

This is an ongoing project that I will work on often and try to keep this site up to date on its status.


Features That I want the api to provide

Including but not limited to:

  • It will have a comprehensive list of hikes, trails, and walks that are in a given distance that the user specifies
  • The users may comment, rate, and upload pictures of trails
  • The users may contact the admin to request a new trail be added to the database
    • The admin will be able to add the trail to the database
  • Show some sort of "Traffic" display that shows how busy the trail is
    • For this I will be calling to the www.besttime.app API
    • This has not been integrated in the current iteration of the app
  • Show weather of the trails trailhead
  • The user will have the ability to filter hikes by
    • Length of the trail
    • Type of trail
    • Distance from the User
    • Popularity of the trail (mainly in my mind to find unpopulated hikes.)
    • Weather (Or to filter out trails with adverse weather.)
  • The user may "Save" their place on a list of hikes as well as save hikes to their hearted list
    • This has not been integrated in the current iteration of the app

Stack

  • Services written in Java with Spring Boot using Maven
  • File storage on AWS S3
  • Database is PostgreSQL
Back to blogs →

Have an opinion of what I said? Find a typo? Just want to be nice?
Feel free to leave a comment!

You must be logged in to leave a comment.

Comments