Which database is the right choice for my Electron application that runs offline?

I am currently in the process of selecting a suitable local database for my offline ElectronJS application. The Desktop App will need to perform operations such as adding, updating, deleting, and retrieving data from JSON files locally. Here is an overview of the database structure:

{
  'data':[
    {
      'day':1344546000,
      'transactions':[
         {'time':'blabla', 'value1':'100',...},
         {'time':'blabla', 'value1':'100',...},
         {'time':'blabla', 'value1':'100',...},
      ]
    },
    {
      'day':1344546000,
      'transactions':[
         {'time':'blabla', 'value1':'100',...},
         {'time':'blabla', 'value1':'100',...},
         {'time':'blabla', 'value1':'100',...},
      ]
    },
    ....

  ]
}

The requirement is that this data needs to be stored locally in json file/files, so that if the user closes the app and opens it again, the data can be retrieved seamlessly.

Each day object will contain less than 500 transactions per day

Answer №1

My recommendation would be to consider using PouchDB, which you can find at this link.

PouchDB was specifically designed to empower web developers in creating applications that function seamlessly both offline and online.

If you're looking for an alternative, NeDB seems like a promising option as well. You can check it out at this location.

NeDB serves as an embedded persistent database suitable for Node.js, nw.js, Electron, and browsers. It is entirely written in JavaScript with no reliance on binary dependencies. Its API mirrors a subset of MongoDB's functionality while offering impressive speed.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

searchByTextContentUnderListItemAnchorTag

I would like to utilize the getByRole function for writing my test. However, I am encountering issues when using linkitem or 'link' as the role. It seems that I cannot find the desired element. // encountered error TestingLibraryElementError: The ...

Implementing a TableView in Swift to display data from a sophisticated API JSON response

I encountered an issue while attempting to parse API JSON and present it in a UITableView. The problem arises when I try to access all arrays within this particular API. struct RootParsedData: Codable { var results: [ResultsData] } // MARK: - Re ...

Bootstrap: nav-link remains visible even after a dropdown-item is chosen

I am aiming to accomplish the following - when a dropdown-item from the navbar is selected, I want to execute BOTH of the following actions: Scroll to the div with the specified target id Collapse the navbar back to its initial state (fully rolled up, hi ...

Displaying Image URLs in a Web Form using AJAX

I have been researching how to accomplish this task. So far, my search has led me to uploading an image and then using AJAX to preview it. Is there a way to do the same for an image URL? For example, when a user submits an image URL, can AJAX provide a ...

Fast query in a JSON object

I am facing this JSON data: { "statussalida": "", "registros": [ { "marca": 24, "codigo": 6, "precio": 71.9, "precionormal" ...

Webpack has no issues building the files, however, the JavaScript fails to execute during runtime

I recently upgraded from Webpack v4 to v5, following the documentation and addressing any deprecation messages from the CLI. The build was successful, but when testing the application, I noticed that the JavaScript wasn't running and no errors were be ...

Issues with making cross-domain requests using jQuery and PHP

I have stumbled upon a similar question that has been asked before, but unfortunately, the answer provided did not give me enough guidance to identify where my code is incorrect. I apologize if this question resembles a previously existing one; I have spen ...

Converting all numbers separated by commas to numbers separated by periods in a string using JavaScript

Imagine a scenario where you have a string containing numbers, such as, test() test 12,01% test (12,4) 12.3 s 2 some other text, other text, 2,text Your task is to replace the numbers with decimals instead of commas without altering anything else in the ...

Utilizing JavaScript/jQuery to activate a Bootstrap navbar post-page load

Having trouble triggering Bootstrap's navbar with plain JavaScript/jQuery while using Bootstrap 3.3.6 and jQuery 1.11.3. The data structure provided for my application cannot be modified in terms of adding classes or ids. <ul> <li ...

I am in search of the replicated information found in the specific column

UPDATE tab s SET s.DATA = json_transform(DATA, REPLACE '$.dataFilterDefn.columns[1]' = (SELECT JSON_ARRAYAGG(JSON FORMAT JSON RETURNING CLOB) FROM (SELECT JSON FROM (SELECT j.json || ',' || JSON AS json F ...

Changing a value within a JSON object

I need to update the "Last" Price for MarketName USDT-BTC. How can I change the value from 16750.00000001 to 17000.00000001 and then transmit it through my API? { "success":true, "message":"", "result":[{ "MarketName":"USDT-BTC", "High":16 ...

No elements can be located within the iframe as per Cypress's search

I've been attempting to access elements within an iframe using the guidance provided in this article here, but I'm facing an issue where Cypress is unable to locate anything within the iframe. Below is a snippet of my test code: describe('s ...

Performing a nested JSON filter query in MongoDB

Looking for a way to filter my mongoDB collection to only show students from California. Here is an example of how the collection is structured: { "_id" : ObjectId("112233"), "John" : { "age" : "20", "gender" : "male", "result" : "pass", " ...

Avoid triggering react-query to fetch data on page load, but instead set up a manual refetching mechanism

Currently, I'm utilizing react-query v3.13 for retrieving information from an API. Instead of fetching data immediately when calling useQuery, my goal is to fetch the API periodically starting from a specific point (such as clicking a start button). ...

Is `console.log()` considered a native function in JavaScript?

Currently, I am utilizing AngularJS for my project. The project only includes the angular.min.js file without any additional references to other JavaScript files. The code snippet responsible for sending requests to the server is as shown below: var app = ...

Babel continues to encounter issues with async/await syntax, even with all the necessary presets and plugins installed

I am encountering a compiler error while attempting to compile an async/await function using Babel. Below is the function in question: async function login(username, password) { try { const response = await request .post("/api/login") . ...

Creating a line between two points in raphael

Hello there, I'm looking to create a line between two points in Raphael. Could you please provide me with some examples or guidance on how to achieve this? Thanks a lot!) ...

Vuex - modify store state without changing the original object

Currently, I am encountering an issue where my attempt to duplicate a store object for local modification is causing the original store object to also be changed. The specific method I am using is ...mapState["storeObject"] To illustrate, here is a breakd ...

Trigger function upon closing Bootstrap Modal

I am looking for a way to trigger a function whenever my Bootstrap modal is closed, regardless of whether it's done by clicking off the modal, pressing escape, or clicking the "x" close button. Simply using $("#myModal").on("hidden.bs.modal", functi ...

Performing a password-protected JavaScript Ajax request that includes special characters

Within my JavaScript page, I have implemented an Ajax call shown in the code snippet below. The PHP page resides within a corporate intranet that demands domain authentication (without basic auth). To extract the username (u) and password (p), I am using j ...