Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Data Partitioning Help

What version are you using?

There was an issue with the hash function in the initial release, it used &
vs %.  Try the latest release, or subclass the HashPolicy.  Hashing should
scale well.

You can create your own policy for using memcache if you desire.

If still having issue include your code where you define the hash policy.


Attila-3 wrote:
> 
> Hello Everyone,
> 
> I am new to EclipseLink and have a couple of questions regarding
> Partitioning policies.
> 
> I followed the example at:
> 
> http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Data_Partitioning
> 
> I annotated my entity with the HashPartitioning policy but I am unable to
> get any entities to be persisted to the 'node2' connection pool.
> 
> Here is my persistence.xml:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
> http://java.sun.com/xml/ns/persistence
> http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd";>
>   <persistence-unit name="MServicePU" transaction-type="RESOURCE_LOCAL">
>     <class>com.e.m.persistence.Conv</class>
>     <properties>
>       <property name="javax.persistence.jdbc.driver"
> value="com.mysql.jdbc.Driver"/>
>       <property name="javax.persistence.jdbc.url" value="jdbc:mysql://
> server-dev-db.example.com:3306/t_c_db_1"/>
>       <property name="javax.persistence.jdbc.user" value="root"/>
>       <property name="javax.persistence.jdbc.password" value="pass"/>
>       <!-- The database platform is auto-detected by default,
>                  if you want to set a specific platform this can be set.
> -->
>       <!-- property name=""eclipselink.target-database" value="Oracle" /
> -->
>       <!-- Configure connection pool. -->
>       <property name="eclipselink.connection-pool.default.initial"
> value="10"/>
>       <property name="eclipselink.connection-pool.default.min"
> value="64"/>
>       <property name="eclipselink.connection-pool.default.max"
> value="64"/>
>       <!-- Configure 2nd database connection pool. -->
>       <property name="eclipselink.connection-pool.node2.url"
> value="jdbc:mysql://server-dev-db.example.com:3306/t_c_db_2"/>
>       <property name="eclipselink.connection-pool.node2.user"
> value="root"/>
>       <property name="eclipselink.connection-pool.node2.password"
> value="pass"/>
>       <property name="eclipselink.connection-pool.node2.initial"
> value="10"/>
>       <property name="eclipselink.connection-pool.node2.min" value="64"/>
>       <property name="eclipselink.connection-pool.node2.max" value="64"/>
>       <property name="eclipselink.connection-pool.node2.initial"
> value="10"/>
>       <property name="eclipselink.connection-pool.node2.min" value="64"/>
>       <property name="eclipselink.connection-pool.node2.max" value="64"/>
>       <property name="eclipselink.partitioning" value="Replicate" />
>     </properties>
>   </persistence-unit>
> </persistence>
> 
> Some questions I have are:
> 
> Will HashPartitioning scale to 10+ shards? (Where I have millions of
> records
> in each shard that will be heavily loaded with 50/50 read/writes)
> 
> Would I be able to use the PartitioningPolicy to define my own policy that
> does a lookup in memcache for what shard to route requests to? If it is
> not
> present in memcache then I would need to scan all shards to find the
> entities ID, then populate memcache -- to then finally return the shard
> connection pool. Does this sound like it would work reasonably well?
> 
> Are there more examples/documentation that I could look at?
> 
> Thank you,
> 
> -- 
> Atman
> Software Developer
> atteeela@xxxxxxxxx
> 
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
Blog:  http://java-persistence-performance.blogspot.com/ Java Persistence
Performance 
-- 
View this message in context: http://old.nabble.com/Data-Partitioning-Help-tp32237824p32379528.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top