This document describes specific details about upgrading an existing installation to AtomServer version 2.3.
General Information
AtomServer 2.3 broke the single DataSource (which was indentified by
the Spring bean; org.atomserver-dataSource)
into
three distinct DataSources. These new DataSources include;- A Read-only DataSource (org.atomserver-read-dataSource). Used for all read operations (GET), except Aggregate Feeds/Entries.
- A Read-write DataSource (org.atomserver-dataSource). Used for all write operations (PUT, POST, DELETE)
- An Aggregate DataSource (org.atomserver-aggregate-dataSource). Used for all Aggregate Feeds/Entries reads.
- Different timeouts at the JDBC layer. This is critical, since a JDBC timeout signals the DB to stop (as well as the Server), which means that we actually remove the load from the DB. Note that pre-2.3 the overall timeout was based on Aggregate Feeds, which because that query can perform terribly when it is not "near the tip" of a Feed of a very large dataset, the timeout was set quite large, and was, thus, relatively useless. The new timeouts settings might look something like;
- Read-write = a number slightly less than the "latency time"
- Read-only = 120s (or some such. YMMV)
- Aggregate = 1200s (or some such. YMMV)
- Different pool sizes. This will provide throttling, particularly for Aggregates, and will allow us a certain level of protection from Aggregates gone wild.
Conversion
All that has to be done to upgrade an existing application to AtomServer 2.3 is the following steps.1) If you have extended any of the AtomServer Beans (e.g. databaseBeans.xml), you will need to change the location of the Classes that have moved around. The org.atomserver.core.dbstore.dao package was refactored. And in particular the Class; org.atomserver.core.dbstore.dao.EntriesDAOiBatisImpl was moved to org.atomserver.core.dbstore.dao.impl.EntriesDAOiBatisImpl.
2) Define the newly required Java properties in your "env files". You don't actually have to do this. The new properties are defaulted as folows. Note, db.poolsize.max is the pool size of the read-write DataSource. But you will probbaly want to trim these pool sizes down since there are now 3 separate pools.
db.read.poolsize.max=${db.poolsize.max}
db.aggregate.poolsize.max=${db.poolsize.max}
db.aggregate.poolsize.max=${db.poolsize.max}
3) If you extend databaseBeans.xml yourself, then you may want to take advantage of the 3 new DataSources. For example, a databaseBeans.xml might look like this;
<?xml
version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!-- NOTE: the timeouts are set in the JDBC URLs -->
<bean id="com.homeaway-sqlserver-jtds-BASE-dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close"
lazy-init="true"
depends-on="org.atomserver-propertyConfigurer"
abstract="true" >
<property name="driverClassName" value="${db.driver}"/>
<property name="username" value="${db.username}"/>
<property name="password" value="${db.password}"/>
<property name="maxWait" value="${db.pool.maxWait}"/>
</bean>
<bean id="org.atomserver-dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
parent="com.homeaway-sqlserver-jtds-BASE-dataSource" >
<property name="url" value="${db.url}"/>
<property name="maxActive" value="${db.poolsize.max}"/>
<property name="initialSize" value="${db.poolsize.init}" />
</bean>
<bean id="org.atomserver-read-dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
parent="com.homeaway-sqlserver-jtds-BASE-dataSource" >
<property name="url" value="${db.read.url}"/>
<property name="maxActive" value="${db.read.poolsize.max}"/>
<property name="initialSize" value="${db.read.poolsize.init}" />
</bean>
<bean id="org.atomserver-aggregate-dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
parent="com.homeaway-sqlserver-jtds-BASE-dataSource" >
<property name="url" value="${db.url}"/>
<property name="maxActive" value="${db.aggregate.poolsize.max}"/>
<property name="initialSize" value="${db.aggregate.poolsize.init}" />
</bean>
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!-- NOTE: the timeouts are set in the JDBC URLs -->
<bean id="com.homeaway-sqlserver-jtds-BASE-dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close"
lazy-init="true"
depends-on="org.atomserver-propertyConfigurer"
abstract="true" >
<property name="driverClassName" value="${db.driver}"/>
<property name="username" value="${db.username}"/>
<property name="password" value="${db.password}"/>
<property name="maxWait" value="${db.pool.maxWait}"/>
</bean>
<bean id="org.atomserver-dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
parent="com.homeaway-sqlserver-jtds-BASE-dataSource" >
<property name="url" value="${db.url}"/>
<property name="maxActive" value="${db.poolsize.max}"/>
<property name="initialSize" value="${db.poolsize.init}" />
</bean>
<bean id="org.atomserver-read-dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
parent="com.homeaway-sqlserver-jtds-BASE-dataSource" >
<property name="url" value="${db.read.url}"/>
<property name="maxActive" value="${db.read.poolsize.max}"/>
<property name="initialSize" value="${db.read.poolsize.init}" />
</bean>
<bean id="org.atomserver-aggregate-dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
parent="com.homeaway-sqlserver-jtds-BASE-dataSource" >
<property name="url" value="${db.url}"/>
<property name="maxActive" value="${db.aggregate.poolsize.max}"/>
<property name="initialSize" value="${db.aggregate.poolsize.init}" />
</bean>
</beans>
AtomServer, Upgrading to
AtomServer 2.3