0

I am new to Apache Ignite. Here's what I am curious about: Can I setup an ignite cluster as the frontend proxy to distribute requests based on some data column like tenantID, to mysql instances where each mysql instance holds data for single tenant?

Just to make it clear, it is pretty much like a proxy to multiple database instances with same table. So I could save single tenant data into an isolated database.

MT0
  • 143,790
  • 11
  • 59
  • 117
PleaseLetMeGo
  • 125
  • 2
  • 7

2 Answers2

3

It's possible two approaches:

  1. You could implement a custom cache store implementation[1] that uses the right connection depending on the record's attribute.

  2. You could use tenantId as affinity key to map records with the same tenantId to the same partitions. Also a custom affinity function[2] allows to map partitions to corresponded nodes marked with some attribute[3]. On each node the cache store configuration[4] could use a datasource to a concrete mysql server based on node attribute.

  • [1] https://apacheignite.readme.io/docs/3rd-party-store
  • [2] https://apacheignite.readme.io/docs/affinity-collocation#affinity-function
  • [3] https://apacheignite.readme.io/docs/cluster#cluster-node-attributes
  • [4] https://apacheignite.readme.io/docs/3rd-party-store#cachejdbcpojostore
Pavel Vinokurov
  • 334
  • 1
  • 5
0

You can also just use the default cache store implementation, just pass a different data source to each node. It is taken from local Spring container typically.

In this case, every node will only talk to a local MySQL, leading to the consequence that every MySQL only holds data of one node, and then you can configure the distribution via Ignite's facilities.

I have not tried this, but it may be sound.

alamar
  • 18,729
  • 4
  • 64
  • 97