openculinary/infrastructure

Remove postgresql dependency from user-facing API calls

Closed this issue · 2 comments

This may require splitting the api service into separate microservices, or it may be possible within the existing service.

Either way, it'd be good to remove the API's reliance on postgresql for all calls made by the frontend application.

The elasticsearch search engine is a native distributed datastore and as a result is a better choice to back a high-availability service.

From a quick audit, it looks like the following api components depend on relational database functionality:

  • The 'internal' recipe retrieval endpoint at GET /api/recipes/<recipe_id>
    • Could this be replaced with a call to the public GET /api/recipes/<recipe_id>/view endpoint?
  • The redirect endpoint logs to the database
    • This should queue an asynchronous celery task
  • The search endpoint logs to the database
    • This should queue an asynchronous celery task

With the database connection-string removed from the API service as part of openculinary/api#67, this issue is now resolved.