brillout / brillout/research

A new kind of database: event-based + computed props + full-stack reactive + solid business model

Open
#2 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
6
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Someone shares an image on Facebook:
1. Database saves `event` "User X shared image https://example.org/image.jpg".
2. Facebook defined a `computed` prop that downloads the image and meta data.

Someone clicks on the like button of the image:
1. Database saves `event` "User Y likes image".
2. Facebook defined a `computed` prop "total amount of likes" (the computed prop is just a JavaScript function that runs `Math.sum()` over the array of "User like" events) => the databse automatically re-runs the computed prop function => the computed prop is automatically updated.
3. Row-level permissions:
```js
// Read
export async function read({ row, context }) {
if (context.user.role === 'admin') {
return true
}
if( row.rolesAllowed.includes('public')) {
return true
}
// Forbidden
return false
}
// Mutations
export async function write({ row, rowBefore, context }) {
if (row.authorId === context.user.id) {
return true
}
// `rowBefore` is `null` if mutation is `INSERT`
if (rowBefore === null) {
return true
}
return false
}
```
4. The database has a built-in ORM with deep UI framework (React, Vue, ...) integrations.
```jsx
import { useDb } from '@new-kind-of-database/react'

function Image({ id }) {
// `useDb.findOne()` is a React Hook (=> works with Suspense parent loader component)
const { src, totalLikes } = useDb.findOne(id, select: {
src: true,
// We mark `totalLikes` as reactive => when `totalLikes` changes, the ORM
// automaticallly updates the component (using React's hook system)
totalLikes: 'reactive'
})

return <>


Number of likes: {totalLikes}



}
```
Everything is done automaticallly, e.g. the database automaticallly creates a socket connection to the server in order to listen to the corresponding database updates.

This leads to many drastic DX improvement, especially for user-centric highly-reactive apps such as Twitter or Facebook.

Solid business model: offer a SaaS with all bell and whistles (automatic scale, automatic backup, etc.). That said it's of paramount importance to fully support self-hosted, and open sourcing the entire source code (include of the SaaS). We are not afraid of AWS doing a SaaS clone; users will prefer the original over the AWS copy-cat.

If you feel drawn to work on this, let me know. Also, I'm ok with you being the CEO and me only being the "master mind" behind the whole thing.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or concrete entry points. Start by turning the broad database, computed-property, permissions, reactive ORM, and SaaS vision into a scoped proposal with explicit requirements and priorities; done would require an agreed implementation plan rather than a single code change.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
backend, database, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
10/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.