diff --git a/0.7.4/actions-overview/index.html b/0.7.4/actions-overview/index.html index 32ba5f11e..75c0bc97d 100644 --- a/0.7.4/actions-overview/index.html +++ b/0.7.4/actions-overview/index.html @@ -4,7 +4,7 @@
At this point, Skytable is primarily in-memory which means that while it uses disk storage for durability, most data is stored in-memory. This is going to change in the near future as the team is working on building a custom log-based engine. As you might understand, this is not an everyday task and as we incorporate new ideas it will take some time. But if you're seeing this in 2023, you can expect us to ship something by Q2 2024.
At this point, Skytable is primarily in-memory which means that while it uses disk storage for durability, most data is stored in-memory. This is going to change in the near future as the team is working on building a custom log-based engine. As you might understand, this is not an everyday task and as we incorporate new ideas it will take some time. But if you're seeing this in 2024, you can expect us to ship something by early 2025.
DDL and DCL transactions use a log-based append-only driver while DML queries use a custom log-based append-only driver that is able to intelligently handle concurrent changes. The team will implement new and updated storage drivers from time to time but you do not have to worry about anything, due to our promise for backwards compatibility (see below).
Skytable is heavily multithreaded enabling incredible vertical scalability and you can witness it for yourself by running benchmarks (or looking at ones that we publish). Clustering and replication are on track to be released soon.
diff --git a/assets/js/e82058ca.5eb66d5a.js b/assets/js/e82058ca.5eb66d5a.js deleted file mode 100644 index efc2fd489..000000000 --- a/assets/js/e82058ca.5eb66d5a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2893],{1675:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>t,contentTitle:()=>d,default:()=>h,frontMatter:()=>i,metadata:()=>c,toc:()=>o});var l=s(4848),r=s(8453);const i={id:"ddl",title:"DDL"},d=void 0,c={id:"blueql/ddl",title:"DDL",description:"DDL short for Data Definition Language is used to create, alter and drop DDL objects such as spaces and models.",source:"@site/docs/blueql/2.ddl.md",sourceDirName:"blueql",slug:"/blueql/ddl",permalink:"/blueql/ddl",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{id:"ddl",title:"DDL"},sidebar:"docs",previous:{title:"Overview",permalink:"/blueql/overview"},next:{title:"DML",permalink:"/blueql/dml"}},t={},o=[{value:"Generic",id:"generic",level:2},{value:"USE",id:"use",level:3},{value:"INSPECT",id:"inspect",level:3},{value:"Space",id:"space",level:2},{value:"CREATE SPACE",id:"create-space",level:3},{value:"Examples",id:"examples",level:4},{value:"ALTER SPACE",id:"alter-space",level:3},{value:"Examples",id:"examples-1",level:4},{value:"DROP SPACE",id:"drop-space",level:3},{value:"Examples",id:"examples-2",level:4},{value:"Models",id:"models",level:2},{value:"Type definitions",id:"type-definitions",level:3},{value:"CREATE MODEL",id:"create-model",level:3},{value:"Examples",id:"examples-3",level:4},{value:"ALTER MODEL ADD",id:"alter-model-add",level:3},{value:"Examples",id:"examples-4",level:4},{value:"ALTER MODEL UPDATE",id:"alter-model-update",level:3},{value:"Examples",id:"examples-5",level:4},{value:"ALTER MODEL REMOVE",id:"alter-model-remove",level:3},{value:"Examples",id:"examples-6",level:4},{value:"DROP MODEL",id:"drop-model",level:3},{value:"Examples",id:"examples-7",level:4},{value:"TRUNCATE MODEL",id:"truncate-model",level:3},{value:"Examples",id:"examples-8",level:4}];function a(e){const n={admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(n.p,{children:["DDL short for Data Definition Language is used to create, alter and drop DDL objects such as ",(0,l.jsx)(n.code,{children:"space"}),"s and ",(0,l.jsx)(n.code,{children:"model"}),"s."]}),"\n",(0,l.jsx)(n.h2,{id:"generic",children:"Generic"}),"\n",(0,l.jsx)(n.h3,{id:"use",children:"USE"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Syntax"}),":","\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"USEspace
is like a database
",id:"a-space-is-like-a-database",level:3},{value:"A model
is like a table
",id:"a-model-is-like-a-table",level:3},{value:"Query language",id:"query-language",level:2},{value:"Transactions",id:"transactions",level:2},{value:"Storage",id:"storage",level:2},{value:"Scalability",id:"scalability",level:2},{value:"Networking",id:"networking",level:2},{value:"Backwards compatibility",id:"backwards-compatibility",level:2}];function c(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["Skytable is a modern NoSQL database that prioritises performance, scalability and reliability while providing a rich and powerful querying interface.\nWe are generally targetting an audience that wants to build high performance, large-scale, low latency applications, such as social networking services,\nauth services, adtech and such. Skytable is designed to work with both ",(0,i.jsx)(n.strong,{children:"structured and semi-structured data"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Our goal is to provide you with a powerful and solid foundation for your application with no gimmicks \u2014 just a solid core. That's why, every component in\nSkytable has been engineered from the ground up, from scratch."}),"\n",(0,i.jsx)(n.p,{children:"And all of that, without you having to be an expert, and with the least maintenance that you can expect."}),"\n",(0,i.jsx)(n.h2,{id:"fundamental-differences-from-relational-systems",children:"Fundamental differences from relational systems"}),"\n",(0,i.jsx)(n.p,{children:"BlueQL kind of looks and feels like using SQL with a relational database but that doesn't make Skytable's internals the same, with the most important\ndistinction being the fact that Skytable has a NoSQL engine! But Skytable's evaluation and execution of queries is fundamentally different from SQL\ncounterparts and even NoSQL engines. Here are some key differences:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["All DML queries are point queries and ",(0,i.jsx)(n.strong,{children:"not"})," range queries:","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"This means that they will either return atleast one row or error"}),"\n",(0,i.jsxs)(n.li,{children:["If you intend to do a multi-row query, then it won't work unless you add ",(0,i.jsx)(n.code,{children:"ALL"}),". ",(0,i.jsx)(n.code,{children:"ALL"})," by itself indicates that you're applying (or selecting) a large range and can be inefficient"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.li,{children:"Multi-row DML queries are slow and inefficient and are discouraged"}),"\n",(0,i.jsxs)(n.li,{children:["You can ",(0,i.jsx)(n.strong,{children:"only"})," query on the primary index, once again because of speed (and the problem with scaling multiple indexes) with a fixed set of operators."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Remember, in NoSQL systems we denormalize."})," Hence, no ",(0,i.jsx)(n.code,{children:"JOIN"}),"s or foreign keys as with many other NoSQL systems"]}),"\n",(0,i.jsxs)(n.li,{children:["A different transactional model:","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"All DDL and DCL queries are ACID transactions"}),"\n",(0,i.jsxs)(n.li,{children:["However, DML transactions are not ACID and instead are efficiently batched and are automatically made part of a batch\ntransaction. The engine decides ",(0,i.jsx)(n.em,{children:"when"})," it will execute them, for example based on the pressure on cache. That's because our\nfocus is to maximize throughput"]}),"\n",(0,i.jsxs)(n.li,{children:["All these differences mean that ",(0,i.jsx)(n.strong,{children:"DDL and DCL transactions are ACID transactions"})," while ",(0,i.jsxs)(n.strong,{children:["DML queries are ACI and ",(0,i.jsx)(n.em,{children:"eventually"})," D"]})," (we call it a ",(0,i.jsx)(n.em,{children:"delayed durability transaction"}),"). This delay however can be adjusted to make sure that the DML\nqueries ",(0,i.jsx)(n.em,{children:"emulate"})," ACID transactions but that defeats the point of the eventually durable system which aims to heavily increase throughput."]}),"\n",(0,i.jsx)(n.li,{children:"The idea of eventually durable transactions relies on the idea that hardware failure even though prominent is still rare,\nthanks to the extreme hard work that cloud vendors put into reliability engineering. If you plan to run on unreliable hardware, then the delay setting (reliability service) is what you need to change."}),"\n",(0,i.jsxs)(n.li,{children:["For extremely unreliable hardware on the other hand, we're working on a new storage driver ",(0,i.jsx)(n.code,{children:"rtsyncblock"})," that is expected to be released in Q1'24"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.li,{children:"The transactional engine powering DDL and DCL queries might often choose to demote a transaction to a virtual transaction which makes sure that the transaction is obviously durable but not necessarily actually executed but is eventually executed. If the system crashes, the engine will still be able to actually execute the transaction (even if it crashed halfway)"}),"\n"]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"We believe you can now hopefully see how Skytable's workings are fundamentally different from traditional engines. And, we know\nthat you might have a lot of questions! If you do, please reach out. We're here to help."})}),"\n",(0,i.jsx)(n.h2,{id:"data-model",children:"Data model"}),"\n",(0,i.jsxs)(n.p,{children:["Just like SQL has ",(0,i.jsx)(n.code,{children:"DATABASE"}),"s, Skytable has ",(0,i.jsx)(n.code,{children:"SPACE"}),"s which are collections of what we call data containers like tables.\nIn Skytable lingo, we don't call them tables but call them ",(0,i.jsx)(n.code,{children:"MODEL"}),"s which enable you to ",(0,i.jsx)(n.em,{children:"define your data model"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["While a ",(0,i.jsx)(n.code,{children:"MODEL"})," is the only data container for now, many more are set to come. Now is a good time to ",(0,i.jsx)(n.a,{href:"https://discord.gg/QptWFdx",children:"join our discord server"})," where you can directly chat with the developers working on Skytable and all our awesome community members."]})}),"\n",(0,i.jsxs)(n.h3,{id:"a-space-is-like-a-database",children:["A ",(0,i.jsx)(n.code,{children:"space"})," is like a ",(0,i.jsx)(n.code,{children:"database"})]}),"\n",(0,i.jsxs)(n.p,{children:["A ",(0,i.jsx)(n.code,{children:"space"})," in Skytable is a collection of ",(0,i.jsx)(n.code,{children:"model"}),"s and other objects, and settings. It is different from a traditional SQL\nDatabase (that is created with SQL's ",(0,i.jsx)(n.code,{children:"CREATE DATABASE"}),") because it is not meant for tables only, but many other things."]}),"\n",(0,i.jsxs)(n.p,{children:['Spaces have "space local" settings that can be set for the space (and will be respected by all its ',(0,i.jsx)(n.code,{children:"models"})," and other items). You'll learn more about this in the section on DDL."]}),"\n",(0,i.jsxs)(n.h3,{id:"a-model-is-like-a-table",children:["A ",(0,i.jsx)(n.code,{children:"model"})," is like a ",(0,i.jsx)(n.code,{children:"table"})]}),"\n",(0,i.jsxs)(n.p,{children:["A ",(0,i.jsx)(n.code,{children:"model"})," in Skytable is like a ",(0,i.jsx)(n.code,{children:"table"})," in SQL but is vastly different because of certain concepts such as:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"DML queries are point and not range queries by default"}),"\n",(0,i.jsx)(n.li,{children:"Restrictions on indexes"}),"\n",(0,i.jsxs)(n.li,{children:["Settings (which can't be created in traditional ",(0,i.jsx)(n.code,{children:"table"}),"s)"]}),"\n",(0,i.jsx)(n.li,{children:"Semi-structured data: with collection types in columns such as lists and dictionaries that violates some of the ideas of\ntraditional schema enforcement"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"query-language",children:"Query language"}),"\n",(0,i.jsxs)(n.p,{children:["Skytable has its own query language BlueQL",(0,i.jsx)("sup",{children:"TM"})," which takes a lot of inspiration from SQL but makes several different (and sometimes vastly different) design choices, focused on clarity, speed, simplicity and most importantly, security."]}),"\n",(0,i.jsxs)(n.p,{children:["For example, Skytable's BlueQL",(0,i.jsx)("sup",{children:"TM"})," ",(0,i.jsx)(n.em,{children:"only"})," allows the parameterization of queries. All the queries you ran previously with strings and numbers directly were only possible because the REPL client smartly does the paramterization behind the scenes. This is done for security. You'll learn more about BlueQL next."]}),"\n",(0,i.jsx)(n.h2,{id:"transactions",children:"Transactions"}),"\n",(0,i.jsx)(n.p,{children:"Skytable's DDL and DCL queries are all ACID transactions. However, DML queries use an AOF-style storage driver that periodically\nrecords, analyses and then intelligently syncs the changes to disk. We're working on making ACID transactions widely available\nacross DML queries as well."}),"\n",(0,i.jsx)(n.h2,{id:"storage",children:"Storage"}),"\n",(0,i.jsx)(n.p,{children:"Skytable's storage engine is collectively called the Skytable Disk Storage Subsystem or SDSS for short. The storage engine uses\nseveral different storage drivers, using ones appropriate for the task. We do not use RocksDB or any other engine but we\nimplement everything in house, engineering them piece by piece."}),"\n",(0,i.jsx)(n.admonition,{title:"Features on track",type:"info",children:(0,i.jsxs)(n.p,{children:["At this point, Skytable is primarily in-memory which means that while it uses disk storage for durability, most data is stored in-memory. ",(0,i.jsx)(n.strong,{children:"This is going to change in the near future as the team is working on building a custom log-based engine."})," As you might understand, this is not an everyday task and as we incorporate new ideas it will take some time. But if you're seeing this in 2023, you can expect us to ship something by Q2 2024."]})}),"\n",(0,i.jsx)(n.p,{children:"DDL and DCL transactions use a log-based append-only driver while DML queries use a custom log-based append-only driver that is able to intelligently handle concurrent changes. The team will implement new and updated storage drivers from time to time but you do not have to worry about anything, due to our promise for backwards compatibility (see below)."}),"\n",(0,i.jsx)(n.h2,{id:"scalability",children:"Scalability"}),"\n",(0,i.jsx)(n.p,{children:"Skytable is heavily multithreaded enabling incredible vertical scalability and you can witness it for yourself by running benchmarks (or looking at ones that we publish). Clustering and replication are on track to be released soon."}),"\n",(0,i.jsx)(n.admonition,{title:"Implementations on track",type:"info",children:(0,i.jsx)(n.p,{children:"Clustering and replication are right on track and we're expecting to deliver them by May, 2024. We'd also like to note that\nclustering is too important to ignore so you can be assured that we're hard at work on it."})}),"\n",(0,i.jsx)(n.p,{children:"Skytable will use atleast as many threads as the number of logical CPUs present on the host. At this moment it is not possible to limit multithreading because multithreading is a part of Skytable's design principles and every attempt is made to exploit available CPU cores to the fullest."}),"\n",(0,i.jsx)(n.h2,{id:"networking",children:"Networking"}),"\n",(0,i.jsx)(n.p,{children:"Skytable uses its own in-house Skyhash protocol for client-server communication. It is built on top of TCP, enabling any programming language that has a\nTCP client to use it without issues. There are three phases in the connection:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Handshake: All auth data, compatibility information and other data is exchanged at this step"}),"\n",(0,i.jsx)(n.li,{children:"Connection mode selection: based on the handshake parameters a connection mode is chosen and the server responds with the chosen exchange mode"}),"\n",(0,i.jsx)(n.li,{children:"Data exchange: This is where the real querying happens"}),"\n",(0,i.jsxs)(n.li,{children:["Termination: there is no special step; just a ",(0,i.jsx)(n.code,{children:"TCP FIN"})]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["You can ",(0,i.jsx)(n.a,{href:"protocol",children:"read more about the protocol here"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"backwards-compatibility",children:"Backwards compatibility"}),"\n",(0,i.jsx)(n.p,{children:"We make the promise to you that no matter what changes in Skytable, you will always be able to:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Upgrade from one version to another without data loss or too many hoops"}),"\n",(0,i.jsx)(n.li,{children:"Export data from Skytable at any time"}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"More technically:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"For minor/patch releases"}),": The minor/patch is just in the name but it indicates that no data migration effort is needed. ",(0,i.jsx)(n.strong,{children:"No minor releases ever need data migration, and any migration is done automatically"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"For major releases"}),": Major releases generally introduce breaking changes (just like the upgrade from ",(0,i.jsx)(n.code,{children:"0.7.x"})," to ",(0,i.jsx)(n.code,{children:"0.8.0"})," is a largely breaking change). ",(0,i.jsx)(n.strong,{children:"Major releases will either automatically upgrade the data files or require you to use a migration tool that is shipped with the bundle"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["Definitions (closely following semantic versioning):","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"A major release"})," is something like ",(0,i.jsx)(n.code,{children:"1.0.0"})," to ",(0,i.jsx)(n.code,{children:"2.0.0"})," or ",(0,i.jsx)(n.code,{children:"0.8.0"})," to ",(0,i.jsx)(n.code,{children:"0.9.0"})," (in development versions, 0.8.0 to 0.9.0 is considered a major version\nbump)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"A minor release"})," is something like ",(0,i.jsx)(n.code,{children:"1.0.0"})," to ",(0,i.jsx)(n.code,{children:"1.1.0"})," or ",(0,i.jsx)(n.code,{children:"0.8.0"})," to ",(0,i.jsx)(n.code,{children:"0.8.1"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"A patch release"})," is something like ",(0,i.jsx)(n.code,{children:"1.0.0"})," to ",(0,i.jsx)(n.code,{children:"1.0.1"})," or ",(0,i.jsx)(n.code,{children:"0.8.0"})," to ",(0,i.jsx)(n.code,{children:"0.8.1"})," (note that in development versions there is no distinction between a minor and patch release)"]}),"\n"]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>o});var i=t(6540);const a={},s=i.createContext(a);function r(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5425],{955:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>s,metadata:()=>o,toc:()=>d});var i=t(4848),a=t(8453);const s={id:"architecture",title:"Architecture"},r=void 0,o={id:"architecture",title:"Architecture",description:"Skytable is a modern NoSQL database that prioritises performance, scalability and reliability while providing a rich and powerful querying interface.",source:"@site/docs/c.architecture.md",sourceDirName:".",slug:"/architecture",permalink:"/architecture",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{id:"architecture",title:"Architecture"},sidebar:"docs",previous:{title:"Client drivers",permalink:"/libraries"},next:{title:"BlueQL",permalink:"/blueql/"}},l={},d=[{value:"Fundamental differences from relational systems",id:"fundamental-differences-from-relational-systems",level:2},{value:"Data model",id:"data-model",level:2},{value:"A space
is like a database
",id:"a-space-is-like-a-database",level:3},{value:"A model
is like a table
",id:"a-model-is-like-a-table",level:3},{value:"Query language",id:"query-language",level:2},{value:"Transactions",id:"transactions",level:2},{value:"Storage",id:"storage",level:2},{value:"Scalability",id:"scalability",level:2},{value:"Networking",id:"networking",level:2},{value:"Backwards compatibility",id:"backwards-compatibility",level:2}];function c(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["Skytable is a modern NoSQL database that prioritises performance, scalability and reliability while providing a rich and powerful querying interface.\nWe are generally targetting an audience that wants to build high performance, large-scale, low latency applications, such as social networking services,\nauth services, adtech and such. Skytable is designed to work with both ",(0,i.jsx)(n.strong,{children:"structured and semi-structured data"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Our goal is to provide you with a powerful and solid foundation for your application with no gimmicks \u2014 just a solid core. That's why, every component in\nSkytable has been engineered from the ground up, from scratch."}),"\n",(0,i.jsx)(n.p,{children:"And all of that, without you having to be an expert, and with the least maintenance that you can expect."}),"\n",(0,i.jsx)(n.h2,{id:"fundamental-differences-from-relational-systems",children:"Fundamental differences from relational systems"}),"\n",(0,i.jsx)(n.p,{children:"BlueQL kind of looks and feels like using SQL with a relational database but that doesn't make Skytable's internals the same, with the most important\ndistinction being the fact that Skytable has a NoSQL engine! But Skytable's evaluation and execution of queries is fundamentally different from SQL\ncounterparts and even NoSQL engines. Here are some key differences:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["All DML queries are point queries and ",(0,i.jsx)(n.strong,{children:"not"})," range queries:","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"This means that they will either return atleast one row or error"}),"\n",(0,i.jsxs)(n.li,{children:["If you intend to do a multi-row query, then it won't work unless you add ",(0,i.jsx)(n.code,{children:"ALL"}),". ",(0,i.jsx)(n.code,{children:"ALL"})," by itself indicates that you're applying (or selecting) a large range and can be inefficient"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.li,{children:"Multi-row DML queries are slow and inefficient and are discouraged"}),"\n",(0,i.jsxs)(n.li,{children:["You can ",(0,i.jsx)(n.strong,{children:"only"})," query on the primary index, once again because of speed (and the problem with scaling multiple indexes) with a fixed set of operators."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Remember, in NoSQL systems we denormalize."})," Hence, no ",(0,i.jsx)(n.code,{children:"JOIN"}),"s or foreign keys as with many other NoSQL systems"]}),"\n",(0,i.jsxs)(n.li,{children:["A different transactional model:","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"All DDL and DCL queries are ACID transactions"}),"\n",(0,i.jsxs)(n.li,{children:["However, DML transactions are not ACID and instead are efficiently batched and are automatically made part of a batch\ntransaction. The engine decides ",(0,i.jsx)(n.em,{children:"when"})," it will execute them, for example based on the pressure on cache. That's because our\nfocus is to maximize throughput"]}),"\n",(0,i.jsxs)(n.li,{children:["All these differences mean that ",(0,i.jsx)(n.strong,{children:"DDL and DCL transactions are ACID transactions"})," while ",(0,i.jsxs)(n.strong,{children:["DML queries are ACI and ",(0,i.jsx)(n.em,{children:"eventually"})," D"]})," (we call it a ",(0,i.jsx)(n.em,{children:"delayed durability transaction"}),"). This delay however can be adjusted to make sure that the DML\nqueries ",(0,i.jsx)(n.em,{children:"emulate"})," ACID transactions but that defeats the point of the eventually durable system which aims to heavily increase throughput."]}),"\n",(0,i.jsx)(n.li,{children:"The idea of eventually durable transactions relies on the idea that hardware failure even though prominent is still rare,\nthanks to the extreme hard work that cloud vendors put into reliability engineering. If you plan to run on unreliable hardware, then the delay setting (reliability service) is what you need to change."}),"\n",(0,i.jsxs)(n.li,{children:["For extremely unreliable hardware on the other hand, we're working on a new storage driver ",(0,i.jsx)(n.code,{children:"rtsyncblock"})," that is expected to be released in Q1'24"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.li,{children:"The transactional engine powering DDL and DCL queries might often choose to demote a transaction to a virtual transaction which makes sure that the transaction is obviously durable but not necessarily actually executed but is eventually executed. If the system crashes, the engine will still be able to actually execute the transaction (even if it crashed halfway)"}),"\n"]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"We believe you can now hopefully see how Skytable's workings are fundamentally different from traditional engines. And, we know\nthat you might have a lot of questions! If you do, please reach out. We're here to help."})}),"\n",(0,i.jsx)(n.h2,{id:"data-model",children:"Data model"}),"\n",(0,i.jsxs)(n.p,{children:["Just like SQL has ",(0,i.jsx)(n.code,{children:"DATABASE"}),"s, Skytable has ",(0,i.jsx)(n.code,{children:"SPACE"}),"s which are collections of what we call data containers like tables.\nIn Skytable lingo, we don't call them tables but call them ",(0,i.jsx)(n.code,{children:"MODEL"}),"s which enable you to ",(0,i.jsx)(n.em,{children:"define your data model"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["While a ",(0,i.jsx)(n.code,{children:"MODEL"})," is the only data container for now, many more are set to come. Now is a good time to ",(0,i.jsx)(n.a,{href:"https://discord.gg/QptWFdx",children:"join our discord server"})," where you can directly chat with the developers working on Skytable and all our awesome community members."]})}),"\n",(0,i.jsxs)(n.h3,{id:"a-space-is-like-a-database",children:["A ",(0,i.jsx)(n.code,{children:"space"})," is like a ",(0,i.jsx)(n.code,{children:"database"})]}),"\n",(0,i.jsxs)(n.p,{children:["A ",(0,i.jsx)(n.code,{children:"space"})," in Skytable is a collection of ",(0,i.jsx)(n.code,{children:"model"}),"s and other objects, and settings. It is different from a traditional SQL\nDatabase (that is created with SQL's ",(0,i.jsx)(n.code,{children:"CREATE DATABASE"}),") because it is not meant for tables only, but many other things."]}),"\n",(0,i.jsxs)(n.p,{children:['Spaces have "space local" settings that can be set for the space (and will be respected by all its ',(0,i.jsx)(n.code,{children:"models"})," and other items). You'll learn more about this in the section on DDL."]}),"\n",(0,i.jsxs)(n.h3,{id:"a-model-is-like-a-table",children:["A ",(0,i.jsx)(n.code,{children:"model"})," is like a ",(0,i.jsx)(n.code,{children:"table"})]}),"\n",(0,i.jsxs)(n.p,{children:["A ",(0,i.jsx)(n.code,{children:"model"})," in Skytable is like a ",(0,i.jsx)(n.code,{children:"table"})," in SQL but is vastly different because of certain concepts such as:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"DML queries are point and not range queries by default"}),"\n",(0,i.jsx)(n.li,{children:"Restrictions on indexes"}),"\n",(0,i.jsxs)(n.li,{children:["Settings (which can't be created in traditional ",(0,i.jsx)(n.code,{children:"table"}),"s)"]}),"\n",(0,i.jsx)(n.li,{children:"Semi-structured data: with collection types in columns such as lists and dictionaries that violates some of the ideas of\ntraditional schema enforcement"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"query-language",children:"Query language"}),"\n",(0,i.jsxs)(n.p,{children:["Skytable has its own query language BlueQL",(0,i.jsx)("sup",{children:"TM"})," which takes a lot of inspiration from SQL but makes several different (and sometimes vastly different) design choices, focused on clarity, speed, simplicity and most importantly, security."]}),"\n",(0,i.jsxs)(n.p,{children:["For example, Skytable's BlueQL",(0,i.jsx)("sup",{children:"TM"})," ",(0,i.jsx)(n.em,{children:"only"})," allows the parameterization of queries. All the queries you ran previously with strings and numbers directly were only possible because the REPL client smartly does the paramterization behind the scenes. This is done for security. You'll learn more about BlueQL next."]}),"\n",(0,i.jsx)(n.h2,{id:"transactions",children:"Transactions"}),"\n",(0,i.jsx)(n.p,{children:"Skytable's DDL and DCL queries are all ACID transactions. However, DML queries use an AOF-style storage driver that periodically\nrecords, analyses and then intelligently syncs the changes to disk. We're working on making ACID transactions widely available\nacross DML queries as well."}),"\n",(0,i.jsx)(n.h2,{id:"storage",children:"Storage"}),"\n",(0,i.jsx)(n.p,{children:"Skytable's storage engine is collectively called the Skytable Disk Storage Subsystem or SDSS for short. The storage engine uses\nseveral different storage drivers, using ones appropriate for the task. We do not use RocksDB or any other engine but we\nimplement everything in house, engineering them piece by piece."}),"\n",(0,i.jsx)(n.admonition,{title:"Features on track",type:"info",children:(0,i.jsxs)(n.p,{children:["At this point, Skytable is primarily in-memory which means that while it uses disk storage for durability, most data is stored in-memory. ",(0,i.jsx)(n.strong,{children:"This is going to change in the near future as the team is working on building a custom log-based engine."})," As you might understand, this is not an everyday task and as we incorporate new ideas it will take some time. But if you're seeing this in 2024, you can expect us to ship something by early 2025."]})}),"\n",(0,i.jsx)(n.p,{children:"DDL and DCL transactions use a log-based append-only driver while DML queries use a custom log-based append-only driver that is able to intelligently handle concurrent changes. The team will implement new and updated storage drivers from time to time but you do not have to worry about anything, due to our promise for backwards compatibility (see below)."}),"\n",(0,i.jsx)(n.h2,{id:"scalability",children:"Scalability"}),"\n",(0,i.jsx)(n.p,{children:"Skytable is heavily multithreaded enabling incredible vertical scalability and you can witness it for yourself by running benchmarks (or looking at ones that we publish). Clustering and replication are on track to be released soon."}),"\n",(0,i.jsx)(n.admonition,{title:"Implementations on track",type:"info",children:(0,i.jsx)(n.p,{children:"Clustering and replication are right on track and we're expecting to deliver them by May, 2024. We'd also like to note that\nclustering is too important to ignore so you can be assured that we're hard at work on it."})}),"\n",(0,i.jsx)(n.p,{children:"Skytable will use atleast as many threads as the number of logical CPUs present on the host. At this moment it is not possible to limit multithreading because multithreading is a part of Skytable's design principles and every attempt is made to exploit available CPU cores to the fullest."}),"\n",(0,i.jsx)(n.h2,{id:"networking",children:"Networking"}),"\n",(0,i.jsx)(n.p,{children:"Skytable uses its own in-house Skyhash protocol for client-server communication. It is built on top of TCP, enabling any programming language that has a\nTCP client to use it without issues. There are three phases in the connection:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Handshake: All auth data, compatibility information and other data is exchanged at this step"}),"\n",(0,i.jsx)(n.li,{children:"Connection mode selection: based on the handshake parameters a connection mode is chosen and the server responds with the chosen exchange mode"}),"\n",(0,i.jsx)(n.li,{children:"Data exchange: This is where the real querying happens"}),"\n",(0,i.jsxs)(n.li,{children:["Termination: there is no special step; just a ",(0,i.jsx)(n.code,{children:"TCP FIN"})]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["You can ",(0,i.jsx)(n.a,{href:"protocol",children:"read more about the protocol here"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"backwards-compatibility",children:"Backwards compatibility"}),"\n",(0,i.jsx)(n.p,{children:"We make the promise to you that no matter what changes in Skytable, you will always be able to:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Upgrade from one version to another without data loss or too many hoops"}),"\n",(0,i.jsx)(n.li,{children:"Export data from Skytable at any time"}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"More technically:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"For minor/patch releases"}),": The minor/patch is just in the name but it indicates that no data migration effort is needed. ",(0,i.jsx)(n.strong,{children:"No minor releases ever need data migration, and any migration is done automatically"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"For major releases"}),": Major releases generally introduce breaking changes (just like the upgrade from ",(0,i.jsx)(n.code,{children:"0.7.x"})," to ",(0,i.jsx)(n.code,{children:"0.8.0"})," is a largely breaking change). ",(0,i.jsx)(n.strong,{children:"Major releases will either automatically upgrade the data files or require you to use a migration tool that is shipped with the bundle"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["Definitions (closely following semantic versioning):","\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"A major release"})," is something like ",(0,i.jsx)(n.code,{children:"1.0.0"})," to ",(0,i.jsx)(n.code,{children:"2.0.0"})," or ",(0,i.jsx)(n.code,{children:"0.8.0"})," to ",(0,i.jsx)(n.code,{children:"0.9.0"})," (in development versions, 0.8.0 to 0.9.0 is considered a major version\nbump)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"A minor release"})," is something like ",(0,i.jsx)(n.code,{children:"1.0.0"})," to ",(0,i.jsx)(n.code,{children:"1.1.0"})," or ",(0,i.jsx)(n.code,{children:"0.8.0"})," to ",(0,i.jsx)(n.code,{children:"0.8.1"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"A patch release"})," is something like ",(0,i.jsx)(n.code,{children:"1.0.0"})," to ",(0,i.jsx)(n.code,{children:"1.0.1"})," or ",(0,i.jsx)(n.code,{children:"0.8.0"})," to ",(0,i.jsx)(n.code,{children:"0.8.1"})," (note that in development versions there is no distinction between a minor and patch release)"]}),"\n"]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>o});var i=t(6540);const a={},s=i.createContext(a);function r(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/runtime~main.534e49fc.js b/assets/js/runtime~main.7a31173a.js
similarity index 98%
rename from assets/js/runtime~main.534e49fc.js
rename to assets/js/runtime~main.7a31173a.js
index 8cca56615..491fc605d 100644
--- a/assets/js/runtime~main.534e49fc.js
+++ b/assets/js/runtime~main.7a31173a.js
@@ -1 +1 @@
-(()=>{"use strict";var e,a,c,b,f,d={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={exports:{}};return d[e].call(c.exports,c,c.exports,r),c.exports}r.m=d,e=[],r.O=(a,c,b,f)=>{if(!c){var d=1/0;for(i=0;iA non-empty space cannot be dropped
-To avoid catastrophic DROP
s, a SPACE
can only be dropped directly if it is non-empty. To drop a non-empty space, you must
+To avoid catastrophic DROP
s, a SPACE
can only be dropped directly if it is empty. To drop a non-empty space, you must
run:
DROP SPACE ALLOW NOT EMPTY <space_name>
insert into myspace.mymodel('sayan', 'pass123', ['myfirstnote'])
You are required to parameterize the query like this:
-use skytable::query;
let query = query!("insert into myspace.mymode(?, ?, [?])", "sayan", "pass123", "myfirstnote")
use skytable::query;
let query = query!("insert into myspace.mymodel(?, ?, [?])", "sayan", "pass123", "myfirstnote")
If you try to run it without any parameters (don't forget that skysh
automatically parameterizes for convenience) the query
won't even compile.
Just so you know, parameterizing involves passing a separate parameter list, with each parameter encoded. You wouldn't need to worry about this because the client driver does all of that for you!
The question is why? The answer is security. SQL-injection vulernabilties have already costed companies a lot, so we don't @@ -146,7 +146,7 @@
INSERT INTO myspace.mymodel(...)
SELECT col1, ... FROM myspace.mymodel WHERE ...
UPDATE myspace.mymodel SET counter += 1 WHERE ...
DELETE FROM myspace.mymode WHERE ...
DELETE FROM myspace.mymodel WHERE ...
Queries include:
diff --git a/deployment/index.html b/deployment/index.html index 62dd9e569..4a0df491f 100644 --- a/deployment/index.html +++ b/deployment/index.html @@ -4,7 +4,7 @@