Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL

Martijn Dashorst
Martijn DashorstSoftware engineer at Topicus Onderwijs
Converting 85% of Dutch Primary Schools 

from Oracle to PostgreSQL
Martijn Dashorst

topicus.nl
Martijn Dashorst
@dashorst
martijndashorst.com
github.com/dashorst
“I’d rather not work with
databases”
Martijn Dashorst (1997, first job interview)
Big thank you to
Klaasjan Brand
Please Give Feedback at

https://2019.pgconf.eu/f
What is ParnasSys?
Why migrate?
Planning
Stages
Conclusions & Questions
Dutch Education System
AGES
4-12
13-16/18
16-23
Primary Education
Secondary Education
Vocational/University Education
pre-vocational (4 yrs), pre-applied science (5 yrs), pre-research university (6 yrs)
vocational (4 yrs), applied science (4 yrs, bachelor), pre-research university (bachelor/master)
EDUCATION TYPE
Primary Education (4-12)
1.5M
students
141k
employees
6973
schoolsages 4-12, 2019-2020 2018 2018
Source: https://www.onderwijsincijfers.nl
Financing Primary Schools
€ government
school
teachers
buildings
materials
€
taxes lumpsum
number of

students

at 1 October
Financing Primary Schools
€ government
school
teachers
buildings
materials
€
taxes lumpsum
number of

students

at 1 October
administration
ParnasSys ~ noun. 

1. A SaaS to run primary schools by keeping student
records for school financing, student counseling and
guidance, attendance keeping and communicating with
parents


ParnasSys ~ noun. 

1. A SaaS to run primary schools by keeping student
records for school financing, student counseling and
guidance, attendance keeping and communicating with
parents
2. The only pinkmagenta administration 

system in the world
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL
Java Web App
Hibernate (ORM)
Business Objects
(SAP)
MAXDB/SAPDB
Single database

Single schema

Multi-tenant
Development started

October 2003
Production in 

April 2004
First Database Migration in 2005
SAPDB/MAXDB ORACLE
User base growing fast

Unpredictable query performance in MaxDB
"Nobody got ever fired
for buying Oracle"
85% of dutch
primary schools
use ParnasSys
~5M student dossiers
in our database
1,270,000 students in 2019-2020
2019
85% of dutch
primary schools
use ParnasSys
~5M student dossiers
in our database
1,270,000 students in 2019-2020
2019
800+ pages 360 tables data & indices
~ 2TB
user files
~ 5TB
What is ParnasSys?
Why migrate?
Planning
Stages
Conclusions & Questions
Mismatch Between Future of
Oracle and our Product
Cost Structure of Running
Oracle Not Compatible with our
Profitability
The Oracle Migration Assistant
Paid Us a Visit
TM
The stranglehold

of the software giants
[...] Especially Oracle would
force unfair contracts upon
clients, and claim many millions
per year of late payments. [...]
http://fd.nl/weekend/1318745/de-wurggreep-van-de-softwarereuzen
Developer Happiness
Or How Do I Run My Database
on My Local Machine
DevOps Happiness on Oracle
is Incompatible with our
Profitability
What is ParnasSys?
Why migrate?
Planning
Stages
Conclusions & Questions
Inventory
✅ Database contents

✅ Java Application Code

✅ Business Objects Universe

✅ Business Objects Reports

✅ Backup & Restore

✅ Monitoring

✅ Training
🚫 No stored procedures

🚫 No custom functions

🚫 No triggers
Seasonality of Education
2 Moments in a Year to Migrate:
X-Mas & Summer Vacation
X-Mass 2 weeks
23 December 2019–5 January 2020
Summer vacation(s)
North
15 juli 2019–23 august 2019

Middle
22 juli 2019–30 august 2019

South
8 juli 2019–16 august 2019
Ideal migration moment:

start of summer vacation
Stage 1: make it run

incorrectly, correctly, fast

