<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kruno Golubic</title>
    <description>The latest articles on DEV Community by Kruno Golubic (@kgolubic).</description>
    <link>https://dev.to/kgolubic</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F586823%2Facf8b3d9-5d96-4ee6-8036-842a35360cd4.jpg</url>
      <title>DEV Community: Kruno Golubic</title>
      <link>https://dev.to/kgolubic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kgolubic"/>
    <language>en</language>
    <item>
      <title>What is a Key-Value Database?</title>
      <dc:creator>Kruno Golubic</dc:creator>
      <pubDate>Thu, 03 Aug 2023 09:17:43 +0000</pubDate>
      <link>https://dev.to/memgraph/what-is-a-key-value-database-34jh</link>
      <guid>https://dev.to/memgraph/what-is-a-key-value-database-34jh</guid>
      <description>&lt;p&gt;In the landscape of data management solutions, key-value databases stand apart, offering a unique blend of simplicity and performance tailored to the big data era. By abstracting data into simple key-value pairs and values, this type of database offers an intuitive and flexible data model that can seamlessly scale to accommodate large datasets. Before delving into the complexities of key-value databases, their advantages, use cases, and potential drawbacks, let's first establish a foundational understanding of these databases and how they represent a distinctive paradigm in data storage and retrieval.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding a key-value store
&lt;/h2&gt;

&lt;p&gt;In the &lt;a href="https://memgraph.com/blog/how-to-choose-a-database-for-your-needs"&gt;ever-expanding world of databases&lt;/a&gt;, key-value databases have emerged as a vital element. They are designed for storing, retrieving, and managing associative arrays, a data structure commonly known as a dictionary or hash table. The dictionary contains a collection of records, each with different fields containing data. These records are stored and retrieved using a unique key. This unique approach to data management differs from traditional relational databases and makes a key-value database an optimal solution for use cases where simplicity, speed, and scalability are paramount. Key-value databases are the &lt;a href="https://memgraph.com/blog/types-of-nosql-databases-deep-dive"&gt;simplest form of NoSQL databases&lt;/a&gt;. Each item in the database is stored as an attribute name, or key, together with its value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Defining key-value stores
&lt;/h2&gt;

&lt;p&gt;A key-value database, or key-value store, uses a simple key-value method to store data. Each key-value pair represents a specific piece of data. The 'key' serves as a unique identifier that is used to find the data within the database. Key-value databases treat the data as a single opaque collection, which may have different fields for every record. This offers considerable flexibility and more closely aligns with modern concepts like object-oriented programming.&lt;/p&gt;

&lt;p&gt;The primary features of a key-value database include simplicity, high performance, and the ability to handle large volumes of data efficiently. Because placeholders or input parameters do not represent optional values, key-value databases often use far less memory to store the same data, which can lead to significant performance gains in certain workloads.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lGJCeU5G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-a-key-value-database/key-value-database.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lGJCeU5G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-a-key-value-database/key-value-database.png" alt="key value database" width="800" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Working with a key-value database
&lt;/h2&gt;

&lt;p&gt;Key-value databases are known for their ease of use, making them a good starting point for beginners in the database realm. Thanks to their straightforward data structure, they provide a simple, user-friendly interface. The process involves storing unique keys associated with their corresponding data values and retrieving the associated value using its unique key.&lt;/p&gt;

&lt;p&gt;Key-value databases excel in &lt;a href="https://databasetown.com/key-value-database-use-cases/"&gt;use cases that involve frequently accessed data&lt;/a&gt;. For instance, in e-commerce platforms, a key-value database could be used to store product details. The unique identifier or 'key' could be the product ID, with all the related product data stored as the associated 'value'. Another scenario is user logs, where key-value stores prove to be efficient. Popular key-value database examples include Redis, DynamoDB, Riak, and RocksDB have active community support and extensive documentation, making it easier for developers to get started and troubleshoot issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits and advantages of a key-value database
&lt;/h2&gt;

&lt;p&gt;Developers and organizations &lt;a href="https://www.geeksforgeeks.org/key-value-data-model-in-nosql/"&gt;choose key-value databases for several reasons&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Speed
&lt;/h3&gt;

&lt;p&gt;One of the main reasons is their speed. Key-value databases can handle large volumes of reads and writes with minimal latency. The simplicity of the data structures used in a key-value store makes it easy for developers to quickly store and retrieve data. They offer impressive speed and performance, handling large volumes of data and providing rapid, random data access.&lt;/p&gt;

&lt;h3&gt;
  
  
  Horizontal scaling
&lt;/h3&gt;

&lt;p&gt;Scalability is a critical factor for modern applications dealing with ever-growing data volumes and increasing user demands. Key-value stores offer an advantage in this area, as they can easily scale horizontally. Horizontal scaling involves adding more servers to the existing network to distribute the data and workload across multiple nodes. As a result, key-value databases can maintain their performance levels even as data grows, ensuring that applications can handle a high number of concurrent users and massive data storage needs. This ability to scale out effectively makes them a preferred choice for applications that require elasticity and flexibility.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QkfJCRJt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-a-key-value-database/pros-vs-cons.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QkfJCRJt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-a-key-value-database/pros-vs-cons.png" alt="pros vs cons" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ease of use and development
&lt;/h3&gt;

&lt;p&gt;Key-value databases provide a simple and straightforward interface for data storage and retrieval. Developers can easily interact with the database using basic operations like "get" and "put" based on the associated keys. The straightforward API and data model reduce the complexity of the application code, making it easier to develop and maintain. Additionally, the ease of integration with various programming languages and frameworks allows developers to quickly incorporate key-value stores into their applications without a steep learning curve.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flexible data models
&lt;/h3&gt;

&lt;p&gt;Key-value databases are schema-less, meaning that they do not enforce a fixed data structure or data types. This flexibility allows developers to store and manage various types of data within the same database without strict predefined schemas. This is particularly advantageous for applications dealing with diverse and evolving data formats. Whether it's storing user profiles, session data, configurations, or complex objects, key-value databases can handle different data formats efficiently, eliminating the need for complex and costly data transformations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Potential drawbacks of a key-value database
&lt;/h2&gt;

