14

Is there an RDBMS in existence that does not have SQL. I am not talking of NoSQL and all that XML and Javascript object type of data.

I mean like the database that is not instructed via SQL, but plainly via some API. There should not be an SQL at all.

I mean like how MS had its ADO objects in past and those objects had methods to do all the stuff that SQL does currently.

And I am not asking for an ORM framework. The frameworks just internally make and call SQL code. I dont want that. I want direct function or method calls that directly speak to the database.


I am into the windows platform. The languages I want the RDBMS to support is PHP and Python; and maybe C# too.

The data that I want to manage is everything an everyday SQL-RDBMS handles.

And yes I want the DBMS to manage entity relationships. But I do not want SQL to be in the picture.

I am not doing a project for anyone. Its just a matter of taste or preference to avoid jumping from one level/language to another.

I tried searching on google, but it only results into NoSQL which I dont like.

philipxy
  • 14,867
  • 6
  • 39
  • 83
Jazz
  • 639
  • 1
  • 11
  • 28
  • What is the data you want to manage? What kind of data, how do you access it? What size? Tell more about the application you have in mind, so **edit your question** to improve it and motivate it. – Basile Starynkevitch May 26 '16 at 08:09
  • And why do you want to avoid SQL? Do you need a *relational* database? What operating system, what programming language? Do you have several processes (or clients) accessing *concurrently* the same data? Do you care about [ACID](https://en.wikipedia.org/wiki/ACID) properties? – Basile Starynkevitch May 26 '16 at 08:15
  • 2
    The only _relational_ DBMS that I know that does not use SQL is Rel: https://en.wikipedia.org/wiki/Rel_%28DBMS%29 (it uses `D` as the query language). But can you explain why you do not want to use SQL? You could use some kind of ORM that obfuscates the relational model by introducing a query language on top of that e.g. HQL and similar concepts –  May 26 '16 at 08:27
  • Even with your edits, the question is not specific enough. What is the actual data you want to manage (shopping list, videos, genome)? What is the approximate size (megabytes, petabytes?) and access patterns? Please explain why SQL is not ok for you, but you still require a *relational* database.... – Basile Starynkevitch May 26 '16 at 08:32
  • I finally downvoted & vote for close your question. Even with your edits, it stays really unclear (we still don't know the data & application you have in mind). What is wrong with SQL for you? – Basile Starynkevitch May 26 '16 at 08:38
  • 2
    I simply dont want sql. what is this? some kind of dogma that i have to follow? – Jazz May 26 '16 at 08:43
  • Not a dogma, but a standard. And yes, information technology is built on standards (some of them in the legal sense, many in the informal industrial sense). – Basile Starynkevitch May 26 '16 at 08:44
  • 3
    There is no standard that says that an RDBMS has to have SQL. People just followed suit. – Jazz May 26 '16 at 08:46
  • Likewise, people wanting to write low-level code close to the hardware are mostly coding in C. And it is *very difficult* to make a competitor (but look into Rust, Cyclone) and those who tried to design & implement a competitor to C spent a dozen of years of their life. And we all know that C is imperfect. I could write dozen of pages about C imperfections. – Basile Starynkevitch May 26 '16 at 08:55
  • yup they mostly do C; but it can be done in c++ and lots of BASIC versions too. – Jazz May 26 '16 at 08:59
  • 1
    [Code injection](https://en.wikipedia.org/wiki/Code_injection) arises from not cleaning input before using it as input to further processing. It is not SQL-specific. PS [What is the XY problem?](https://meta.stackexchange.com/q/66377/266284) – philipxy Mar 21 '19 at 06:32
  • philipxy: given that languages(in this case SQL) keep on adding stuff or keep on changing, I would need to update the cleaning code every now and then. I was looking around to not do that forever. – Jazz Mar 25 '19 at 12:56
  • 1
    I stumbled upon this question because I was curios whether there were _relational_ database systems that didn't rely on SQL. Off the top of my head I know of [CastleDB](http://castledb.org/) and [GNU recutils](https://labs.tomasino.org/gnu-recutils/), which are both _databases_ of sorts that allows records to have relationships with other records, but don't use SQL anywhere. – Wernsey Oct 15 '21 at 15:43

4 Answers4

8

I think this is a perfectly reasonable question. Why should you have to use SQL to query a database rather than some low level API? I think there are several reasons - not exactly answers:

  • SQL attempts to provide a standard interface for any database implementation.

  • The cost of parsing SQL is mitigated using prepared statements.

  • Also some developers are strongly database and SQL oriented while others are strongly programming language oriented. Though frequently in opposition these are in many ways complementary skills.

The emergence of "nosql" has revitalised attempts to improve on SQL as in interface at the same time as trying different data layouts on the implementation side. Many of the "nosql" generation are inventing their own query languages. And then you have projects like apache drill trying to make all databases accessible again from a single universal API.

But why not provide a low level interface to avoid the cost of parsing SQL? One answer is that the database's nowadays mitigate that cost by providing prepared statements. The SQL is parsed once and thereafter you have a parameterised query object that more or less represents the low-level API.

You can beat the performance by using a library or hand crafted data structure with hand coded queries for specific use cases. For example if you only need a key/value store you can use a hash map or REDIS or whatever.

There are dangers with parsing SQL at all, such as sql injection. These tend to be avoided by creating an API which translates to SQL in a safe way. For example an ORM or something like LINQ. In theory they could decompose to a low-level API instead and bypass creating SQL all together. This would have to be done on a database by database basis and as you've noticed most databases focus on providing an SQL interface and often don't expose a low level API at all. In my opinion a good database library should be trying to provide an API that would make this possible in principle (i.e. abstract away from SQL) and which could then a candidate for standardising in a given language. Most just wrap SQL and don't try to abstract too far beyond it as it is an uphill struggle.

There is a good quote about SQL in the Berkley DB book in the section "what's so bad about SQL". If you google that you might also hit pages such as this

That's more or less just justifying the question rather than answering it. The closest thing to an answer is probably prepared statements as I said above.

You may end up needing to be database specific in order to optimise a query plan (which is perhaps why you wish for a lower level API in the first place?).

Bruce Adams
  • 4,953
  • 4
  • 48
  • 111
  • Nice answer. My main concern at the time was SQL injection and I was looking for a way that was waaaaaaaay around it. – Jazz Aug 06 '17 at 17:05
3

I don't have an answer but maybe I can clarify the question. A lot of people are talking about SQL as though it is the language that queries the database itself. However, SQL gets translated into a form of relational algebra which then results in processes on the database structure. Relational algebra (at least in theory) is the base level of querying a relational object structure. I too would love to see a relational database completely devoid of SQL. SQL is structured to be written by a keyboard not by code. It's very difficult to write generic SQL writers that deals with things the same way relational algebra is. Relational algebra is orthogonal and can be rearranged without affecting the outcome (only the performance). Things like appending where clauses throughout a codebase at different times and for different reasons is really difficult with a language like SQL but trivial with orthogonal operations like relational algebra.

In fact as I understand it. Relational databases translate SQL into some form of relational algebra so it can be performance optimized. Why not skip the middle man and create relational algebra on the client side and send it directly to the database?

I definitely get that some people are just explaining the landscape and I don't mean to argue against where we are.

I believe there are several language alternatives for databases like postgres but they are VERY non standard and unfortunately using them is risky because they are often not well maintained and they also are not well known so adding developers into your org is challenging.

Hopefully one day someone will make an easy to deploy database that uses something more closely related to relational algebra.

Here is an example of a language you can install on postgres that is closer to relational algebra. http://www.andl.org/

This project (the web page at least) was actually most recently updated 07/2020

Jordan Davidson
  • 419
  • 4
  • 14
  • Answer posts are for answering, comments are for requesting clarifications. Also the question is explicitly off-topic as an external resource request & should be close-voted not answered. As a reqest for advice it lacks sufficient detail & is too broad so should be closed & not answered. [ask] [answer] [help] – philipxy Apr 12 '21 at 22:39
2

Are you asking about a relational database management system (the "relational" adjective is the important one)? Most (and nearly all of them) of them are more or less SQL based (but you might perhaps find some academic software which is not; a_horse_with_no_name mentioned Rel). Read also more about object databases & persistence (and perhaps application checkpointing...) & ACID properties.

If the relational aspect is important for you, why don't you want SQL? It is a well known de facto standard (and yes, we know that SQL has limitations and is not exactly relational). Read also about Datalog.

Perhaps you want some key-value store. Then you could consider gdbm (see documentation here), or REDIS, Kyoto Cabinet, etc... Notice that REDIS is usable from C# (and I did not check for the others) and REDIS is usable from PHP.

Perhaps you want a library, and not a server DBMS; if SQL is acceptable, look into sqlite (you'll use just an API, but that API sometimes need some SQL requests). and sqlite is usable from C# and sqlite is usable from PHP.

Did you look into MongoDB (notice that JSON is not the same as JavaScript) ?

We cannot guess what application you are developing and what data you want to manage!

If you are allergic to SQL, don't want to use the very few academic competitors (like Rel), and still need a relational database system, you'll have to design and build it yourself. This probably would take a dozen of years, and might get you a PhD (if you are successful and publish academic papers). The big issue is to build something efficient, scalable and with ACID properties. You'll need to learn a big lot (notice that RDBMS are large pieces of software: PostGreSQL 9.5 is about 790KLOC of source code, measured by sloccount; MySQL 5.7 is 2180KLOC, including testsuites)

BTW, some programming languages (e.g. opa) claim to deal with both browser-client side, server-side, and database aspects. Perhaps you might try some of them?

Community
  • 1
  • 1
Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
0

You need to have a query language to manipulate the datas inside the database, because of the impedance mismatch.

A database works with a query language like SQL or QBE or QUEL or TUTORIAL D... and theese languages can do set operations while "ordinary" programming languages like C, Ada, Pascal, C++, Java… can only operates in an iterative mode and not in a transaction mode.

Transaction (and every simple SQL order is a transaction) must manipulate a set of data and must not do row by row operation….

SQLpro
  • 3,994
  • 1
  • 6
  • 14