德鲁伊 oltp oltp

Introduced on SQL Server 2014, the new brand feature In-Memory OLTP a.k.a “Hekaton” is a Main-Memory Database Engine. Developed by Microsoft Research & Paul Larson (Database Research Group at MSFT) this feature have the ability to manage and held tables entirely In-Memory. In this Series we will pass through for all the new concepts and components that makes this New Engine the most excited acquisition of the new SQL Server Version (120).

在SQL Server 2014中引入的新品牌功能In-Memory OLTP(又名“ Hekaton”)是主内存数据库引擎。 此功能由Microsoft Research和Paul Larson(MSFT数据库研究组)开发,具有完全在内存中管理和保存表的功能。 在本系列中,我们将介绍所有使新引擎成为新SQL Server版本(120)的最激动人心的收购的新概念和组件。

Constructed to break myths in the DBMS (Database Management Systems) Hekaton (Hekatonkheires) is a mythological creature with “Hundred Hands and Fifty Heads” and the reason for Microsoft gives his name is because they want to achieve midway 10x-100x of performance, for clarification 10x faster, means that the engine must execute 90% fewer instructions, going further, 100x faster means that SQL Server needs to executes 99% fewer instructions which means a drastic code reduction.

为了打破DBMS(数据库管理系统)中的神话,Hekaton(Hekatonkheires)是一个神话人物,拥有“数百只手和五十个头”。Microsoft之所以给他起名,是因为他们希望获得10x-100x的性能,澄清速度提高了10倍,这意味着引擎必须减少90%的指令执行,进一步,速度提高100倍意味着SQL Server需要减少99%的指令执行,这大大减少了代码量。

The databases systems were designed assuming that the Main Memory (RAM) is expensive and data needs to reside on disk. But now this assumption is no longer valid. The scenario changed over these years, and now in the 21st century the hardware became cheap and the price of the memory is still decreasing. Today is possible to store an entirely database In-Memory, even if the size of the database is greater than 1TB (Terabyte), the reason underneath this, is the x64 architecture that allows a maximum memory of 8 TB in the Windows Server Operate Systems (SO). Traditional Disks are measured in Ms (Microseconds) when the Main-Memory (RAM) is measured in Ns (Nanoseconds), what makes the Main-Memory more attractive and fast for the data access layer perspective.

设计数据库系统时假设主内存(RAM)昂贵且数据需要驻留在磁盘上。 但是现在这个假设不再有效。 该方案改变了这些年了,现在在21 世纪的硬件变得便宜,内存的价格仍然下降。 即使数据库的大小大于1TB(兆字节),今天也可以在内存中存储整个数据库,其背后的原因是x64体系结构,其Windows Server Operate Systems中的最大内存为8TB。 (所以)。 传统磁盘以Ms(微秒)为单位,而主存储器(RAM)以Ns(纳秒)为单位,这使得主存储器在数据访问层方面更具吸引力,而且速度更快。

Figure 1. Disk vs. Memory

图1.磁盘与内存

Like was mentioned before this is a new feature that was built-in the SQLOS (SQL Server Operate System) layer totally optimized to work with the tables entirely In-Memory. In this Series you will understand all the topics bellow and how they work making this the main pillars of this new technology that spent more than 4 year to be developed.

如前所述,这是一项内置于SQLOS(SQL Server操作系统)层的新功能,该功能经过完全优化,可完全在内存中使用表。 在本系列中,您将了解以下所有主题以及它们如何工作,从而使之成为这项花费了四年多时间开发的新技术的主要Struts。

  1. Memory记忆

    • Optimized for Main-Memory (RAM)针对主内存(RAM)进行了优化
    • Hash & Range Index哈希和范围索引
    • No Buffer Pool没有缓冲池
    • Stored on FileStream Technology存储在FileStream技术上
  2. Concurrency并发
    • MVCC – Multi-Version ConcurrencyMVCC –多版本并发
    • No Locks / Lock Manager / Spinlocks无锁/锁管理器/自旋锁
  3. Compilation汇编
    • Compiled in C and Visual C用C和Visual C编译
    • Called By DDL’s由DDL调用
    • More CPI – Cycles per Instruction in CPU更多CPI – CPU中每条指令的周期