&lt;p&gt;While key-value databases are powerful, they &lt;a href="https://www.techtarget.com/searchdatamanagement/tip/NoSQL-database-types-explained-Key-value-store"&gt;aren't always the ideal choice&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Complex queries
&lt;/h3&gt;

&lt;p&gt;They lack the ability to perform complex queries or handle sophisticated relationships between data, which relational databases excel at. If your use case involves complex queries or requires understanding the relationships between different data entities, then a relational database or a graph database might be a better fit. Also, they may not be suitable for applications that require multi-record transactions or complex data manipulation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lack of data relationships
&lt;/h3&gt;

&lt;p&gt;Key-value databases do not inherently support relationships between data items. While data can be organized and retrieved efficiently based on keys, establishing complex relationships between different pieces of data requires additional application logic. This can lead to potential data inconsistencies and increased complexity in managing relationships outside the database layer. For applications heavily reliant on data relationships, such as social networks or recommendation systems, graph databases may provide more natural and performant solutions, as they are specifically designed to handle and traverse complex data relationships efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Handling complex data types
&lt;/h3&gt;

&lt;p&gt;Another challenge with key-value databases is the handling of complex data types. While they can handle structured, semi-structured, and unstructured data, they lack the advanced capabilities of a document database in managing complex objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data size and indexing
&lt;/h3&gt;

&lt;p&gt;As the data size grows significantly, key-value databases may face challenges with indexing and maintaining performance. While they excel at handling fast key-based lookups, large datasets can impact the efficiency of these operations. Proper index design and tuning are crucial to ensure optimal performance. Additionally, some key-value databases may not offer sophisticated indexing options, limiting their capabilities to efficiently handle specific types of queries or data access patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overcoming limitations of a key-value database
&lt;/h2&gt;

&lt;p&gt;Despite these limitations, there are strategies and tools that can help overcome them. For example, secondary indexing and query languages like Redis's RediSearch and Amazon DynamoDB's Query Language can help perform more complex queries. Hybrid models, combining a key-value database with other database types like document databases, can handle complex queries or manage complex relationships between data entities. Additional technologies that can be incorporated into key-value databases to enhance functionality include secondary indexing to create efficient index structures to accelerate application responses.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Oq50WUSt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-a-key-value-database/success.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Oq50WUSt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-a-key-value-database/success.png" alt="success" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;p&gt;Key-value databases offer a compelling mix of simplicity, speed, and scalability that can be highly beneficial in certain situations. As with any technology, it's important to understand its strengths and weaknesses to make the most of it. The key-value database world is constantly evolving, and it's an exciting area to explore for any developer or organization looking to optimize their data storage and retrieval needs.&lt;/p&gt;

&lt;p&gt;They are a fantastic choice for use cases that involve handling large volumes of frequently accessed data or where horizontal scalability is required. However, it's crucial to understand the capabilities and limitations of key-value databases before choosing them as a solution. Overall, with ongoing evolution and innovation in the database world, the future looks promising for the key-value database scene.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What is PostgreSQL Database?</title>
      <dc:creator>Kruno Golubic</dc:creator>
      <pubDate>Wed, 28 Jun 2023 12:16:05 +0000</pubDate>
      <link>https://dev.to/memgraph/what-is-postgresql-database-2d4f</link>
      <guid>https://dev.to/memgraph/what-is-postgresql-database-2d4f</guid>
      <description>&lt;p&gt;In the constantly evolving sphere of software applications, &lt;a href="https://www.educba.com/what-is-postgresql/"&gt;PostgreSQL&lt;/a&gt; shines as an outstanding open-source relational database. The PostgreSQL project was conceived by the PostgreSQL Global Development Group, and since then, it has carved a distinctive identity among a plethora of database systems, especially relational databases.&lt;/p&gt;

&lt;p&gt;The PostgreSQL DB, an offshoot from the older Ingres database, allows its users to create custom data types and operators, making it a versatile tool for varied database management tasks. Its feature-rich capabilities make PostgreSQL an excellent choice for dynamic websites and complex analytics applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding PostgreSQL database server
&lt;/h2&gt;

&lt;p&gt;The PostgreSQL database, developed and maintained by developers and volunteers gathered around the project and PostgreSQL Global Development Group, boasts a robust feature set. &lt;br&gt;
PostgreSQL is not merely a relational database but also an object-relational database, which means it provides the best of both worlds - the power of RDBMS and the flexibility of OOPs. This is useful for applications that need to handle complex data and relationships.&lt;/p&gt;

&lt;p&gt;One of the distinctive features of PostgreSQL is its extensibility, which allows developers to define their own data types, operators, and functions. This can be immensely helpful for specialized use cases that aren't adequately covered by the built-in types and functions.&lt;/p&gt;

&lt;p&gt;For instance, the PostGIS extension enhances PostgreSQL's capabilities to support geographic objects and can be utilized as a geospatial data store for geographic information systems and location-based services such as ride-sharing apps, real estate platforms, and logistics &amp;amp; delivery services. It allows these services to perform complex geospatial queries and calculations right within the database.&lt;/p&gt;

&lt;p&gt;Moreover, PostgreSQL supports full-text search, which is a pivotal feature for applications that need to offer search capabilities over large volumes of text data, like a blogging platform, a document management system, or an e-commerce site.&lt;/p&gt;

&lt;p&gt;In terms of data integrity, PostgreSQL's support for &lt;a href="https://memgraph.com/blog/acid-transactions-meaning-of-isolation-levels"&gt;ACID properties&lt;/a&gt; (Atomicity, Consistency, Isolation, Durability) ensures that your data remains consistent and safe, which is crucial for applications like banking or finance, where data accuracy is paramount.&lt;/p&gt;

