We’re thrilled to announce that FalkorDB-Cloud has added full support for clusters on Google Cloud Platform (GCP)! This update brings scale-out capabilities, multi-tenant architecture, and multi-graph support with full isolation, ensuring the utmost security and privacy for each graph within the same database instance.
With FalkorDB on GCP, you can manage multiple isolated graphs for various domains or clients without sacrificing performance or security, all within a single database.
How to Create a 3-Shard Cluster with FalkorDB-Cloud
Deploying a FalkorDB cluster with 3 shards and 3 replicas is incredibly easy using FalkorDB-Cloud. Follow these simple steps to get started:
Step 1: Sign In to FalkorDB-Cloud
- Visit FalkorDB-Cloud and sign in or create a new account if you don’t have one already.
Step 2: Deploy a new FalkorDB Cluster
- Once logged in, select the FalkorDB Pro tier.
- Choose whether you want to deploy a single-zone or multi-zone cluster in the left sidebar.
- Click on “Create” to open the deployment menu.
Step 3: Configure Cluster Settings
- Select Google Cloud Platform (GCP) as the deployment provider, the region you choose, and fill it out with a name, description, and default password.
- Optionally, adjust the machine type and other settings.
Step 4: Launch the Cluster
- After configuring the cluster, click Create.
- The system will automatically provision and set up your 3-shard, 3-replica cluster on GCP.
- You’ll receive an endpoint to connect to your FalkorDB instance once the setup is complete.
Step 5: Connect to the Cluster
- Once your cluster is up and running, you can use the provided endpoint (under the Connectivity tab) to connect to the FalkorDB database with your preferred client, such as
falkordb-py
(Python) orfalkordb-ts
(TypeScript). - You can also conveniently click the “Connect” button to open the FalkorDB Browser.
Working with Multi-Graphs in FalkorDB-Py (Python)
Once your cluster is live, you can start using multiple isolated graphs within a single database instance. Here’s how to manage graphs using the falkordb-py client:
1. Install FalkorDB-Py
pip install falkordb-py
2. Connect to FalkorDB and Manage Multi-Graphs
from falkordb import FalkorDB
# Connect to the FalkorDB cluster using the provided endpoint
fdb = FalkorDB(host='localhost', port=6379, username='falkordb', password='your-password')
# Create isolated graphs for two different tenants
tenant_1_graph = fdb.select_graph('tenant1_graph')
tenant_2_graph = fdb.select_graph('tenant2_graph')
# Add nodes and relationships to tenant1's graph
tenant_1_graph.query("CREATE (n:Person {name: 'Alice'})-[r:FRIENDS]->(n:Person {name: 'Bob'})")
# Query tenant1's graph (isolated from tenant2's graph)
friends_of_user1 = tenant_1_graph.query("MATCH (u1)-[r:FRIENDS]->(u2) RETURN u2")
print(friends_of_user1.result_set) # Data from tenant1 only
# Add data to tenant2's graph (fully isolated from tenant1)
tenant_2_graph.query("CREATE (n:Person {name: 'Charlie'})-[r:FRIENDS]->(n:Person {name: 'David'})")
# Query tenant2's graph (tenant1's data will not be accessed)
colleagues_of_user3 = tenant_2_graph.query("MATCH (u3)-[r:FRIENDS]->(u2) RETURN u2")
print(colleagues_of_user3.result_set) # Data from tenant2 only
In this example:
- You can easily create and manage multiple isolated graphs within the same database.
- Each tenant’s graph operates in full isolation to ensure data security and privacy.
Working with Multi-Graphs in FalkorDB-TS (TypeScript)
Now, let’s look at how to manage multiple graphs using FalkorDB-TS in a Node.js or TypeScript environment.
1. Install FalkorDB-TS
npm install falkordb
2. Connect to FalkorDB and Use Multi-Graphs
import { FalkorDB } from 'falkordb';
(async () => {
// Initialize the FalkorDB client
const fdb = await FalkorDB.connect({
url: "falkor://your-hostname:6379",
username: "falkordb",
password: "your-password",
});
// Create graphs for different tenants
const tenant1Graph = fdb.selectGraph("tenant1_graph");
const tenant2Graph = fdb.selectGraph("tenant2_graph");
// Add nodes and relationships to tenant1's graph
tenant1Graph.query(
"CREATE (n:Person {name: 'Alice'})-[r:FRIENDS]->(n:Person {name: 'Bob'})"
);
// Query tenant1's graph
tenant1Graph
.query("MATCH (u1)-[r:FRIENDS]->(u2) RETURN u2")
.then((result) => {
console.log("Friends of user1:", result); // Only tenant1's data will be returned
});
// Add data to tenant2's graph (fully isolated from tenant1)
tenant2Graph.query(
"CREATE (n:Person {name: 'Charlie'})-[r:FRIENDS]->(n:Person {name: 'David'})"
);
// Query tenant2's graph
tenant2Graph
.query("MATCH (u3)-[r:FRIENDS]->(u2) RETURN u2")
.then((result) => {
console.log("Colleagues of user3:", result); // Only tenant2's data will be accessed
});
})();
In this TypeScript example:
- You’re managing multiple isolated graphs with ease, ensuring full data security and privacy between tenants.
Conclusion
With the new Cluster support on GCP, FalkorDB-Cloud allows you to scale out your graph databases effortlessly while offering full multi-tenant and multi-graph support. Each graph operates with full isolation, ensuring that your data remains secure and private, even within the same database instance.
Setting up a 3-shard, 3-replica cluster has never been easier, thanks to FalkorDB-Cloud’s intuitive interface. Now, you can focus on building powerful AI and graph-based applications with the peace of mind that your database will scale with your needs and keep your data secure.
Ready to get started? Head over to FalkorDB-Cloud and experience the power of FalkorDB with scale-out, multi-tenant graph databases today!