SQLite在开发中,PostgreSQL在生产 - 为什么不呢? [英] SQLite in development, PostgreSQL in production—why not?

查看:109
本文介绍了SQLite在开发中,PostgreSQL在生产 - 为什么不呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Heroku建议不要因为可能的问题。我是一个SQL noob,你能解释使用不同数据库可能遇到的问题的类型吗?解析方案

不同的数据库不同地解释和遵守SQL标准。如果你想将SQLite中的一些代码复制到PostgreSQL中,那么很有可能它不会立即工作。如果只是基本的查询,那么也许,但是当处理特别的事情时,完全兼容性的可能性非常低。



有些数据库也更符合标准。这是一个类似于互联网浏览器的战场。如果你曾经创建过一些网站,你会知道兼容性是一个痛苦的屁股,必须让它适用于旧版本和Internet Explorer。由于一些数据库比其他数据库更老,有些数据库甚至比标准更老,他们会有自己的做法,他们不能废弃并跳到标准,因为他们会失去对现有大客户的支持(对于名为Oracle的数据库引擎尤其如此)。 PostgreSQL有点像谷歌浏览器,在标准合规性方面相当高,但仍然有一些小小的怪癖。顾名思义,SQLite就是一个轻量级的数据库系统。您可以假设它缺少标准中的一些更高级的功能。

数据库引擎也执行相同的操作。值得了解和理解一个数据库以及它如何工作(比查询层次更深入),以便充分利用它。


Heroku advises against this because of possible issues. I'm an SQL noob, can you explain the type of issues that could be encountered by using different databases?

解决方案

Different databases interpret and adhere to the SQL standard differently. If you were to, say, copy paste some code from SQLite to PostgreSQL there's a very large chance that it won't immediately work. If it's only basic queries, then maybe, but when dealing with anything particular there's a very low chance of complete compatability.

Some databases are also more up to date with the standard. It's a similar battlefield to that of internet browsers. If you've ever made some websites you'd know compatability is a pain in the ass, having to get it to work for older versions and Internet Explorer. Because some databases are older than others, and some even older than the standards, they would've had their own way of doing things which they can't just scrap and jump to the standard because they would lose support for their existing larger customers (this is especially the case with a database engine called Oracle). PostgreSQL is sort of like Google Chrome, quite high up there on standards compliance but still with some of its own little quirks. SQLite is, as the name suggests, a light-weight database system. You could assume it lacks some of the more advanced functionality from the standards.

The database engines also perform the same actions differently. It is worth getting to know and understand one database and how it works (deeper than just the query level) so you can make the most of that.

这篇关于SQLite在开发中,PostgreSQL在生产 - 为什么不呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