&lt;p&gt;Another unique offering of PostgreSQL is its ability to handle a broad range of numeric and mathematical computations with its various numeric data types and a wide array of mathematical functions. This makes it suitable for scientific applications, financial applications, or any domain where complex math computations are needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--inEcmrmW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-postgresql-database/postgreSQL-extensions.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--inEcmrmW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-postgresql-database/postgreSQL-extensions.png" alt="postgreSQL extensions" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly, the support for JSON data in PostgreSQL makes it an excellent choice for applications that need a flexible schema or deal with semi-structured data. This can be useful for applications like content management systems, cataloging systems, or any application dealing with IoT data.&lt;/p&gt;

&lt;p&gt;PostgreSQL supports multiple data types, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Character types:

&lt;ul&gt;
&lt;li&gt;character(n) or char(n)&lt;/li&gt;
&lt;li&gt;character varying(n) or varchar(n)&lt;/li&gt;
&lt;li&gt;text&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Numeric types:

&lt;ul&gt;
&lt;li&gt;Integer types: smallint, integer, bigint&lt;/li&gt;
&lt;li&gt;Decimal types: decimal or numeric&lt;/li&gt;
&lt;li&gt;Floating-point types: real, double precision&lt;/li&gt;
&lt;li&gt;Serial types: smallserial, serial, bigserial&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Monetary type:

&lt;ul&gt;
&lt;li&gt;money&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Date/Time types:

&lt;ul&gt;
&lt;li&gt;timestamp&lt;/li&gt;
&lt;li&gt;timestamp with time zone&lt;/li&gt;
&lt;li&gt;date&lt;/li&gt;
&lt;li&gt;time&lt;/li&gt;
&lt;li&gt;time with time zone&lt;/li&gt;
&lt;li&gt;interval&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Binary data type:

&lt;ul&gt;
&lt;li&gt;bytea&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Boolean type:

&lt;ul&gt;
&lt;li&gt;boolean&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Enumerated types:

&lt;ul&gt;
&lt;li&gt;A data type that comprises a static, ordered set of values.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Bit string types:

&lt;ul&gt;
&lt;li&gt;bit(n)&lt;/li&gt;
&lt;li&gt;bit varying(n) or varbit(n)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;UUID type:

&lt;ul&gt;
&lt;li&gt;uuid&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Network address types:

&lt;ul&gt;
&lt;li&gt;inet&lt;/li&gt;
&lt;li&gt;cidr&lt;/li&gt;
&lt;li&gt;macaddr, macaddr8&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Text search types:

&lt;ul&gt;
&lt;li&gt;tsvector, tsquery&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Geometric types:

&lt;ul&gt;
&lt;li&gt;point, line, lseg, box, path, polygon, circle&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;XML type:

&lt;ul&gt;
&lt;li&gt;xml&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;JSON types:

&lt;ul&gt;
&lt;li&gt;json, jsonb&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Array types:

&lt;ul&gt;
&lt;li&gt;Any valid data type can be used to create an array.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Composite types:

&lt;ul&gt;
&lt;li&gt;These are basically rows or records used as complex data.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Benefits of PostgreSQL
&lt;/h2&gt;

&lt;p&gt;The robustness and appeal of PostgreSQL are not merely confined to its extensive feature set but extend to its core architectural advantages and advanced capabilities.&lt;/p&gt;

&lt;p&gt;One such feature is write-ahead logging (WAL). WAL is a standard approach to handling database modifications where changes are written to a log before they are applied to the database. This method provides a persistent backup of all changes that occur within the system, enhancing the resilience of the database against crashes or hardware failures. It also allows for point-in-time recovery, meaning you can restore your database to a specific moment in the past, which is crucial for dealing with data corruption or user errors.&lt;/p&gt;

&lt;p&gt;In addition to this, PostgreSQL provides asynchronous replication, which is an essential feature for maintaining data redundancy and achieving high availability. Replication allows the creation of one or more copies of the database, ensuring data safety in case of system failure and enabling load balancing for read-heavy applications. Asynchronous replication, in particular, means the write operation is returned as successful before the data is written to the replica database, leading to increased performance.&lt;/p&gt;

&lt;p&gt;Another major benefit of PostgreSQL is its support for a system known as &lt;a href="https://memgraph.com/blog/disabling-multi-version-concurrency-control-for-faster-import-analytics-mode"&gt;multi-version concurrency control&lt;/a&gt; or MVCC. Unlike lock-based concurrency control techniques, multi-version concurrency control allows multiple transactions to access the same row simultaneously without conflict. Each transaction sees a snapshot of the database at the start of the transaction, enabling it to operate without worrying about concurrent transactions. This system significantly enhances database performance by minimizing lock contention. It also provides several levels of transaction isolation, leading to more efficient database management.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rTxD2Cu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-postgresql-database/postgreSQL-features.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rTxD2Cu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-postgresql-database/postgreSQL-features.png" alt="postgreSQL features" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Furthermore, PostgreSQL offers an extensive set of indexing techniques and index types, like B-tree, Hash, GiST, SP-GiST, GIN, and BRIN. Each is suited to particular types of queries and data structures, making PostgreSQL versatile in handling various data access patterns efficiently.&lt;/p&gt;

&lt;p&gt;PostgreSQL also comes with full support for stored procedures and triggers, enabling the enforcement of complex business rules at the database level. Stored procedures allow for logic encapsulation and can significantly enhance performance by reducing network traffic between the application and the database. Triggers, on the other hand, allow the automatic execution of a specified function when certain events occur in the database.&lt;/p&gt;

&lt;p&gt;In terms of security, PostgreSQL offers a comprehensive security model that includes robust access controls, views, granular permissions, and sophisticated authentication mechanisms, ensuring data privacy and integrity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using PostgreSQL: Getting started and beyond
&lt;/h2&gt;

&lt;p&gt;For beginners, the &lt;a href="https://www.datacamp.com/tutorial/beginners-introduction-postgresql"&gt;learning curve of PostgreSQL&lt;/a&gt; might seem steep, mainly due to the multitude of features PostgreSQL has incorporated into the system. PostgreSQL has a vibrant and supportive community that provides continual enhancements, regular updates, and prompt security patches, ensuring its technology stays up-to-date and secure. This also means that users can expect a wealth of resources, tutorials, and experts to turn to when they need help.&lt;/p&gt;

