Which NoSQL you had in mind ?
I kind of understand Elastic and Neo4j usecase.
Can you please give an usecase for Kafka - you can raise an issue detailing so in github.
However, I will have to admit that before agreeing new databases - we will be working to make existing databases concrete.
Example: consider `country` and `city` are two tables and are related. City has a foreign key pointing to Country.
In REST API framework : We automatically generate /api/v1/country/:id/city for REST APIs.
In GraphQL API framework :
{Country {CityList} } graphql schema will be automatically generated with resolvers as well.
So they work out of the box
What if the foreign key reference was not an parent-child relationship, instead was a one-to-many relationship between 2 first class entities? For example, Company (1) related to Contacts (many), but they should be accessed as /v1/companies/:id and /v1/contacts/:id.
What if there was a unique constraint on the foreign key reference, so that the relationship becomes a one-to-one relationship? What does the auto-generated REST endpoint look like?
How does it handle join-tables which implement many-to-many relationships? Does it generate the REST end point for the join-table instead?
How does it handle different subcollection semantics? In other words, sometimes we want to treat the entire subcollection as an atomic entity. Other times, we want to create, delete and update individual elements of the subcollection.
How does it support SQL query optimizations?
Good & insightful questions.
>> instead was a one-to-many relationship between 2 first class entities?
This can be treated as virtual relationship between 2 entities and can be linked together in our models. This has to be done manually for now. May be we can do better with our UI tool. I've raised an issue to track this - https://github.com/xgenecloud/xgenecloud/issues/6
one-to-one relationship returns a list instead of an object as of now.
>> How does it handle join-tables which implement many-to-many relationships? Does it generate the REST end point for the join-table instead? In GraphQL : the schema is like a graph traversal so a join query is possible. In REST : no - this will have to be created manually.
>> How does it handle different subcollection semantics? Subcollections can be handled individually i.e in their own routes or in nested routes in REST framework. CUD operations for subcollections in GraphQL i.e nested CUD operations (mutations) are not possible.
>> SQL Query optimisation: N+1 query optimisations are done with data loaders.
Please let us know of any other questions.
https://twitter.com/mamund/status/767212233759657984?lang=en
• MySQL
• PostgreSQL
• MSSQL
• SQL Server
• SQLite
• MariaDB
API Framework also comes with a built in GUI Database Client!
• Point & Click Schema design & migrations
• Works on MacOS, Windows & Linux
Happy to answer any questions and take your feedback.
edit : formatting
How does it compare to Hasura (haven’t used it but seems similar?)
Hasura supports generating GraphQL on Postgres.
XgeneCloud supports generating both REST APIs and GraphQL APIs on all the following databases PostgreSQL, MySQL, MSSQL, SQLite and MariaDB.
The key difference with generated APIs are - with Hasura you would need an extra service running on your backend for model-validations & business logic. This can be a container/microservice or serverless functions. With XgeneCloud, the APIs are not in a blackbox but generated express.js API source code. This would mean adding business logic is as seamless as changing that CRUD function. Since we use express.js (Thank you TJ Holowaychuk) - it is easily extendable as per your needs with npm being a great ecosystem to add middleware, rate-limiting, logging and what not. Also to note, Hasura is on Haskell language (although powerful as a language it is not mainstream language to build your backends on)
In essence,
Backend with Hasura = database + hasura (for crud) + microservice/serverless functions (for business logic)
Backend with XgeneCloud = database + xgene's API framework (regular run of the mill MVCish code with familiar controller->service->model). This means it is quite easy to comprehend, debug and scale.
The webhook pattern employed by say Firebase/Hasura/Any-API-in-a-box is good for only really simple projects or prototyping. But essentially, we believe webhook pattern for even simple CRUD operations is a major anti-pattern plaguing backend frameworks these days. Not to mention, simple things like debugging, SQL transactions become really hard on databases. Having said above, hasura has realtime capabilities which we do not have at the moment.
Serverless Support : Our APIs can be deployed as serverless functions on any cloud platform (we use express.js - which amazingly works as Serverless App). This is a big leap - so there is no more Cloud Platform specific serverless code. We support AWS Lambda, GCP Cloud Function, Azure Function App, Alibaba Function COmpute, Vercel Now.
Database Client :
We ship a fully featured GUI Database based client (much like MySQL Workbench / PgAdmin) that works on all databases - this supports autogenerating up/down SQL schema migrations automatically. It has features to bookmark queries and very intuitive :)
We also ship a full featured API Client (much like postman/insomnia) to maintain your API collections and we also support performance test of APIs via GUI interface.
edit : sentence corrections
Yes, XgeneCloud started as a simple project (Xmysql) that was first showed on HN[1].
[1] Xmysql on HN : https://news.ycombinator.com/item?id=15580914
I have a few questions: how is authentication handled? And does the serverless model mean that a new database connection has to be established every time an API request is made (because connection pools can't be used)?
I can see from the docs that it has signup and signin endpoints, and that it provides some email verification as well. But do those tables get added to the DB? And where does the email get sent from?
Yes, XgeneCloud comes with a fully featured GUI Database Client for schema design and migrations. No more database design from cli or code.
>> how is authentication handled?
We use session based authentication.
>> does serverless model mean that a new database connection has to be established every time an API
Yes, if there are any improvements please suggest it. We were inspired by a commit[1] made to our old solution in Xmysql - which turned REST APIs to Lambda functions.
So, we went onto extend this Serverless function support for all Cloud Platforms (AWS / GCP / Azure / Alibaba / Vercel)
>> But do those tables get added to the DB?
Yes, they gets added to Database.
>> And where does the email get sent from?
we are using nodemailer for mailing and the smtp config can be updated in the corresponding config file for the environment within server/config/ folder.
[1] : https://github.com/o1lab/xmysql/commit/3b279855a2562765975f7...
Is there any way to exclude certain tables or customize what is generated in any way? It seems like it just creates a model for every single table in the database, no matter what. I would love to be able to customize the config to exclude certain tables.
As a side note: I was able to get the GraphQL server working for a small mysql database, but when I tried to hook it up to a larger database, it gave me this error: Error: Field "UagFbDataAggregate.min" can only be defined once.
Yes, for this you can create the project from our GUI Desktop tool to your existing database.
Then from CLI you can just create database models with below
xc gen.apis --model
However, I see there is an issue with our production application and workflow.I 've created an issue to track this.
https://github.com/xgenecloud/xgenecloud/issues/3
>> Field "UagFbDataAggregate.min" can only be defined once
May be this happens when there is clashing column name with an existing column in table.
Also it is absolutely free to use with all features.
With XgeneCloud, you can point to 'ANY' existing or pre-built database schemas and your APIs are ready in seconds. So XgeneCloud introspects the underlying database schema automatically and then generates models, controllers, relational controllers, auth & ACL!
And to stretch the fun factor a bit - you can also point multiple databases as input - we will still manage to generate APIs for all databases together :) - happens within seconds.
Strapi ships an UI to create-edit models, but then I am guessing it is not a complete Database Client. They are targeting headless CMS space - so their needs might be much geared to provide richer datatypes in content management rather than to provide a fully featured database client. Also, I am not sure on how they manage SQL schema migrations (if somebody can help answer that). With XgeneCloud, your schema migrations are automatically generated as and when you make schema changes - this makes the process of backend database design a really seamless and enjoyable experience. What this means is - our desktop tool can be used by any database admins to manage schema migrations easily.
And finally, XgeneCloud's APIs are also Hybrid Serverless functions : which means without changing a single line of code - generated APIs can be deployed as Serverless functions across any Cloud Platform (AWS Lambda, GCP Cloud Functions, Microsoft Azure Function App, Alibaba Function Compute and Vercel Now)!
Two major-major benefits from this :
1. Your APIs also work as Serverless Functions.
2. Then those Serverless Functions are not cloud specific.
So the same code will work on any Serverless Cloud Infrastructure. Your code is not locked in with a Cloud provider.
Plus, we have a built in API client - where you can debug and perform test generated APIs (much like postman)
So with XgeneCloud, you can cover all aspects of API lifecycle management (Database, REST API Server, GraphQL API Server, API Client and Serverless)
Thank you for catching the typo in pricing - we will be fixing this.
A more complex scenario: employees can submit forms. Managers can see forms for their employees, but not those of other managers. Managers need GET/POST/PUT on /forms based on forms.userid AND a relationship defined in manager_employees table. Managerid is not stored in forms because it could change.
Almost every api I’ve ever written has something along those lines. How would that be accomplished in a tool like this?
However, this simple ACL is not intended to encompass all business rules or hierarchies of every application. Hence we decided to provide each router (or controller) with its own middleware handler where these rules can be coded easily.
Explained in below diagram : https://docs.xgenecloud.com/en/v0.5/rest-apis/rest-acl#workf...
It will take about two minutes to try
Github : https://github.com/xgenecloud/xgenecloud
Website : https://xgenecloud.com
Usage: takes just two minutes
npm install -g xc-cli
xc app.install
xc app.open
xc new <project_name>will be adopting in few usecases soon
Notable features including filtering, pagination, and jwt-based authentication.