基于RDBMS的Ignite持久化存储咨询:多MySQL节点部署疑问
Hi Peter, great to hear you're checking out Apache Ignite—it's a really robust tool for distributed in-memory workloads. Let's tackle your questions about using multiple MySQL servers for persistence:
1. Can Ignite connect to multiple MySQL servers for persistence?
Absolutely! Ignite fully supports integrating with multiple MySQL instances, which is exactly the kind of setup you need when a single MySQL server can't hold all your data. You can configure Ignite to use multiple JDBC data sources, each pointing to a different MySQL server, and map different parts of your cache to these sources. This is handled through Ignite's CacheStore interface (or the CacheJdbcPersistenceStore implementation for JDBC-specific setups), where you can define routing logic to direct data partitions to the appropriate MySQL instance.
2. Will connected MySQL servers store identical data or form a complete dataset via distributed storage?
This all comes down to how you configure Ignite's cache mode and persistence:
- Replicated cache mode: If you go this route, each connected MySQL server would end up storing a full copy of your dataset. This is great for high availability, but it doesn't help with your single-server storage limit since you're just duplicating data across servers.
- Partitioned cache mode: This is the setup you're looking for. Ignite splits your entire dataset into smaller partitions, and each partition is persisted to a specific MySQL server. So together, all your MySQL servers make up the complete dataset—each one only holds a subset of the data. This lets you scale your storage horizontally across multiple MySQL instances, which solves your original problem of outgrowing a single server.
To make this work, you'll set cacheMode to PARTITIONED in your CacheConfiguration, and configure your CacheStore to route each partition to the corresponding MySQL data source. You can even use Ignite's affinity mapping if you need fine-grained control over which data goes to which server.
内容的提问来源于stack exchange,提问作者Peter