&lt;p&gt;Language support in PostgreSQL extends to a variety of programming languages, enabling its use in diverse environments. It even supports international character sets and multi-byte character encodings, reflecting its global user base.&lt;/p&gt;

&lt;p&gt;Moreover, &lt;a href="https://www.linode.com/docs/products/databases/managed-databases/guides/postgresql-extensions/"&gt;PostgreSQL's extensions ecosystem&lt;/a&gt; is impressive. Users can extend PostgreSQL's functionality, adding flexibility and power to its core capabilities. Stored procedures and foreign keys are two such features that improve the database's usability in the real world.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three signs a relational database is not the right for you
&lt;/h2&gt;

&lt;p&gt;Despite the numerous benefits of PostgreSQL and other relational databases, certain scenarios or application requirements might make a &lt;a href="https://memgraph.com/blog/graph-database-vs-relational-database"&gt;relational database less than optimal&lt;/a&gt;. Here are three signs indicating that a relational database might not be the best choice for your application:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Complex, hierarchical, or multidimensional data: Relational databases excel at managing structured data that can be neatly organized into tables. However, if your application deals with complex, hierarchical, or multidimensional data, a relational database might prove inefficient. For instance, if you're working with interconnected data like social network connections or complex hierarchies that are more effectively represented as graphs, &lt;a href="https://memgraph.com/blog/the-benefits-of-using-a-graph-database-instead-of-sql"&gt;a graph database like Memgraph could be a better fit&lt;/a&gt;. Similarly, if your data model involves complex multidimensional queries like in some analytical or data warehousing scenarios, a multidimensional database or an OLAP cube might be more suitable.&lt;/li&gt;
&lt;li&gt;Real-time data processing: If your application requires real-time or near-real-time data processing and analysis – as is common in applications dealing with streaming data, IoT sensor data, or in some machine learning scenarios – a relational database might struggle to keep up. These scenarios require databases that can handle high-speed data ingestion and provide real-time analysis. Technologies like stream processing systems (e.g., Apache Kafka or Apache Flink) or time-series databases ( InfluxDB) are specially designed for these use cases.&lt;/li&gt;
&lt;li&gt;Need for horizontal scaling in a distributed environment: Relational databases traditionally scale vertically by adding more resources (CPU, RAM) to a single server, which can quickly become expensive and has physical limits. If your application requires a database that can efficiently scale horizontally – i.e., distribute data and load across multiple servers – a relational database might not be the best choice. For these scenarios, NoSQL databases like Cassandra or MongoDB, which are designed with horizontal scaling and distribution in mind, might be more suitable. They allow for the addition of more servers in the network to handle larger data loads, providing high availability and fault tolerance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Remember, the choice of a database should align with the specific needs and characteristics of your application, and there is no one-size-fits-all solution. It's essential to understand your application's requirements thoroughly and &lt;a href="https://memgraph.com/blog/how-to-choose-a-database-for-your-needs"&gt;evaluate different database technologies&lt;/a&gt; before making a decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why and when to migrate your relational database to Memgraph
&lt;/h2&gt;

&lt;p&gt;While PostgreSQL and other relational databases offer a wide range of capabilities, there are certain scenarios where these traditional databases may not fully meet the specific needs of an application. In such situations, an in-memory graph database like Memgraph may provide significant advantages. Here are a few circumstances where considering a transition might be beneficial:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data is better represented as a graph: If your application handles data that is more naturally represented as a network of interconnected entities rather than isolated records in tables, a graph database like Memgraph might be a more suitable choice. Graph databases excel at managing complex relationships between entities and can more naturally represent many real-world scenarios. Examples might include social networks (where relationships between users are crucial), recommendation systems (where the relations between users and items are key), or logistics and supply chain management systems (where the connections between locations matter).&lt;/li&gt;
&lt;li&gt;Real-time insights from highly interconnected data: Applications that need to uncover real-time insights from highly interconnected data could benefit greatly from Memgraph. In contrast to relational databases, which might require complex and performance-intensive joins to traverse relationships, graph databases like Memgraph are designed to efficiently navigate connections between entities. This allows them to perform complex queries and analytics on connected data in real time, which is beneficial in use cases like fraud detection, real-time recommendations, or network analysis in telecommunication.&lt;/li&gt;
&lt;li&gt;Processing large volumes of interconnected data: If you know your application needs to handle and process vast volumes of interconnected data, Memgraph can offer superior performance. Because Memgraph is an in-memory database, it can provide faster access times and higher performance compared to disk-based systems, especially for workloads that involve intensive graph traversals. Moreover, Memgraph’s sophisticated memory management ensures that even larger datasets that do not fit entirely in memory can be handled efficiently.&lt;/li&gt;
&lt;li&gt;Complex graph algorithms: Finally, if your application needs to implement complex graph algorithms like shortest path, centrality measures, community detection, etc., &lt;a href="https://memgraph.com/docs/memgraph/import-data/migrate/postgresql"&gt;migrating to Memgraph&lt;/a&gt; can simplify your task. Memgraph provides out-of-the-box support for many common graph algorithms, eliminating the need to implement these complex operations from scratch.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;p&gt;PostgreSQL is a powerful open-source relational database that offers a vast array of capabilities. The ongoing active development by the PostgreSQL Global Development Group and open-source community, combined with its advanced features and strong PostgreSQL community support, make it a worthy choice for anyone in the field of software development. However, understanding the specific needs of your application is crucial when choosing the right database system.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>database</category>
      <category>beginners</category>
      <category>memgraph</category>
    </item>
    <item>
      <title>What is MIT License?</title>
      <dc:creator>Kruno Golubic</dc:creator>
      <pubDate>Mon, 05 Jun 2023 12:36:34 +0000</pubDate>
      <link>https://dev.to/memgraph/what-is-mit-license-3f52</link>
      <guid>https://dev.to/memgraph/what-is-mit-license-3f52</guid>
      <description>&lt;p&gt;Before delving into the specifics of the license from the Massachusetts Institute of Technology (MIT), let's first understand the &lt;a href="https://memgraph.com/blog/what-is-an-open-source-license"&gt;importance of a software license&lt;/a&gt; in the open-source community. When a piece of software is open-source, it means that the original source code is freely available to the public. The license under consideration, termed the MIT License, permits anyone to view, use, modify, distribute, and contribute to the MIT-licensed code under specific terms and conditions.&lt;/p&gt;

