DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Database Bottlenecks Nobody Talks About: Optimizing SQL Queries Beyond Indexing
  • Useful System Table Queries in Relational Databases
  • Fine-Tuning Performance, Resolving Common Issues in FinTech Application With MySQL
  • Optimizing Data Management: Migrating From AWS RDS MySQL to Snowflake

Trending

  • ScyllaDB in Enterprise Java: High-Performance NoSQL With Eclipse JNoSQL
  • Avoiding AI Debt as a Team
  • Beyond the Wall of Charts: How Advanced Observability Displaced the Telemetry Dashboard
  • Taming Parameter Sniffing in SQL Server 2022 With PSP Optimization

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Databases
  4. Implementing JDBC Persistent Object Store With Anypoint Clustering | MySQL Database

Implementing JDBC Persistent Object Store With Anypoint Clustering | MySQL Database

Clustering is group of nodes that act as a single unit. With JDBC Persistent Object Store, data can be persisted in case of Mule Runtime failure, crashes or shutdown.

By 
Jitendra Bafna
·
Updated Aug. 21, 21 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
19.2K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

In this blog, we will be discussing about implementing persistent object store using MYSQL with Anypoint Clustering. We will going to see that how we can use MYSQL database to persist the object store data. One of the advantages of using persistent object store is that we will be not loosing data in case Mule Runtime or Mule Application get restarted or shutdown or crashes. In such cases, your object store data will persisted in Database. 

Enabling Persistent Object Store Using MySQL With Anypoint Clustering

To enable, Persistent object store using MySQL required few steps and there are few prerequisites.

Below list of the relational databases supported

  • MySQL 5.5+
  • PostgreSQL 9
  • Microsoft SQL Server 2014

To enable persistent object store, add below list of properties to {MULE_HOME}/.mule/mule-cluster.properties. This properties needs to be add to all nodes in the cluster.

  • mule.cluster.jdbcstoreurl: JDBC Connection URL to database
  • mule.cluster.jdbcstoreusername: Database username
  • mule.cluster.jdbcstorepassword: Database user password
  • mule.cluster.jdbcstoredriver: JDBC Driver class name
  • mule.cluster.jdbcstorequerystrategy: SQL dialect (It can be mysql, mssql, postgresql)

In our article, we will use MySQL as a Database for persistent object store and value for above properties will look like this.

Plain Text
 
mule.cluster.jdbcstoreurl=jdbc:mysql://localhost:3306/object_store
mule.cluster.jdbcstoreusername=root
mule.cluster.jdbcstorepassword=sqlserver12345
mule.cluster.jdbcstoredriver=com.mysql.cj.jdbc.Driver
mule.cluster.jdbcstorequerystrategy=mysql

In above example, I have used object_store as database. You can provide any name according to your convenience and make sure database is created before adding above properties.

Now, you need to copy driver file to {MULE_HOME}/lib/user. In my case, I have copied mysql-connector-java-8.0.26.jar file and that is MySQL driver file will be used to enable connection with MySQL database. 

Once above configuration is done, you just need to restart the cluster.

The database’s tables are created automatically once you deploy application having persistent object store, as this feature creates tables for each different object store that you want to persist.
Two tables are created per object store:

  • One table stores data
  • Another table stores partitions.

Recommendation for Object store Database

  • Create dedicated Schema or Database that can be only used by JDBC Object Store.
  • Always keep in mind that the data storage needs to be hosted in a centralized DB reachable from all nodes.  
  • The database username configured for JDBC Object Store needs to have permission to:
    • Create objects in the database (DDL), CREATE and DROP for tables.
    • Access and manage the objects it creates (DML), INSERT, UPDATE, DELETE, and SELECT.

Here is the step by step video tutorial explaining how to enable JDBC Persistent Object Store With Anypoint Clustering.


You can learn more about Anypoint Clustering here.

Now, you know how to implement JDBC Persistent Object Store With Anypoint Clustering.

Relational database Object (computer science) MySQL clustering

Opinions expressed by DZone contributors are their own.

Related

  • Database Bottlenecks Nobody Talks About: Optimizing SQL Queries Beyond Indexing
  • Useful System Table Queries in Relational Databases
  • Fine-Tuning Performance, Resolving Common Issues in FinTech Application With MySQL
  • Optimizing Data Management: Migrating From AWS RDS MySQL to Snowflake

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook