Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| arch:orm-nosql [2021/10/17 18:56] – created dakireev | arch:orm-nosql [2026/08/29 07:59] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== ORM' for NoSQL: main challenges and solutions ==== | ==== ORM' for NoSQL: main challenges and solutions ==== | ||
| + | |||
| + | Name: Danil Kireev | ||
| === Introduction === | === Introduction === | ||
| + | |||
| Choosing a database for your application is always a challenge: do you want safety of SQL or speed of NoSQL, but what if you could combine the speed of NoSQL and safety of SQL? Well, ORMs for NoSQL can provide precisely that! But why aren't they as popular as ORMs for SQL? Moreover, why aren't there as many ORMs for NoSQL as there are ORMs for SQL? | Choosing a database for your application is always a challenge: do you want safety of SQL or speed of NoSQL, but what if you could combine the speed of NoSQL and safety of SQL? Well, ORMs for NoSQL can provide precisely that! But why aren't they as popular as ORMs for SQL? Moreover, why aren't there as many ORMs for NoSQL as there are ORMs for SQL? | ||
| === Main Part === | === Main Part === | ||
| + | |||
| Firstly, let us take a look at what are NoSQL and ORMs? | Firstly, let us take a look at what are NoSQL and ORMs? | ||
| + | |||
| == What is NoSQL? == | == What is NoSQL? == | ||
| - | NoSQL stands for "non-SQL", or sometimes | + | |
| + | NoSQL stands for “non-SQL”, or sometimes | ||
| == What are ORMs? == | == What are ORMs? == | ||
| + | |||
| ORM stands for Object Relational Mapping, meaning mapping from Relations (database) to Object (construct in a programming language). It is a technique of converting relationships in a database to objects in Object-Oriented programming languages, making working with such databases more productive and accessible for those who do not know relational algebra. | ORM stands for Object Relational Mapping, meaning mapping from Relations (database) to Object (construct in a programming language). It is a technique of converting relationships in a database to objects in Object-Oriented programming languages, making working with such databases more productive and accessible for those who do not know relational algebra. | ||
| == Relations in non-relational DB? == | == Relations in non-relational DB? == | ||
| + | |||
| When talking about ORMs for NoSQL, one of the commonly brought-up questions is the naming itself: how can there be mapping to a relationship in a database if it is non-relational? | When talking about ORMs for NoSQL, one of the commonly brought-up questions is the naming itself: how can there be mapping to a relationship in a database if it is non-relational? | ||
| == Problems == | == Problems == | ||
| + | |||
| So now that we are on the same page about NoSQL, ORM, and naming, let us talk about the main problems of implementing ODM for NoSQL. | So now that we are on the same page about NoSQL, ORM, and naming, let us talk about the main problems of implementing ODM for NoSQL. | ||
| Main problems: | Main problems: | ||
| Line 21: | Line 30: | ||
| 1. The most obvious problem is the variety of NoSQL databases and the lack of standard or common language. Firstly, there are key-value stores, like Redis, which are used to store data and quickly retrieve it. Secondly, there are Document databases, like Couchbase or MongoDB, which store information in objects. Thirdly, there are graph databases, like Neo4j or Dgraph, which store information in graphs. There are almost like another kind of database, even though they' | 1. The most obvious problem is the variety of NoSQL databases and the lack of standard or common language. Firstly, there are key-value stores, like Redis, which are used to store data and quickly retrieve it. Secondly, there are Document databases, like Couchbase or MongoDB, which store information in objects. Thirdly, there are graph databases, like Neo4j or Dgraph, which store information in graphs. There are almost like another kind of database, even though they' | ||
| - | 2. Another problem, most commonly brought up, is that ORMs sacrifice performance and speed, so should ODMs, which contradicts the purpose of NoSQL: speed and performance. ORMs do this to synchronize | + | 2. Another problem, most commonly brought up, is that ORMs sacrifice performance and speed, so should ODMs, which contradicts the purpose of NoSQL: speed and performance. ORMs do this to synchronize |
| 3. Last but not least is the problem of need. Is there any actual need for ODMs, or is NoSQL enough? Since NoSQL databases are so varied and unique, there must be a database that solves all of your application' | 3. Last but not least is the problem of need. Is there any actual need for ODMs, or is NoSQL enough? Since NoSQL databases are so varied and unique, there must be a database that solves all of your application' | ||
| Line 28: | Line 37: | ||
| 1. The easiest and most common solution is to support only one NoSQL database, like in [2,3]. This approach makes abstractions easier to create and connections to plan. | 1. The easiest and most common solution is to support only one NoSQL database, like in [2,3]. This approach makes abstractions easier to create and connections to plan. | ||
| - | A more complex solution is to create a NoSQL standard and common query language and create an ORM framework for this standard. This approach is similar to SQL databases: they already have a common language, SQL itself, and a standard SQL and "ISO/IEC 9075"[4]. However, this approach might be impossible because of the uniqueness of NoSQL databases. Nevertheless, | + | A more complex solution is to create a NoSQL standard and common query language and create an ORM framework for this standard. This approach is similar to SQL databases: they already have a common language, SQL itself, and a standard SQL and “ISO/IEC 9075”[4]. However, this approach might be impossible because of the uniqueness of NoSQL databases. Nevertheless, |
| 2. Talking about performance, | 2. Talking about performance, | ||
| Line 35: | Line 44: | ||
| === Conclusion === | === Conclusion === | ||
| + | |||
| In conclusion, I would like to state my opinion. I personally believe that ODMs are unnecessary. There' | In conclusion, I would like to state my opinion. I personally believe that ODMs are unnecessary. There' | ||
| However, I think that there exist two exceptions: | However, I think that there exist two exceptions: | ||
| Line 41: | Line 51: | ||
| === References === | === References === | ||
| - | | + | |
| - | - https:// | + | |
| - | - https:// | + | - [[https:// |
| - | - https:// | + | - [[https:// |
| - | - https:// | + | - [[wp> |
| + | - [[https:// | ||