CenterForDigitalHumanities / CenterForDigitalHumanities/rerum_server_nodejs

Consider Caching with the RERUM API and/or MongoDB Atlas

Offen
#224 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
3
Forks
6
Ø Merge
2 T. 47 Min.
Gemergte PRs (30 T.)
4

Beschreibung

Design and implement a caching layer using the following information.

**Use Case**
The RERUM API is a NodeJS Express app that receives incoming requests from client applications on the internet. It is designed as a RESTful CRUD API for linked data on the web, which a JSON database is well suited for. As such the API uses a MongoDB Atlas cloud instance to store the JSON data.

The API is used by many client application. Some of those applications are localhost applications running on a users desktop. Some are web applications that all use the RERUM API and share RERUM’s MongoDB Atlas database. Data is specifically attributed to applications so that their data is identifiable individually as per-application.

**Reasons this Use Case should use a caching layer**
Applications are consistently performing /query, /search, /search/phrase, and /id requests for data, especially data that has been recently created or updated. That API processes these requests through to the MongoDB Atlas instance, receives the response, then sends that response back to the client application that used the endpoint.

**Relevant Technology Documentation**
The development version of the RERUM API is hosted at https://devstore.rerum.io/v1/api and you can find the API docus at https://devstore.rerum.io/v1/API.html. You can find the code at https://github.com/CenterForDigitalHumanities/rerum_server_nodejs.

Note that only registered applications using a Bearer token can write with the RERUM API directly. However, a RERUM Sandbox API exists with the following endpoints you can use without any set up if you want to learn a little about how it works.
- POST https://tinydev.rerum.io/create
- PUT https://tinydev.rerum.io/update

You can read from RERUM already. Here is the endpoint
- POST https://devstore.rerum.io/v1/api/query

You can also search through Annotation oriented data for text in the Annotation bodies. Just provide the text to search for using one of the following endpoints
- POST https://devstore.rerum.io/v1/api/search
- POST https://devstore.rerum.io/v1/api/search/phrase

All data has a URI using the object _id. Those URIs resolve. Here is one.
- GET https://devstore.rerum.io/v1/id/688bc5a1f1f9c3e2430fa99f

The MongoDB Atlas cloud instance is MongoDB 8.2.1. The MongoDB Atlas docs can be found at https://www.mongodb.com/docs/manual/. Search indexes have been applied for the /search and /search/phrase endpoints.

**Implementation Desires**
Do not use Redis or any other such caching library. Use an in-memory caching solution that works locally within the Node.js Express application without external dependencies.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem Repository rerum_server_nodejs und der Entwicklungs-API-Dokumentation und untersuche anschließend die Handler für /query, /search, /search/phrase und /id. Vergleiche wiederholte Lesevorgänge mit MongoDB Atlas und definiere, wie zwischengespeicherte Ergebnisse ungültig gemacht werden sollen, wenn sich Daten ändern. Als erledigt gilt die Aufgabe, wenn die aufgeführten Lesevorgänge innerhalb der Node.js Express-Anwendung einen In-Memory-Cache ohne Redis oder eine andere externe Caching-Bibliothek verwenden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
express, javascript, mongodb, nodejs
Bereich
api, backend, databases, performance
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.