Memgraph’s mission is to bring the power of graphs to every developer in the world. With this release, it’s possible to extend Memgraph functionalities even further and connect to Memgraph from more application stacks. By using the latest capabilities, you can solve more problems and ultimately build your applications faster.
In this version, the Memgraph team added the ability to load custom functions written in C/C++, Python or Rust and callable from any Cypher expressions. Semantically, functions should be a small fragment of functionality that does not require long computations and large memory consumption. The only requirement for functions is not to modify the graph. Mentioned functionality offers flexibility in terms of nested calls within the Cypher.
You will be able to extend Memgraph by any function, but also, the Memgraph team is going to add many pre-defined functions as a part of the MAGE project. In addition to many off-the-shelf functions, you also can optimize performance because, e.g., precompiled C++ functions can massively increase filter expression speed, that’s most obvious for large filter expressions where filtering takes most of the time. The following piece of code is very simple filter expression but it can take a lot of execution time, as of today, it can be subsituted with higly optimized user-defined function.
time2 > time1 AND time3 > time2 AND time4 > time3 AND time5 > time4
Bolt over WebSocket
By implementing Bolt over WebSocket, Memgraph gained the ability to query Memgraph directly from a web browser or Memgraph Lab, which means excellent interoperability between Memgraph and the cloud environment. Furthermore, it’s also possible to connect and query Memgraph directly from WebAssembly clients because a WebSocket connection is required. The team migrated the whole communication stack to Boost Asio. It’s important to mention that Memgraph lost a bit of performance but only on use-cases where the throughput is high (e.g., ~6k+ query/s). On the other side, the new server will make our stack much more robust and cross-platform.
FOREACH is a procedural tool in the declarative (Cypher) environment. It helps to place logic as a part of the query, which means you can write more powerful queries. Also, the clause helps a lot if you don’t have the application environment in some procedural language, e.g. if you build your software in a minimal/no-code environment. The following is an example of a query containing the
MATCH p=(n1)-[*]->(n2) FOREACH (n IN nodes(p) | REMOVE n.marked);
We haven’t spotted many bugs during the timeframe of this release. Ofc, there always has to be something. Memgraph had a bug in the query module loading code, which the team promptly eliminated!
- v2.4 will contain major bug fixes and incremental improvements
- Memgraph splitting into multiple processes will come earliest in v2.5
If you spot any bugs or generally weird behavior, please drop us a line on our issues page and forum. And remember, if you need any kind of information about Memgraph, the documentation site will always be by your side. We also invite you to join our Discord Server and stay informed on everything Memgraph related!