a
New Deployment Model
for
Servoy
Paul Bakker - The Orange Dots - ServoyWorld '17
High Availability
Static & versioned
Secure
No bloat
Automated
(fail-over, deployments, scaling)
.servoy export/import
WAR deployment
Servoy Cluster

/ single db
/ single db server
/ multi db servers
single app server
/ single db
/ single db server
/ multi db servers
multi app servers

| stand-alone app server | WAR | stand-alone container | managed containers | |
|---|---|---|---|---|
| HA - automatic fail-over | nope | nope | nope | yup |
| HA - zero downtime deployment | .servoy upload: possible | Tomcat Parallel Deployment? | Tomcat Parallel Deployment? | yup |
| HA - scaling | nope | nope | nope | yup |
| static & versioned | not enforced | to some extend | pretty much | pretty much |
| Secure | ~ | ~ | ~ | ~ |
| No Bloat | ~ | ~ | ~ | ~ |
| Automated | can be done | can be done | can be done | a lot already done |

Every change === new server launch (and shutting down old versions)
⚫ ⚫ ⚫ ⚫
Different solution
&
Servoy versions in parallel
⚫ ⚫ ⚫ ⚫
Managed Containers


amqpbroadcaster.hostname=localhost
servoy.properties
GitHub


Generic database stuff
no Servoy Sequences
servoy.record.lock.lockInDB=true
databaseManager.acquireLock(...) ONLY within transactions
databaseManager.acquireLock(...) WON'T return until lock acquired (unless...)
no 'select * from ....'
no breaking datamodel changes
| Safe operations | Comments |
|---|---|
| Add column | |
| Drop column | assuming the app isn't using it anymore |
| Add an index concurrently | |
| Drop a constraint (for example, non-nullable) | |
| Add a default value to an existing column |
| Operations to avoid | Workarounds |
|---|---|
| Add index | Add index concurrently |
| Change column type | Add new column, change code to write to both, backfill new column |
| Add column with default value | Add column, add default in separate step, backfill column with default value |
| Add non-nullable column | |
| Add column with unique constraint | Add column, add unique index concurrently, add constraint |
| VACUUM FULL | use pgrepack instead |
Overall: no long-running transactions/locks and queries

| Operations to think about | |
|---|---|
| Adding foreign key constraints | Requires a AccessExclusive lock on both tables, potentially blocking read access |
No,
not this guys this time....
The other one -->>
Sticky sessions
Session draining
Controlled shutdown

API's interact only with current server
application.getActiveClientCount
application.getClientCountForInfo
plugins.headless.getClient/getOrCreateClient
maintenance plugin
usermanager plugin
clientmanager plugin
Misc
No pre/postImport hooks

Cleanup
HSQL as Servoy Repository
Embedded Servlet Engine
Java 9 Modules (?!?)
-
plugins, beans, drivers, lafs, services, component
-
servoy.properties
-
dependancies for unused Servoy Client types
Title Text


Level I:
- Cluster
- Nodes
- Pods
Level II:
- Ingress
- Services
- Deployments
- ReplicaSets
- Jobs
selector:
matchLabels:
run: paragon
matchExpressions:
- {key: exclude, operator: NotIn, values: [true]}label selectors: Deployment / ReplicaSet / Service
labels
run: paragonlabels: Pods

Your database
RabbitMQ
....

Servoy
- Separate read/write database connections
- Table aliases
- DB connection credentials hook
Community
- (Postgres) datamodel migration best practices
- Feedback/input/....

Using
Docker
to deploy your
Servoy application
a New Deployment Model for Servoy
By paulbakker
a New Deployment Model for Servoy
- 2,694