6 ms·
SQLheavy is called "Oracle". You want a feature, it's in there. You don't want a feature? Well, tough, it's in there anyway. From https://www.sqlite.org/about.
by pjc50 10y ago
SQLheavy is called "Oracle". You want a feature, it's in there. You don't want a feature? Well, tough, it's in there anyway.
From https://www.sqlite.org/about.html https://www.sqlite.org/about.html :
"SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine"
Zero-configuration is actually quite an onerous design requirement, as it immediately eliminates most features which shouldn't be on by default. It also eliminates tuning.
Serverless imposes most of the rest of the performance penalty. If you're accessing a sqlite database from a single process, it will most likely be limited by your storage speed. But if you're writing to it from multiple processes, lock contention will quickly become an issue. The obvious technique to improve lock contention is to separate the tables so they can be locked separately, but then you lose the single-file convenience.
That's why that page also says "Think of SQLite not as a replacement for Oracle but as a replacement for fopen()".
- creshal 10y ago> Zero-configuration is actually quite an onerous design requirement, as it immediately eliminates most features which shouldn't be on by default. It also eliminates tuning. It also makes for a stupidly easy to use product. SQLite easily outperforms Postgres in default settings and any "optimized" snippets blog posts cough up for the workload generated by a project I'm working on. I'm seriously tempted to drop support for non-sqlite DB backends, since it's unlikely that the majority our potential customers (SMB environment) could do a better job than that at configuring database servers.
- k__ 10y ago> That's why that page also says "Think of SQLite not as a replacement for Oracle but as a replacement for fopen()". True. Point is, most software has only the need for fopen(), but instead uses something like Oracle.
- projectramo 10y agoI guess I don't mean more features. I just mean I want to write the same code and put in heroku or whatever and have it be ready for production load (10,000s or 100,000s of people hitting it). The code I wrote has already told the machine what I want it to do. I don't want to be involved in figuring out how to make the DB work on a larger load. Being serverless isn't a feature for me. Zeo-configuration is. Can't it handle the server stuff without asking me to type more lines of code? Maybe on heroku?
- dorfsmay 10y agoIf you're into ORMs, then you can do that, use SQLite in dev and switch to PostgreSQL when in prod on heroku. You're basically bashing the Smartcar because it can't pull your 5th wheel heavy trailer.
- projectramo 10y agoI agree with the analogy, but I disagree with "bashing." I don't think its a failure.
- acqq 10y ago> I just mean I want to write the same code and put in heroku or whatever > I don't want to be involved in figuring out how to make the DB work on a larger load. Sqlite definitely wasn't made to fulfill that need of yours. Why do you think it's supposed to give you that?
- projectramo 10y agoI agree it wasn't designed to fulfill that need. I have not claimed (anywhere) that it is supposed to.
- deleted 10y ago[deleted]
- cwyers 10y agoOf course, if RDBMS vendors really cared about compliance with ANSI SQL, swapping out SQLite for Oracle or MS or Postgres would be easy. But they're mostly halfhearted about it.
- creshal 10y agoIncluding SQLite, to be fair. Its dynamic typing can make for rather nasty surprises if you try to import its data into anything else.
- cwyers 10y agoHrm.[1] > (3) SQLite lets me insert a string into a database column of type integer! > This is a feature, not a bug. SQLite uses dynamic typing. It does not enforce data type constraints. Data of any type can (usually) be inserted into any column. You can put arbitrary length strings into integer columns, floating point numbers in boolean columns, or dates in character columns. The datatype you assign to a column in the CREATE TABLE command does not restrict what data can be put into that column. Every column is able to hold an arbitrary length string. (There is one exception: Columns of type INTEGER PRIMARY KEY may only hold a 64-bit signed integer. An error will result if you try to put anything other than an integer into an INTEGER PRIMARY KEY column.) > But SQLite does use the declared type of a column as a hint that you prefer values in that format. So, for example, if a column is of type INTEGER and you try to insert a string into that column, SQLite will attempt to convert the string into an integer. If it can, it inserts the integer instead. If not, it inserts the string. This feature is called type affinity. I did not know that. I am... incredibly horrified. 1) https://www.sqlite.org/faq.html#q3 https://www.sqlite.org/faq.html#q3
- creshal 10y agoIt's why I don't use SQLite without some sort of ORM layer to do the typechecking and to sanely migrate schema changes.
- sovande 10y ago> Zero-configuration ... also eliminates tuning. Not quite, SQLite can be tuned using pragma's, https://www.sqlite.org/pragma.html https://www.sqlite.org/pragma.html which covers most of your tuning needs.