Facebook defined a computed prop that downloads the image and meta data.
Someone clicks on the like button of the image:
Database saves event "User Y likes image".
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.
Row-level permissions:
// 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
}
The database has a built-in ORM with deep UI framework (React, Vue, ...) integrations.
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 <>
<img src="{src}" />
<p>
Number of likes: {totalLikes}
</p>
</>
}
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.
Someone shares an image on Facebook:
event
"User X shared image https://example.org/image.jpg".computed
prop that downloads the image and meta data.Someone clicks on the like button of the image:
event
"User Y likes image".computed
prop "total amount of likes" (the computed prop is just a JavaScript function that runsMath.sum()
over the array of "User like" events) => the databse automatically re-runs the computed prop function => the computed prop is automatically updated.The database has a built-in ORM with deep UI framework (React, Vue, ...) integrations.
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.