&lt;p&gt;There are several types of licenses, each with its unique terms and conditions. For instance, the General Public License (GPL) is known for its "copyleft" terms, whereas the Apache License is noted for its express grant of patent rights. Our focus today is one of the simplest and most permissive forms of &lt;a href="https://www.memgraph.com/blog/history-of-open-source-licenses-what-license-to-choose"&gt;open-source licenses:&lt;/a&gt; the MIT License.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding this license
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://opensource.org/license/mit/"&gt;MIT License&lt;/a&gt; is a short, simple, and permissive software license. It grants users the liberty to do virtually anything they wish with the software and associated documentation files, including use, copy, modify, merge, publish, distribute, sublicense, and sell copies of the software. The only condition is that the license and copyright notice must be included in all copies or substantial portions of the MIT-licensed software.&lt;/p&gt;

&lt;p&gt;The terms and conditions of the MIT License are simple and straightforward. This permission notice starts with a copyright notice, followed by details of the rights granted to users. Furthermore, it includes a liability clause, which states that the MIT-licensed software is provided "as is" without warranty of any kind.&lt;/p&gt;

&lt;p&gt;This popular software license's simplicity and brevity differentiate it from others. Unlike the GPL, which is extensive and complex, the MIT License is easy to understand and does not require a legal expert to interpret its terms. Furthermore, while some licenses require any derivative works also to be open-source, MIT allows you to keep the source code of any modifications to yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  License variations
&lt;/h2&gt;

&lt;p&gt;While the original MIT License is clear and comprehensive, several variations have been created over time. These modifications serve different purposes, providing tailored solutions to specific licensing needs. Before diving into some of the variants, here is one license that actually is not a variation; Expat License.&lt;/p&gt;

&lt;h3&gt;
  
  
  Expat License
&lt;/h3&gt;

&lt;p&gt;The Expat License got its name from the Expat XML parser library. The library was licensed under what we often refer to as the "MIT License", but due to the confusion with other licenses related to MIT, it's sometimes specified as the Expat License to avoid ambiguity. This is because a few different licenses originated at MIT, so the term "MIT License" can be somewhat unclear without further context. The Expat License is one of those licenses, named after the Expat XML parser library to distinguish it from the other "MIT Licenses."&lt;/p&gt;

&lt;h3&gt;
  
  
  MIT No Attribution License (MIT-0)
&lt;/h3&gt;

&lt;p&gt;This is a variant of the MIT License where all attribution clauses have been removed. This means that there's no requirement to include the original copyright notice and permission notice in any copies of the software, thus reducing the license-related responsibilities of the users. MIT-0 has gained popularity among developers who wish to contribute to the open-source community without requiring attribution.&lt;/p&gt;

&lt;h3&gt;
  
  
  JSON License
&lt;/h3&gt;

&lt;p&gt;The JSON License is a slightly more restrictive version of the MIT License. It includes an additional clause stating, "The Software shall be used for Good, not Evil." This license was created by Douglas Crockford, who developed the JSON data format. However, this additional requirement has been the subject of some controversy due to the subjective nature of the terms "Good" and "Evil."&lt;/p&gt;

&lt;h3&gt;
  
  
  The X11 License (MIT/X Consortium License)
&lt;/h3&gt;

&lt;p&gt;This variant of the MIT License is named after the X Window System (X11) from MIT. The X11 License is almost identical to the original MIT License, except for an additional disclaimer clause that aims to distance MIT and X Consortium from any potential legal implications related to the software. This extra layer of protection has made the X11 License a popular choice among developers and organizations concerned about legal liability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits and limitations
&lt;/h2&gt;

&lt;p&gt;Software licensing plays a pivotal role in managing the rights and restrictions associated with software use, modification, and distribution. Like any license, the MIT license has its strengths and limitations. Understanding these can help developers and organizations make an informed decision when choosing a license for their software projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MkPQOzq0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-mit-license/memgraph-benefits-and-limitations.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MkPQOzq0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-mit-license/memgraph-benefits-and-limitations.png" alt="benefits and limitations" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of the MIT License
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Simplicity: The MIT License is known for its straightforwardness. Its brevity makes it easy to understand without needing extensive legal expertise.&lt;/li&gt;
&lt;li&gt;Permissiveness: It is one of the most permissive licenses available, allowing for almost unrestricted use, modification, and distribution of the licensed software as long as the copyright notice and the license terms are included in all copies or substantial portions of the Software.&lt;/li&gt;
&lt;li&gt;Open collaboration: By providing explicit permissions upfront, the MIT License fosters an environment of open collaboration, making it appealing for open-source projects.&lt;/li&gt;
&lt;li&gt;Corporate appeal: Many organizations find this License attractive because it permits the use of licensed software without requiring the disclosure of proprietary information, offering a balance between open-source contribution and proprietary development.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Limitations of the MIT License
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;No warranty: The MIT License disclaims any warranties, meaning the software is provided "as is". The creators or copyright holders do not make any guarantees regarding the software's functionality, reliability, or suitability for a particular purpose.&lt;/li&gt;
&lt;li&gt;No liability: The license includes a limitation of liability clause. This means that the copyright holders are not responsible if the software causes any damage or issues. Users are responsible for any risks associated with the use of the software.&lt;/li&gt;
&lt;li&gt;No requirement for open-source derivative works: Unlike some other open-source licenses, the MIT License does not require derivative works to also be open source. While this might be a benefit for some users, it can also be viewed as a limitation for those who wish to ensure that all adaptations of their software remain open source.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Comparing the MIT License to other software licenses
&lt;/h2&gt;

