JSON Support in PostgreSQL and Entity Framework
JSON 和JSONB的区别(What's difference between JSON and JSONB data type in PosgresSQL?)
- When should be used specific one?
- What's benefits or disadvantages with respect to other?
- JSON比JSONB的一个小的潜在好处是,它保留了数据的缩进。所以,如果你非常关心你的JSON的格式,或者有一些需要它在一个 特定的结构,JSON可能是有用的。(One small potential benefit of it over JSONB (which we’ll get to next) is that it preserves the indentation of the data coming in. So if you are extremely particular about the formatting of your JSON, or have some need for it in a particular structure, JSON can be useful.)Postgres的JSON类型只是在文本字段上提供了JSON验证。 如果你正在存储某种形式的日志数据,你很少需要查询,JSON可以正常工作。 因为它非常简单,所以写入吞吐量会更高。 对于任何更复杂的东西,建议使用JSONB。(Postgres’ JSON type simply provides JSON validation on a text field. If you’re storing some form of log data you rarely need to query, JSON can work fine. Because it’s so simple, it will have a lot higher write throughput. For anything more complex, I’d recommend using JSONB, which is covered below.)
- The B stands for better.JSONB是JSON的二进制表示,这意味着它不仅仅是文本,而是压缩和更高效的存储。它允许嵌套结构,使用基本的数据类型,并有一些内置的函数来处理它。尽管类似于hstore的最好的部分是索引。在JSONB列上创建GIN索引将为该JSON文档中的每个键和值创建一个索引。在文档中嵌套的能力意味着JSONB在大多数情况下优于hstore。
总结:
JSONB - 在大多数情况下
JSON - 如果你只是在处理日志,通常不需要查询,并使用更多的审计跟踪
hstore - 对于基于文本的键值看起来可以正常工作,但是一般来说JSONB在这里仍然可以工作得很好
参考文章:
1.Entity Framework: Storing complex properties as JSON text in database
3.When to use unstructured datatypes in Postgres–Hstore vs. JSON vs. JSONB(重点)
JSON Support in PostgreSQL and Entity Framework的更多相关文章
- Entity Framework 6 vs NHibernate 4
This article is dedicated to discussing the latest releases of the NHibernate and Entity Framework. ...
- Entity Framework + WCF REST JSON Service
利用EF 和WCF 建立一个REST JSON Service. 首先我们要下载一个Visual Studio 的Template 叫 "ADO.NET C# POCO Entity Gen ...
- Entity Framework 6连接Postgresql、SQLite、LocalDB的注意事项和配置文件
Postgresql Postgresql支持Code First的方式自动生成表,不过默认的模式是dbo而不是public,而且还可以自动生成自增主键. <?xml version=" ...
- Entity Framework - PostgresQL CodeFirst
经过几年的更新及业界对Entity Framework 的认同. 现在 EF 可以支持的数据库越来越多了.而PostgresQL 数据库现在也可以使用code first的方式来创建数据库了. 不多说 ...
- .NET Core开发日志——Entity Framework与PostgreSQL
Entity Framework在.NET Core中被命名为Entity Framework Core.虽然一般会用于对SQL Server数据库进行数据操作,但其实它还支持其它数据库,这里就以Po ...
- Newtonsoft.Json高级用法,json序列号,model反序列化,支持序列化和反序列化DataTable,DataSet,Entity Framework和Entity,字符串
原文地址:https://www.cnblogs.com/yanweidie/p/4605212.html 手机端应用讲究速度快,体验好.刚好手头上的一个项目服务端接口有性能问题,需要进行优化.在接口 ...
- PostgreSQL Entity Framework 自动迁移
1.依次添加NuGet包 EntityFramework.Npgsql.EntityFramework6.Npgsql,会自动生成一些配置文件,不过缺少数据库驱动的配置节点: <system.d ...
- Entity Framework 6.0 Tutorials(6):Transaction support
Transaction support: Entity Framework by default wraps Insert, Update or Delete operation in a trans ...
- Entity Framework Tutorial Basics(33):Spatial Data type support in Entity Framework 5.0
Spatial Data type support in Entity Framework 5.0 MS SQL Server 2008 introduced two spatial data typ ...
随机推荐
- MySQL高级知识(十)——批量插入数据脚本
前言:使用脚本进行大数据量的批量插入,对特定情况下测试数据集的建立非常有用. 0.准备 #1.创建tb_dept_bigdata(部门表). create table tb_dept_bigdata( ...
- WPFのDecorator 、Adorner和AdornerDecorator
Decorator 和 Adorner 它们都有“装饰品”的意思. Decorator类负责包装某个UI元素,以提供额外的行为.它有一个类型为UIElement的Child属性,其中含有待包装的内容. ...
- SpringMVC Controller 返回值几种类型
SpringMVC Controller 返回值几种类型 2016年06月21日 19:31:14 为who而生 阅读数:4189 标签: Controller 返回值类型spring mvc 更多 ...
- rabbitmq官方的六种工作模式
1.RabbitMq1.1介绍RabbitMQ是一个消息代理:它接受并转发消息.你可以把它当成一个邮局:当你想邮寄信件的时候,你会把信件放在投递箱中,并确信邮递员最终会将信件送到收件人的手里.在这个例 ...
- extjs 中的一些鲜为人知的属性(深渊巨坑)
1. new Ext.form.FormPanel 组件中,去除边框属性为:baseCls:'my-panel-no-border', 2.当 new Ext.form.FormPanel 嵌套b ...
- PyCharm 中使用 Pylint 控制代码质量
1) Pylint安装 - Windows下: 直接在 cmd 下使用 pip install pylint 即可(如果 pip 不可用,首先安装最新版 Python,会默认安装 pip,或者找到 p ...
- 解决 Vim 的 quickfix 插件错误信息乱码问题
将以下代码插入 vim 配置文件即可, function! QfMakeConv() let qflist = getqflist() for i in q ...
- Linux 内核协议栈 学习资料
终极资料 1.<Understanding Linux Network Internals> 2.<TCP/IP Architecture, Design and Implement ...
- 完成了Coursera的一个机器学习课程
终于完成了这个课程,从开始学习,到现在差不多过了一年的时间,中间由于一些原因耽搁了,最终还是完成了,记录一下!
- Rommel - C# 浅谈 接口(Interface)的作用
鉴于网上太多太多的对C# 接口的误解,想来想去还是自己做一个完美的接口 篇章 继承"基类"跟继承"接口"都能实现某些相同的功能,但有些接口能够完成的功能是只用基 ...