Stage 2: migrate production

in accordance to customer expectations
1 Year Migration
1 Year Migration
3 Year Migration
What is ParnasSys?
Why migrate?
Planning
Stages
Conclusions & Questions
Stage 1: make it run
Free

Works™

Great to find issues in your
application
Perl

“The only language that looks the same before
and after RSA encryption”

Direct datatype mapping

E.G. number(1,0) does not map to boolean

Slow

One import takes whole day

Stable or fast (pick one)

Single-threaded: stable but slow

Multi-threaded: fast but unstable

One-way, big bang only
Differences between Oracle and PostgreSQL
“The good thing about standards is that there are
so many to choose from.”
― Andrew S. Tanenbaum
Mapping datatypes
Oracle PostgreSQL
number(1,0) number(1,0)
boolean
Java
int
boolean
enum Sex {

Female,
Male

}
Business
study year (1-8)
present (yes/no)
sex (female/male)
number(1,0)
number(1,0) number(1,0)
varchar2(6) varchar2(6)
ORM is 100% portable
@Basic
@Temporal(TemporalType.DATE)
private Date birthdate;
@Formula("add_months(birthdate, (to_char(sysdate, 'yyyy') to_char(birth
@Temporal(TemporalType.DATE)
private Date birthday;
CREATE OR REPLACE FUNCTION birthday(birthdate IN DATE) RETURN D
IS
BEGIN
RETURN add_months(birthdate-1, 

(to_char(sysdate, 'yyyy')
- to_char(birthdate, 'yyyy')) * 12)+1;
END;
Oracle speaks in tongues
select 1 from dual
select nvl(null, 'n/a') from dual
select * from (select x,y from ...) 

where rownum between 100 and 110
sysdate
trunc
Performance
ID ORGANIZATION NAME BIRTHDATE ...

14342 1231 JOHN SMITH 2010-09-23
14345 1231 MARTIJN DASHORST 2011-03-12
...
ID ORGANIZATION NAME

151231 1231 Group 1A
151232 1231 Group 1B
...
tenant identifier
Oracle is smarter...
UPDATE
testresult tr
SET
tr.endresult = TRUE
WHERE
tr.organisation = ?
AND tr.testpart IN (
SELECT part1.id
FROM
testpart part1
WHERE
part1.preference = (
SELECT MIN(part2.preference)
FROM
testresult tr3
INNER JOIN testpart part2 ON
tr3.testpart = part2.id
WHERE
part2.preference > 0
AND tr3.score IS NOT NULL
AND tr3.test = tr.test
AND ((part1.usemodulenorm IS NULL
AND part2.usemodulenorm IS NULL)
OR part1.usemodulenorm = part2.usemodulenorm)))
Oracle is smarter...UPDATE
testresult tr
SET
tr.endresult = TRUE
WHERE
tr.organisation = ?
AND tr.testpart IN (
SELECT part1.id
FROM
testpart part1
WHERE
part1.preference = (
SELECT MIN(part2.preference)
FROM
testresult tr3
INNER JOIN testpart part2 ON
tr3.testpart = part2.id
WHERE
part2.preference > 0
AND tr3.test = tr.test
UPDATE
testresult tr
SET
tr.endresult = TRUE
WHERE
tr.organisation = ?
AND tr.testpart IN (
SELECT part1.id
FROM
testpart part1
WHERE
part1.preference = (
SELECT MIN(part2.preference)
FROM
testresult tr3
INNER JOIN testpart part2 ON
tr3.testpart = part2.id
WHERE
part2.preference > 0
AND tr3.test = tr.test
AND tr3.organisation = tr.organisation))
100x
improvement
Java Web App
Business Objects
(SAP)
PDF
Universe
Report definition
Parameters
PDF
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL
Teachers Generate a lot of PDFs

but that's OK, because 

Business Objects generates a lot of SQL
Business Objects 

can be a bit nostalgic
Quizz!
SELECT *
FROM A, B
WHERE B.column(+) = A.column
SELECT *
FROM A
RIGHT OUTER JOIN B
ON B.column = A.column
SELECT *
FROM B
LEFT OUTER JOIN A
ON B.column = A.column
SELECT *
FROM A
LEFT OUTER JOIN B
ON B.column = A.column
SELECT *
FROM B
RIGHT OUTER JOIN A
ON B.column = A.column
1 2
3 4
Quizz!
SELECT *
FROM A, B
WHERE B.column(+) = A.column
SELECT *
FROM A
RIGHT OUTER JOIN B
ON B.column = A.column
SELECT *
FROM B
LEFT OUTER JOIN A
ON B.column = A.column
1 2
Production ready?
Application works

Business Objects works
GO!
Application works

Business Objects works
GO!
How long takes migration?
Behavior of application under actual load?

- Heavy use of application side caching in Java process

- Modification of data

- Synthetic tests lie
Can we fall back to Oracle?
Stage 2: Migrate Production
Need help...

1-800-KILLORACLE
Why don't you use HVR?
–Splendid Data
Cross-database replication
using redo logs
Remote UNIX

Machine
Remote XYZ

Machine
Hub Machine
PC
HVR
HVR
Scheduler HVR
HVR
HVR
GUI
Database
Location
Hub DB
Database
Location
IntegrateCapture
Inetd
Router
Transaction
Files
Inetd
HVR
Listener
Service
Lots of databases supported
Lots of databases supported
Why HVR?
• Speed

• Real-time sync with low latency

• Options to test prior to actual migration

• Safe

• Fallback

• Expensive tool, but Special Price for Special Friend
Noteworthy issues
• Use primary key on each table

• Fix datatype incompatibilities because of differences between databases

E.G. time in date field ✅ Oracle 🚫 PostgreSQL

• Disable constraint checking in target database

• Don't perform DDL changes

• Don't update too many rows in a table too often
Oracle based deployment
DB1
PROD
failsafe
DB0
PROD TEST
APP
PROD
Business
Objects
APP
TEST
ORACLEORACLE ORACLE
APP
PROD
APP
PROD
Fail safe server
Offline

Archive Log shipping
DB0 DB1 DB2
PROD PROD TEST
TEST
failsafe
TEST
PROD
failsafe
PROD

standby
APP
PROD
Business
Objects
APP
TEST
ORACLEORACLE
ORACLE
ORACLE
PSQL PSQL
PSQL
HVR migration deployment
DB0 DB1 DB2
PROD PROD TEST
TEST
failsafe
TEST
PROD
failsafe
PROD

standby
APP
PROD
Business
Objects
APP
TEST
ORACLEORACLE
ORACLE
ORACLE
PSQL PSQL
PSQL
Prod Testing Business Objects
PostgreSQL based deployment
DB1 DB2
PROD
failsafe
DB1
PROD TEST
APP
PROD
Business
Objects
APP
TEST
PSQLPSQL PSQL
APP
PROD
APP
PROD
DB0
PROD
ORACLE
D-Dayde-oracle day
22 Juli 2019
Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL
What is ParnasSys?
Why migrate?
Planning
Stages
Conclusions & Questions
Make a *really* good inventory of things that have to be migrated

Pick a strategy that works for you

Plan around your business to minimise risk and maximise opportunity

A great way to find bugs in your system

Don't be afraid to pay for tools and help
“Nobody got fired from
migrating away from Oracle”
“Yet”
Migrate our Secondary Education
Application from Oracle to PostgreSQL
Feedback

https://2019.pgconf.eu/f
Questions?
THANK YOU!
@dashorst
martijndashorst.com
github.com/dashorst
1 of 79

Recommended

Pradeepa dharmappa by
Pradeepa dharmappaPradeepa dharmappa
Pradeepa dharmappaPradeep Pradeep
115 views4 slides
Pradeepa dharmappa by
Pradeepa dharmappaPradeepa dharmappa
Pradeepa dharmappaPradeep Pradeep
108 views4 slides
Chia Shin Fatt CV by
Chia Shin Fatt CVChia Shin Fatt CV
Chia Shin Fatt CVChia Shin Fatt
585 views7 slides
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity by
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
[EPPG] Oracle to PostgreSQL, Challenges to OpportunityEqunix
263 views55 slides
RajeshS_ETL by
RajeshS_ETLRajeshS_ETL
RajeshS_ETLRajesh Sundaram
200 views7 slides

More Related Content

Similar to Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL

Challenges of Operationalising Data Science in Production by
Challenges of Operationalising Data Science in ProductionChallenges of Operationalising Data Science in Production
Challenges of Operationalising Data Science in Productioniguazio
325 views50 slides
Insync10 anthony spierings by
Insync10 anthony spieringsInsync10 anthony spierings
Insync10 anthony spieringsInSync Conference
332 views34 slides
Resume by
ResumeResume
ResumeAbhijit Ghosh
223 views3 slides
Jithender_3+Years_Exp_ETL Testing by
Jithender_3+Years_Exp_ETL TestingJithender_3+Years_Exp_ETL Testing
Jithender_3+Years_Exp_ETL TestingjithenderReddy Gunda
854 views5 slides
Girish_Resume by
Girish_ResumeGirish_Resume
Girish_ResumeBhuvaneshwari Balasundaram
85 views4 slides
Ravikanth_CV_10 yrs_ETL-BI-BigData-Testing by
Ravikanth_CV_10 yrs_ETL-BI-BigData-TestingRavikanth_CV_10 yrs_ETL-BI-BigData-Testing
Ravikanth_CV_10 yrs_ETL-BI-BigData-TestingRavikanth Marpuri
473 views6 slides

Similar to Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL(20)

Challenges of Operationalising Data Science in Production by iguazio
Challenges of Operationalising Data Science in ProductionChallenges of Operationalising Data Science in Production
Challenges of Operationalising Data Science in Production
iguazio325 views
Ravikanth_CV_10 yrs_ETL-BI-BigData-Testing by Ravikanth Marpuri
Ravikanth_CV_10 yrs_ETL-BI-BigData-TestingRavikanth_CV_10 yrs_ETL-BI-BigData-Testing
Ravikanth_CV_10 yrs_ETL-BI-BigData-Testing
Ravikanth Marpuri473 views
Cv software engineer ameen odeh 2018 by Ameen odeh
Cv software engineer ameen odeh 2018Cv software engineer ameen odeh 2018
Cv software engineer ameen odeh 2018
Ameen odeh28 views
Resume_20112016 by Tara Panda
Resume_20112016Resume_20112016
Resume_20112016
Tara Panda265 views
Lokesh_Reddy_Datastage_Resume by Lokesh Reddy
Lokesh_Reddy_Datastage_ResumeLokesh_Reddy_Datastage_Resume
Lokesh_Reddy_Datastage_Resume
Lokesh Reddy618 views
Mani_Sagar_ETL by Mani Sagar
Mani_Sagar_ETLMani_Sagar_ETL
Mani_Sagar_ETL
Mani Sagar339 views

More from Martijn Dashorst

HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0 by
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0Martijn Dashorst
1.2K views100 slides
From Floppy Disks to Cloud Deployments by
From Floppy Disks to Cloud DeploymentsFrom Floppy Disks to Cloud Deployments
From Floppy Disks to Cloud DeploymentsMartijn Dashorst
98 views102 slides
SOLID principles by
SOLID principlesSOLID principles
SOLID principlesMartijn Dashorst
366 views72 slides
Solutions for when documentation fails by
Solutions for when documentation fails Solutions for when documentation fails
Solutions for when documentation fails Martijn Dashorst
933 views123 slides
Whats up with wicket 8 and java 8 by
Whats up with wicket 8 and java 8Whats up with wicket 8 and java 8
Whats up with wicket 8 and java 8Martijn Dashorst
491 views108 slides
Code review drinking game by
Code review drinking gameCode review drinking game
Code review drinking gameMartijn Dashorst
1.1K views14 slides

More from Martijn Dashorst(20)

HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0 by Martijn Dashorst
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
Martijn Dashorst1.2K views
Solutions for when documentation fails by Martijn Dashorst
Solutions for when documentation fails Solutions for when documentation fails
Solutions for when documentation fails
Martijn Dashorst933 views
Who Automates the Automators? (Quis Automatiet Ipsos Automates?) by Martijn Dashorst
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Martijn Dashorst606 views
Apache Wicket and Java EE sitting in a tree by Martijn Dashorst
Apache Wicket and Java EE sitting in a treeApache Wicket and Java EE sitting in a tree
Apache Wicket and Java EE sitting in a tree
Martijn Dashorst2.1K views
Keep your Wicket application in production by Martijn Dashorst
Keep your Wicket application in productionKeep your Wicket application in production
Keep your Wicket application in production
Martijn Dashorst3.5K views
Guide To Successful Graduation at Apache by Martijn Dashorst
Guide To Successful Graduation at ApacheGuide To Successful Graduation at Apache
Guide To Successful Graduation at Apache
Martijn Dashorst534 views

Recently uploaded

Mobile App Development Company by
Mobile App Development CompanyMobile App Development Company
Mobile App Development CompanyRichestsoft
5 views6 slides
Quality Engineer: A Day in the Life by
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the LifeJohn Valentino
10 views18 slides
JioEngage_Presentation.pptx by
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptxadmin125455
9 views4 slides
Introduction to Git Source Control by
Introduction to Git Source ControlIntroduction to Git Source Control
Introduction to Git Source ControlJohn Valentino
8 views18 slides
Introduction to Maven by
Introduction to MavenIntroduction to Maven
Introduction to MavenJohn Valentino
7 views10 slides
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... by
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...NimaTorabi2
17 views17 slides

Recently uploaded(20)

Mobile App Development Company by Richestsoft
Mobile App Development CompanyMobile App Development Company
Mobile App Development Company
Richestsoft 5 views
Quality Engineer: A Day in the Life by John Valentino
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
John Valentino10 views
JioEngage_Presentation.pptx by admin125455
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptx
admin1254559 views
Introduction to Git Source Control by John Valentino
Introduction to Git Source ControlIntroduction to Git Source Control
Introduction to Git Source Control
John Valentino8 views
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... by NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi217 views
Understanding HTML terminology by artembondar5
Understanding HTML terminologyUnderstanding HTML terminology
Understanding HTML terminology
artembondar58 views
Supercharging your Python Development Environment with VS Code and Dev Contai... by Dawn Wages
Supercharging your Python Development Environment with VS Code and Dev Contai...Supercharging your Python Development Environment with VS Code and Dev Contai...
Supercharging your Python Development Environment with VS Code and Dev Contai...
Dawn Wages5 views
predicting-m3-devopsconMunich-2023-v2.pptx by Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app14 views
aATP - New Correlation Confirmation Feature.pptx by EsatEsenek1
aATP - New Correlation Confirmation Feature.pptxaATP - New Correlation Confirmation Feature.pptx
aATP - New Correlation Confirmation Feature.pptx
EsatEsenek1222 views
Electronic AWB - Electronic Air Waybill by Freightoscope
Electronic AWB - Electronic Air Waybill Electronic AWB - Electronic Air Waybill
Electronic AWB - Electronic Air Waybill
Freightoscope 6 views
Top-5-production-devconMunich-2023-v2.pptx by Tier1 app
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
Tier1 app9 views

Converting 85% of Dutch Primary Schools from Oracle to PostgreSQL