&lt;p&gt;The landscape of open-source software licenses is vast and varied, with each license offering a different balance of permissions and restrictions. The MIT License, with its remarkable simplicity and permissiveness, has earned a place as one of the most popular choices among developers. However, to fully understand its position, it's essential to compare it to a few other notable licenses in the field.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ln_PmfI6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-mit-license/memgraph-licenses.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ln_PmfI6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/what-is-mit-license/memgraph-licenses.png" alt="licenses" width="800" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  MIT vs. GNU General Public License (GPL)
&lt;/h3&gt;

&lt;p&gt;The GPL is another widely used open-source license, but it takes a vastly different approach to software freedom compared to the MIT License. The GPL is a "copyleft" license, meaning any modifications or derivative works of the GPL-licensed software must also be distributed under the GPL. This ensures that modifications remain free and open, promoting a philosophy of shared improvement.&lt;/p&gt;

&lt;p&gt;On the other hand, the MIT License is more permissive and does not have a copyleft requirement. A person obtaining MIT-licensed software can use it in their projects and choose not to open-source their modifications. This gives developers more flexibility but doesn't guarantee the same level of shared progress as the GPL.&lt;/p&gt;

&lt;h3&gt;
  
  
  MIT vs. Apache License 2.0
&lt;/h3&gt;

&lt;p&gt;The Apache License 2.0, like the MIT License, is a permissive open-source license. Both licenses allow the user to use, modify, and distribute the software, even in proprietary software. However, the Apache License includes a provision that grants an explicit patent license, protecting users from patent claims by contributors to the software.&lt;/p&gt;

&lt;p&gt;The MIT License, while allowing for broad use of the software, does not include an explicit contributor's patent license. This means users of MIT-licensed software must be aware of any potential patent issues separately. Despite this, the simplicity of the very same license often makes it a more attractive option for smaller projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  MIT vs. BSD Licenses
&lt;/h3&gt;

&lt;p&gt;The BSD licenses (including the original BSD License, the Modified BSD License, and the Simplified BSD License) are a family of permissive licenses like the MIT License. They all allow for nearly unrestricted use, modification, and distribution of licensed software.&lt;/p&gt;

&lt;p&gt;The key difference lies in the advertising clause found in the original BSD License, which requires that any advertising materials featuring products using the software must acknowledge the software's contributors. Neither the MIT License nor the later BSD licenses include this requirement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Role in open-source software
&lt;/h2&gt;

&lt;p&gt;The MIT License, with its simplicity and permissiveness, has significantly contributed to the growth of the open-source community. It has facilitated the development and distribution of software, fostering collaboration and enabling flexibility in how open-source software is used. Many popular open-source projects, including Node.js and jQuery, have chosen this license.&lt;/p&gt;

&lt;p&gt;Looking towards the future, the open-source landscape will likely continue to evolve, and with it, the role of licenses like the MIT License. As legal challenges become more complex and the potential risks associated with the use and development of software increase, the simplicity and flexibility of MIT may continue to make it a popular choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions about the MIT License
&lt;/h2&gt;

&lt;p&gt;Although the MIT license stands out for its simplicity and permissiveness, the simplicity aspect often gives rise to questions, especially relating to applicability. To clarify and assist in better understanding this popular license, we have compiled a selection of frequently asked questions about the MIT License. &lt;/p&gt;

&lt;h3&gt;
  
  
  1. Is the MIT License compatible with GPL?
&lt;/h3&gt;

&lt;p&gt;Yes, the MIT License is compatible with GPL. This means you can combine code released under the MIT License with code released under the GPL in one program. The MIT License is considered a similarly permissive license, which allows it to be re-licensed under other licenses, including the GPL.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Does the MIT License allow commercial use?
&lt;/h3&gt;

&lt;p&gt;Yes, the MIT License does allow commercial use. You can use, modify, and distribute the software in a commercial product without any restrictions. However, you must include the original copyright notice and disclaimers.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Can I sell MIT License software?
&lt;/h3&gt;

&lt;p&gt;Yes, you can sell software that is licensed under the MIT License. There are no restrictions on selling the software under this license as long as you include the original copyright notice and disclaimers.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Can I use an MIT License in proprietary software?
&lt;/h3&gt;

&lt;p&gt;Yes, the MIT License allows its code to be incorporated into proprietary software. It also allows for the licensed software to be used in any manner, including for proprietary software, provided that the MIT License conditions are met, which includes the original copyright notice and disclaimers.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Where to put the MIT License in the code?
&lt;/h3&gt;

&lt;p&gt;The MIT License is usually included in the root directory of the source code, often in a file named LICENSE or LICENSE.txt. It's also common to include a short license summary at the top of each source file, stating that the file is licensed under the MIT License and referencing the full license text.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Can the MIT License be revoked?
&lt;/h3&gt;

&lt;p&gt;Once you have received software under the MIT License, the rights given to you under the license are not revocable. This means that once a piece of code is licensed under MIT, that license continues to apply to that code even if future versions of the code are released under a different license.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;p&gt;In conclusion, the MIT License is worth considering if you're a developer working on an open-source project or an organization leveraging open-source software. It provides freedom while maintaining simplicity, making it accessible and easy to understand. However, as with any decision, it's crucial to understand the terms of this software license and realize that your choice could have significant implications for how your MIT-licensed code is used and distributed in the future. &lt;a href="https://techbeacon.com/app-dev-testing/open-source-pitfalls-understand-license-you-commit"&gt;Understanding the implications of different licenses&lt;/a&gt; when working with or contributing to open-source software is equally important.&lt;/p&gt;