Figure 2. In-Memory Architecture Integrated with SQLOS (SQL Server Operate System)

图2.与SQLOS集成的内存中体系结构(SQL Server Operate系统)

The highlighted places are the components that were added in the engine and I will describe shortly how they work.

突出显示的位置是引擎中添加的组件,我将简要介绍它们的工作方式。

  1. Query Interoperability查询互操作性

    • This component connects the Disk-Tables and In-Memory Tables. When SQL Server Engine receives the request with an inner join between this both table types, he’s the responsible to request the data from the Memory Optimized Filegroup and the Data Filegroup (.mdf), putting together all this pieces and returning the result set for the requestor. 该组件连接磁盘表和内存表。 当SQL Server Engine接收到带有这两种表类型之间的内部联接的请求时,他负责从内存优化文件组和数据文件组(.mdf)请求数据,将所有这些部分放在一起并返回结果集。请求者。
  2. Storage Engine for Memory Optimized Tables and Indexes用于内存优化的表和索引的存储引擎
        • Manages user data and indexes, providing transactional operations about the new hash and range indexes.管理用户数据和索引,提供有关新哈希和范围索引的事务性操作。
        • Responsible to compile the new Natively Stored Procedures to native code.负责将新的本机存储过程编译为本机代码。
        • Small component that integrates the SQL Server resources with the functionalities needed to In-Memory Tables and Natively Stored Procedure.小型组件,用于将SQL Server资源与内存表和本机存储过程所需的功能集成在一起。
  3. Memory Optimize Table File Group内存优化表文件组
    • In-Memory table have two possible options, the SCHEMA (Non-Durable) and SCHEMA_AND_DATA (Durable). Using the SCHEMA option SQL Server doesn’t persist anything in disk, this way if server restarts, all the data is lost in this process just remaining the metadata of the table. Using the SCHEMA_AND_DATA, SQL Server needs to guarantee the ACID clause and for this he store the changes in the .ldf file and the data in the special Filegroup called “Memory Optimized”.内存中表有两个可能的选项:SCHEMA(非耐用)和SCHEMA_AND_DATA(耐用)。 使用SCHEMA选项,SQL Server不会在磁盘上保留任何内容,这样,如果服务器重新启动,则在此过程中所有数据都将丢失,仅保留表的元数据。 使用SCHEMA_AND_DATA,SQL Server需要保证ACID子句,为此,他将更改存储在.ldf文件中,并将数据存储在称为“内存优化”的特殊文件组中。

    Natively Compiled Stored Procedures and Schema 本地编译的存储过程和架构

    • The new stored procedure – “Natively Stored Procedure” is invoked by this compiler allowing the business logic faster than the “Interpreted Stored Procedure”. And the reason beneath is because, when codes of T-SQL are executed inside of any DBMS (Database Management Systems), they need to pass to an “Interpreter” phase that converts the T-SQL in machine code. Using the Native Compiled the code is already converted to a machine code and persisted in a .DDL file in the system, what makes Hekaton shines when pass for this Native Compiler.此编译器将调用新的存储过程“本机存储过程”,从而使业务逻辑比“解释性存储过程”更快。 下面的原因是因为,当在任何DBMS(数据库管理系统)中执行T-SQL的代码时,它们都需要传递到“解释器”阶段,该阶段将T-SQL转换为机器代码。 使用本机编译器,该代码已经转换为机器代码,并保存在系统中的.DDL文件中,这使得Hekaton在通过本机编译器时大放异彩。
  4. In-Memory Native Compiler内存中本机编译器
    • Tables and Stored Procedures are compiled in .DDL and accessed using this module of the compiler. 表和存储过程以.DDL编译,并使用编译器的此模块进行访问。

SELECT name, description
FROM sys.dm_os_loaded_modules
WHERE description = 'XTP Native DLL'

