Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(anna): Added a two-level data model for the layer zero key-value store. #1246

Merged

Conversation

rohitkulshreshtha
Copy link
Contributor

The data model supported by the layer 0 key-value store is analogous to the following JSON:

{
   "sys": [
      "members": [
              "key": "value"
      ]
   ],
   "usr": [
       "table_a": [
           ...
       ],
       "table_b": [
           ...
       ],

   ]
}

A single TableMap can model sys or usr. We're only planning for these two namespaces for now, so no higher-level lattices allow for more namespaces.

Initially, I started with support for deleting an entire table efficiently, but I have decided to drop that until needed. If it isn't needed in practice, the lack of a sharp operation that can delete an entire table leads to a safer system. It also simplified the code a fair bit.

The tests may feel like they're testing lattice merging (and therefore redundant), but I wrote these to convince myself that the type signatures of the data model are working. I may remove them in the future (or not!).

… store.

The data model supported by the KV store is analogous to the following JSON:

```json
{
   "sys": [
      "members": [
              "key": "value"
      ]
   ],
   "usr": [
       "table_a": [
           ...
       ],
       "table_b": [
           ...
       ],

   ]
}
```

A single `TableMap` can be used to model `sys` or `usr`. We're only planning for these two namespaces for now, so there is no higher-level lattices to allow for more namespaces.

Initially, I started with support for deleting an entire table efficiently: but I have decided to drop that until the need arises. If it isn't needed in practice, the lack of a sharp operation that can delete an entire table leads to a safer system. It also simplified the code a fair bit.

The tests may feel like they're testing lattice merging (and therefore redundant), but I wrote these to convince myself that type signatures of the data model are working. I may remove them in the future (or not!).
Copy link

cloudflare-workers-and-pages bot commented May 29, 2024

Deploying hydroflow with  Cloudflare Pages  Cloudflare Pages

Latest commit: 40f187b
Status:⚡️  Build in progress...

View logs

Copy link
Member

@MingweiSamuel MingweiSamuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

datastores/gossip_kv/server/model.rs Outdated Show resolved Hide resolved
@rohitkulshreshtha rohitkulshreshtha merged commit 7e0e7dc into anna_v2 May 29, 2024
10 of 11 checks passed
rohitkulshreshtha added a commit that referenced this pull request Jun 5, 2024
… store. (#1246)

The data model supported by the layer 0 key-value store is analogous to
the following JSON:

```json
{
   "sys": [
      "members": [
              "key": "value"
      ]
   ],
   "usr": [
       "table_a": [
           ...
       ],
       "table_b": [
           ...
       ],

   ]
}
```

A single `TableMap` can model `sys` or `usr`. We're only planning for
these two namespaces for now, so no higher-level lattices allow for more
namespaces.

Initially, I started with support for deleting an entire table
efficiently, but I have decided to drop that until needed. If it isn't
needed in practice, the lack of a sharp operation that can delete an
entire table leads to a safer system. It also simplified the code a fair
bit.

The tests may feel like they're testing lattice merging (and therefore
redundant), but I wrote these to convince myself that the type
signatures of the data model are working. I may remove them in the
future (or not!).
rohitkulshreshtha added a commit that referenced this pull request Jun 7, 2024
… store. (#1246)

The data model supported by the layer 0 key-value store is analogous to
the following JSON:

```json
{
   "sys": [
      "members": [
              "key": "value"
      ]
   ],
   "usr": [
       "table_a": [
           ...
       ],
       "table_b": [
           ...
       ],

   ]
}
```

A single `TableMap` can model `sys` or `usr`. We're only planning for
these two namespaces for now, so no higher-level lattices allow for more
namespaces.

Initially, I started with support for deleting an entire table
efficiently, but I have decided to drop that until needed. If it isn't
needed in practice, the lack of a sharp operation that can delete an
entire table leads to a safer system. It also simplified the code a fair
bit.

The tests may feel like they're testing lattice merging (and therefore
redundant), but I wrote these to convince myself that the type
signatures of the data model are working. I may remove them in the
future (or not!).
rohitkulshreshtha added a commit that referenced this pull request Jun 20, 2024
… store. (#1246)

The data model supported by the layer 0 key-value store is analogous to
the following JSON:

```json
{
   "sys": [
      "members": [
              "key": "value"
      ]
   ],
   "usr": [
       "table_a": [
           ...
       ],
       "table_b": [
           ...
       ],

   ]
}
```

A single `TableMap` can model `sys` or `usr`. We're only planning for
these two namespaces for now, so no higher-level lattices allow for more
namespaces.

Initially, I started with support for deleting an entire table
efficiently, but I have decided to drop that until needed. If it isn't
needed in practice, the lack of a sharp operation that can delete an
entire table leads to a safer system. It also simplified the code a fair
bit.

The tests may feel like they're testing lattice merging (and therefore
redundant), but I wrote these to convince myself that the type
signatures of the data model are working. I may remove them in the
future (or not!).
rohitkulshreshtha added a commit that referenced this pull request Jun 20, 2024
… store. (#1246)

The data model supported by the layer 0 key-value store is analogous to
the following JSON:

```json
{
   "sys": [
      "members": [
              "key": "value"
      ]
   ],
   "usr": [
       "table_a": [
           ...
       ],
       "table_b": [
           ...
       ],

   ]
}
```

A single `TableMap` can model `sys` or `usr`. We're only planning for
these two namespaces for now, so no higher-level lattices allow for more
namespaces.

Initially, I started with support for deleting an entire table
efficiently, but I have decided to drop that until needed. If it isn't
needed in practice, the lack of a sharp operation that can delete an
entire table leads to a safer system. It also simplified the code a fair
bit.

The tests may feel like they're testing lattice merging (and therefore
redundant), but I wrote these to convince myself that the type
signatures of the data model are working. I may remove them in the
future (or not!).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants