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
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • The Complete Tutorial on the Top 5 Ways to Query Your Relational Database in JavaScript - Part 2
  • Fine-Tuning Performance, Resolving Common Issues in FinTech Application With MySQL
  • Optimizing Data Management: Migrating From AWS RDS MySQL to Snowflake
  • Sample Data Generation With Built-In Database Capabilities

Trending

  • How to Convert XLS to XLSX in Java
  • Beyond Simple Responses: Building Truly Conversational LLM Chatbots
  • Contextual AI Integration for Agile Product Teams
  • Building Custom Tools With Model Context Protocol
  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 user avatar
Jitendra Bafna
DZone Core CORE ·
Updated Aug. 21, 21 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
18.6K Views

Join the DZone community and get the full member experience.

Join For Free

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

  • The Complete Tutorial on the Top 5 Ways to Query Your Relational Database in JavaScript - Part 2
  • Fine-Tuning Performance, Resolving Common Issues in FinTech Application With MySQL
  • Optimizing Data Management: Migrating From AWS RDS MySQL to Snowflake
  • Sample Data Generation With Built-In Database Capabilities

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!