Figure 3. In-Memory Tables and Stored Procedures loaded into memory on the server

图3.内存中表和存储过程已加载到服务器的内存中

数据库创建 ( Database Creation )

Creating memory-optimized tables needs to have at least one MEMORY_OPTIMIZED_DATA filegroup in the database. This special filegroup will store the Data & Delta files pairs responsible to maintain and recover the memory-optimized tables.

创建内存优化表需要在数据库中至少有一个MEMORY_OPTIMIZED_DATA文件组。 这个特殊的文件组将存储负责维护和恢复内存优化表的数据和增量文件对。

Creating Database Using T-SQL Syntax

使用T-SQL语法创建数据库


USE master
GOCREATE DATABASE [inmem_SQLShack]
ON PRIMARY
( NAME = N'inmem_SQLShack', FILENAME = N'C:\BaseDados\mdf\inmem_SQLShack.mdf' , SIZE = 400MB , FILEGROWTH = 150MB
),
FILEGROUP [inmem_objects] CONTAINS MEMORY_OPTIMIZED_DATA
( NAME = N'inmem_data', FILENAME = N'C:\BaseDados\mdf\inmem_objects'
)
LOG ON
( NAME = N'inmem_SQLShack_log', FILENAME = N'C:\BaseDados\ldf\inmem_SQLShack_log.ldf' , SIZE = 150MB , FILEGROWTH = 25%
)
GO

Creating Database Using GUI

使用GUI创建数据库

Figure 4. Creating In-Memory Database (IMDB). FileStream File Created Name – inmem_data

图4.创建内存数据库(IMDB)。 FileStream文件创建的名称– inmem_data

Figure 5. Creating Memory Optimized Data Filegroup – inmem_objects

图5.创建内存优化数据文件组– inmem_objects

检查点文件–数据文件和增量文件 ( Checkpoint Files – Data Files and Delta Files )

The checkpoint operation consist in a background task that look to the previous transaction log that wasn’t been covered by the checkpoint process and convert this in a memory-optimized section. Once this process finished the checkpoint is completed logging this in the Data and Delta pair files.

检查点操作包括一个后台任务,该任务查找检查点过程未涵盖的先前事务日志,并将其转换为内存优化部分。 此过程完成后,检查点便已完成将其记录在数据和增量对文件中。

  • Data File – This file contains only insert versions or rows and each file cover a specific timestamp range zone. 数据文件–该文件仅包含插入版本或行,并且每个文件都覆盖特定的时间戳范围区域。
  • Delta File – Store the information about which versions has been deleted. 增量文件–存储有关已删除版本的信息。

This files gave the possibility to break an obstacle in the database systems, all the data access becomes sequential. We will get into more details of this files and the Merge Operation in the next series posts. The files are stored in the MEMORY_OPTIMIZED_DATA that was created previously.

该文件使打破数据库系统中的障碍成为可能,所有数据访问都变成了顺序。 在下一个系列文章中,我们将详细介绍该文件和“合并操作”。 这些文件存储在先前创建的MEMORY_OPTIMIZED_DATA中。

Figure 6. Checkpoint Files – Data & Delta Files

图6.检查点文件–数据和增量文件

结论 ( Conclusion )

There are a few barriers and concepts that we need to understand, but implementing this new feature will change your scenario and vision for this new capability, and now that you have a glimpse of how this new feature can makes you go beyond in your scenario, follow this new series that will contain more than 11 articles and becomes a pro. We will dig all the necessary parts for you implement this feature and have gains never obtained before. See you next week.

我们需要理解一些障碍和概念,但是实施此新功能将改变您的方案和使用此新功能的愿景,现在您可以一目了然地了解此新功能如何使您超越方案,跟随这个新系列,它将包含11篇以上的文章,并成为专业人士。 我们将为您实施此功能挖掘所有必要的部分,并获得从未有过的收获。 下周见。

翻译自: https://www.sqlshack.com/memory-oltp-series-introduction/

