Kinto / Kinto/kinto.js

Allow defining local indexes.

Open
#66 6 comments 0 reactions 0 assignees View on GitHub
enhancement stale
Dominant language
TypeScript
Stars
330
Forks
75
Avg merge
3d 5h
Merged PRs (30d)
4

Description

Filtering and ordering being currently achieved in-memory, the performance penalty can be important in case of large datasets.

We should allow users to create indexes on fields and rely on native IDB queries to speed things up.

Suggested API:

``` js
const db = new Kinto();
const tasks = db.collection("tasks");
tasks.ensureIndexed("label", "done");
```

Or even:

``` js
const tasks = db.collection("tasks", {
indexes: ["label", "done"]
});
```

Thoughts? @Natim @leplatrem

Contributor guide

Open the contributing guide

Research direction

Start at the collection API and the current in-memory filtering and ordering path, then inspect how native IndexedDB queries are used. Decide between the suggested ensureIndexed API and collection options, and confirm that indexed fields are used for filtering and ordering on large datasets.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.