&lt;p&gt;Remember, a well-chosen license is not only about adhering to legal requirements but also about creating a healthy, collaborative, and inclusive community around your software.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://memgraph.com/blog?topics=Open+source+licenses&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=blog_repost&amp;amp;utm_content=banner#list"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ggEl866K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://public-assets.memgraph.com/external/memgraph-read-more-gradient-1200.png" alt="Read more about open source licenses on memgraph.com" width="800" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>memgraph</category>
      <category>licensing</category>
      <category>development</category>
    </item>
    <item>
      <title>First steps with Memgraph</title>
      <dc:creator>Kruno Golubic</dc:creator>
      <pubDate>Tue, 25 Oct 2022 15:02:45 +0000</pubDate>
      <link>https://dev.to/memgraph/first-steps-with-memgraph-5elh</link>
      <guid>https://dev.to/memgraph/first-steps-with-memgraph-5elh</guid>
      <description>&lt;p&gt;In this tutorial, you will learn how to install &lt;a href="https://memgraph.com/"&gt;Memgraph Platform&lt;/a&gt;, connect to it using Memgraph Lab, run your first query and style your graph. You will see that using Memgraph is not hard at all!&lt;/p&gt;

&lt;p&gt;This tutorial is also available as a video on Memgraph’s YouTube channel:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://kgolubic.hashnode.dev/first-steps-with-memgraph#heading-prerequisites"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Memgraph Platform can be installed only with &lt;strong&gt;Docker&lt;/strong&gt;. Instructions on how to install Docker can be found on the &lt;a href="https://docs.docker.com/get-docker/"&gt;official Docker website&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://kgolubic.hashnode.dev/first-steps-with-memgraph#heading-1-install-memgraph-platform"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. Install Memgraph Platform
&lt;/h2&gt;

&lt;p&gt;First, you need to download and install Memgraph Platform. All you need to do is to open a terminal on your computer and run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -it -p 7687:7687 -p 7444:7444 -p 3000:3000 -v mg_lib:/var/lib/memgraph memgraph/memgraph-platform
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the installation is done, you will see a message similar to this one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Status: Downloaded newer image for memgraph/memgraph-platform:latest
Memgraph Lab is running at localhost:3000

mgconsole 1.1
Connected to 'memgraph://127.0.0.1:7687'
Type :help for shell usage
Quit the shell by typing Ctrl-D(eof) or :quit
memgraph&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That means that you have installed Memgraph Platform and that you have Memgraph up and running. Kudos!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://kgolubic.hashnode.dev/first-steps-with-memgraph#heading-2-connect-to-memgraph-lab"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  2. Connect to Memgraph Lab
&lt;/h2&gt;

&lt;p&gt;Since you installed and started the Memgraph Platform, then the Memgraph Lab is already running, so open your web browser and go to &lt;a href="http://localhost:3000/"&gt;&lt;code&gt;localhost:3000&lt;/code&gt;&lt;/a&gt;. When the Memgraph Lab loads, click &lt;strong&gt;Connect now&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z9qS9sAH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/1-connect-to-memgraph-lab.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z9qS9sAH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/1-connect-to-memgraph-lab.png" alt="" width="880" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s it! You can see the Memgraph Lab Dashboard, so you are ready to head over to the next step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4WIKP7Xg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/2-memgraph-lab-dashboard-1024x561.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4WIKP7Xg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/2-memgraph-lab-dashboard-1024x561.png" alt="" width="880" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://kgolubic.hashnode.dev/first-steps-with-memgraph#heading-3-import-dataset"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  3. Import dataset
&lt;/h2&gt;

&lt;p&gt;Since this is a fresh install, there are no nodes and relationships in your database. We have prepared more than 20 datasets that you can use for testing and learning. You will now import one of those datasets. In the sidebar click &lt;strong&gt;Datasets&lt;/strong&gt;. Next, go to &lt;strong&gt;Capital cities and borders&lt;/strong&gt; and click &lt;strong&gt;Load Dataset&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HAPHAAmO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/3-memgraph-lab-datasets-1024x561.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HAPHAAmO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/3-memgraph-lab-datasets-1024x561.png" alt="" width="880" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see the warning that a new dataset will overwrite current data in the database. That is not a problem for you since you don’t have any data in your database, but in the future be careful when importing data. Go ahead and click &lt;strong&gt;Confirm&lt;/strong&gt;. Once the import is done, click the &lt;strong&gt;X&lt;/strong&gt; to close the dialog.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zAuGWLRZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/4-memgraph-lab-dataset-import-1024x303.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zAuGWLRZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/4-memgraph-lab-dataset-import-1024x303.png" alt="" width="880" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://kgolubic.hashnode.dev/first-steps-with-memgraph#heading-4-run-query"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  4. Run query
&lt;/h2&gt;

&lt;p&gt;Now that the data is imported it is time to run your first Cypher query. You will write a query that that displays all of the cities and all of the connections.&lt;/p&gt;

&lt;p&gt;Click the &lt;strong&gt;Query Execution&lt;/strong&gt; in the sidebar, and then copy-and-paste the following code into the &lt;strong&gt;Cypher Editor&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH (n)-[r]-(m)
RETURN n, r, m;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click &lt;strong&gt;Run query&lt;/strong&gt; to run the above query and see the result in the &lt;strong&gt;Graph results&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nLbbbTyD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/5-memgraph-lab-first-cypher-query-1024x568.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nLbbbTyD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/5-memgraph-lab-first-cypher-query-1024x568.png" alt="" width="880" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is another query for you. Imagine that you are in Madrid and you want to visit other capital cities that are one or two hops away from Madrid. How can you figure out which cities are your possible destinations? You will use Cypher query language to find that out.&lt;/p&gt;