德鲁伊 oltp oltp

德鲁伊 oltp oltp_内存中OLTP系列–简介相关推荐

  1. 德鲁伊 oltp oltp_内存中OLTP –招待看门狗的三个关键点–检查点文件

    德鲁伊 oltp oltp In sequence of the first article about the server memory importance, we will check ano ...

  2. 德鲁伊 oltp oltp_内存中OLTP –更快变得更简单!

    德鲁伊 oltp oltp In-memory OLTP is a revolutionary tool introduced on SQL Server 2014. On SQL Server 20 ...

  3. 德鲁伊 oltp oltp_内存中OLTP –娱乐看门狗的三个关键点

    德鲁伊 oltp oltp With the introduction of the in-memory technology, we need to think about what are the ...

  4. 德鲁伊 oltp oltp_内存中OLTP系列–表创建和类型

    德鲁伊 oltp oltp In sequence of the first article of the In-Memory OLTP Series that explained the main ...

  5. 德鲁伊 oltp oltp_内存中OLTP –娱乐看门狗的三个关键点–桶数

    德鲁伊 oltp oltp When creating a hash index in a memory optimized table we need to define a value for t ...

  6. sql oltp_SQL Server中的内存中OLTP的快速概述

    sql oltp This is in continuation of the previous articles How to monitor internal data structures of ...

  7. 德鲁伊 oltp oltp_深入研究内存中OLTP表的非聚集索引

    德鲁伊 oltp oltp With the introduction of Microsoft's new In-Memory OLTP engine* (code name Hekaton) a ...

  8. sql oltp_内存中的OLTP系列– SQL Server 2014上的数据迁移指南过程

    sql oltp In this article we will review migration from disk-based tables to in-memory optimized tabl ...

  9. 德鲁伊 oltp oltp_深入研究内存中OLTP表的哈希索引

    德鲁伊 oltp oltp With the introduction of Microsoft's new In-Memory OLTP engine (code name Hekaton) the ...

最新文章

  1. python5_python5
  2. 【更新指南】Aspose.CAD for Java更新至v19.5版本,实施导出的“警告”通知机制!...
  3. T-SQL查询进阶--基于列的逻辑表达式
  4. Three.js中实现点击按钮添加删除旋转立方体
  5. 工具类软件操作手册_北京数字化的金蝶云团队-北京金普蝶软件科技有限公司...
  6. 故障公告:IIS应用程序池停止工作造成博客站点无法访问
  7. 中音萨克斯指法表图_初学萨克斯一定要了解这6点基础知识
  8. R循环有两个_循环子群
  9. (6)Vivado软件开发流程(第2天)
  10. Airflow 中文文档:使用操作器
  11. cacti监控Memcached
  12. 转 十道海量数据处理面试题与十个方法大总结
  13. maya绝招(1-20)
  14. 干掉visio,这个画图神器太香了
  15. Debian8.8开发环境(五)vim设置文件和vunlde的配置
  16. 基于RSA的公钥基础体系下安全通信实战
  17. 常见的生物识别技术有哪些
  18. zookeeper数据恢复
  19. 使用阿里云下载Docker
  20. matlab中的符号对象与符号运算

热门文章

  1. linux 网络定时断链,客户端连接linux经常间隔性断开链接
  2. python入门教材论坛_GitHub - aisuhua/codeparkshare: Python初学者(零基础学习Python、Python入门)书籍、视频、资料、社区推荐...
  3. 电脑剪贴板在哪里打开_如何把在公司电脑上复制的内容,粘贴到家里的电脑?超好用!...
  4. python获取当前路径和上一层路径_python获取当前路径和上一级路径
  5. android局部布局替换,android – 子片段替换父片段根布局
  6. python 安装容易吗,Python安装的步骤操作其实是件很容易的事
  7. 【Xilinx-Petalinux学习】-02-建立PetaLinux工程
  8. 结构体在固件库中的应用
  9. asp.net 模板页中 控件 ID和Name 的变化
  10. NET中对象的构建过程