&lt;p&gt;Click the &lt;strong&gt;Query Execution&lt;/strong&gt; in the sidebar, and then copy-and-paste the following code into the &lt;strong&gt;Cypher Editor&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MATCH p = (madrid:City { name: "Madrid" })-[e *BFS ..2]-(:City)
RETURN p;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query will show all of the capital cities on the map that are up to two hops away from Madrid. You don’t have to worry about exact semantics of this query for now, but if you want to find out more, check out the &lt;a href="https://memgraph.com/docs/cypher-manual/"&gt;learning materials&lt;/a&gt; for Cypher. Click &lt;strong&gt;Run query&lt;/strong&gt; to run the above query and see the result in the &lt;strong&gt;Graph results&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3JTTn-ss--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/6-memgraph-lab-cypher-editor-1024x561.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3JTTn-ss--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/6-memgraph-lab-cypher-editor-1024x561.png" alt="" width="880" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The result that you can see shows all of the capital cities that are two hops away from Madrid.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SBKTYpSc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/7-memgraph-lab-graph-results-1024x561.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SBKTYpSc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/7-memgraph-lab-graph-results-1024x561.png" alt="" width="880" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://kgolubic.hashnode.dev/first-steps-with-memgraph#heading-5-style-your-graph"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  5. Style your graph
&lt;/h2&gt;

&lt;p&gt;When your results are shown on the map, you can move around. Go ahead and zoom in and change the map style to &lt;strong&gt;Detailed&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--44u9SPdO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/8-memgraph-lab-map-style-1024x561.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--44u9SPdO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/8-memgraph-lab-map-style-1024x561.png" alt="" width="880" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will now use &lt;strong&gt;Graph Style Editor&lt;/strong&gt; to change how nodes and relationships are shown on the map. We have included a flag for each capital city as a node property for the country it belongs to. You will now add one line of code to change the style of the graph.&lt;/p&gt;

&lt;p&gt;Find the part of the code that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@NodeStyle HasLabel(node, "City") {
  color: #DD2222
  color-hover: Lighter(#DD2222)
  color-selected: Lighter(#DD2222)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and add the line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  image-url: Property(node, "flag")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so that the above block looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@NodeStyle HasLabel(node, "City") {
  image-url: Property(node, "flag")
  color: #DD2222
  color-hover: Lighter(#DD2222)
  color-selected: Lighter(#DD2222)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click &lt;strong&gt;Apply&lt;/strong&gt;, and your result should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EjafmlLx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/9-memgraph-lab-style-editor-1024x561.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EjafmlLx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/9-memgraph-lab-style-editor-1024x561.png" alt="" width="880" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That looks great, but let’s make the names of the cities and nodes a little bit bigger.&lt;/p&gt;

&lt;p&gt;In the Graph Style Editor, locate the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@NodeStyle {
  size: 6
  color: #DD2222
  color-hover: Lighter(#DD2222)
  color-selected: Lighter(#DD2222)
  border-width: 1.8
  border-color: #1d1d1d
  font-size: 7
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and replace it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@NodeStyle {
  size: 10
  color: #DD2222
  color-hover: Lighter(#DD2222)
  color-selected: Lighter(#DD2222)
  border-width: 1.8
  border-color: #1d1d1d
  font-size: 12
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You have increased the node size to 10, and the font size to 12. Now you will update the styling for the relationships. To make them thicker and change their color to red on hover, replace the following code in the Graph Style Editor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@EdgeStyle {
  color: #999999
  color-hover: #1d1d1d
  color-selected: #1d1d1d
  width: 0.9
  width-hover: 2.7
  width-selected: 2.7
  font-size: 7
  label: Type(edge)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@EdgeStyle {
  color: #999999
  color-hover: #ff0000
  color-selected: #1d1d1d
  width: 2
  width-hover: 2.7
  width-selected: 2.7
  font-size: 7
  label: Type(edge)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In case you need it, here is the complete Graph Style Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@NodeStyle {
  size: 10
  color: #DD2222
  color-hover: Lighter(#DD2222)
  color-selected: Lighter(#DD2222)
  border-width: 1.8
  border-color: #1d1d1d
  font-size: 12
}

@NodeStyle HasLabel(node, "City") {
  image-url: Property(node, "flag")
  color: #DD2222
  color-hover: Lighter(#DD2222)
  color-selected: Lighter(#DD2222)
}

@NodeStyle Greater(Size(Labels(node)), 0) {
  label: Format(":{}", Join(Labels(node), " :"))
}

@NodeStyle HasProperty(node, "name") {
  label: AsText(Property(node, "name"))
}

@EdgeStyle {
  color: #999999
  color-hover: #ff0000
  color-selected: #1d1d1d
  width: 2
  width-hover: 2.7
  width-selected: 2.7
  font-size: 7
  label: Type(edge)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below you can see how the graph looks like in the end. I hope that you have enjoyed this short tutorial. Now that you have seen Memgraph in action, I encourage you to keep exploring Memgraph features. A wonderful world of graphs awaits you!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0XFzKuxf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/10-memgraph-lab-map-style-final-1024x561.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0XFzKuxf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://kgolubic.com/wp-content/uploads/2022/10/10-memgraph-lab-map-style-final-1024x561.png" alt="" width="880" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://kgolubic.hashnode.dev/first-steps-with-memgraph#heading-where-to-next"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Where to next?
&lt;/h2&gt;

&lt;p&gt;In this tutorial, you’ve learned how to install Memgraph Platform, use Memgraph Lab to import a dataset, run queries and style your graph. Not bad for a start, right?&lt;/p&gt;

&lt;p&gt;I have promised along the way some more resources, so here they are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://memgraph.com/docs/cypher-manual/"&gt;Cypher manual&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://memgraph.com/docs/memgraph-lab/graph-style-script-language"&gt;Guide to Style Script script&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://memgraph.com/docs/memgraph/how-to-guides/work-with-docker"&gt;How to work with Docker&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope that you had fun going through this tutorial! You can check out &lt;a href="https://memgraph.com/docs/memgraph/tutorials/"&gt;some of the tutorials&lt;/a&gt; that we have prepared for you, or you can go to &lt;a href="https://playground.memgraph.com/"&gt;Memgraph Playground&lt;/a&gt; and go through the guided lessons.&lt;/p&gt;

</description>
      <category>memgraph</category>
    </item>
  </channel>
</rss>
