26
Migrating to PostgreSQL 1

Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Migrating to PostgreSQL

1

Page 2: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Introduce myself, the CEDARS project, and the data requirements

Data problem

Key motivations and roadblocks to migration, and how we are overcame them.

Migration

What we’ve learned, and our next steps to complete the migration.

Lessons

01

02

03

Migration of energy efficiency data processing from MS SQL Server to PostgreSQL.

Migrating to PostgreSQL

Talk Roadmap

Page 3: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Migrating to PostgreSQL

Page 4: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Migrating to PostgreSQL

Page 5: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Migrating to PostgreSQL

Page 6: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

http://www.cpuc.ca.gov/

Migrating to PostgreSQL

California Public Utility Commission (CPUC)

Page 7: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Energy efficiency program administrators are required to submit data demonstrating their accomplishments that demonstrate they have a cost effective total portfolio.

If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives.

The CPUC authorizes a $1B per year investment in energy efficiency in CA.

$1,000,000,000Migrating to PostgreSQL

Page 8: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

In the beginning, there was chaos.

Migrating to PostgreSQL

The first three years of data we held were requested as “give us your data” without specification.

Come as you areThe team was manually

processing and Qcing claim data. Data were spit between

different groups and each group developed their own manual

processes.

Manual workIn 2009, we had three years of

data in hand and more data arriving 5x per year.

Data stream flowing

Page 9: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

AUTOMATIONDATA SPEC

CHANGE MGMT INTEGRATION PERFORMANCE

SECURITY

ACCESSIBILITY

Migrating to PostgreSQL

Page 10: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Value lists

DEER

PA claim processing Specification management

Quality control Data access

CEDARS

Calculation engine

CET

Migrating to PostgreSQL

Page 11: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Data

ProgramAdministrators

ED Staff

ED Consultants

QCRun CET

compile

output

Data

EDCS

web

Public

DEER

Migrating to PostgreSQL

Page 12: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Fully automate data processing and QC feedback. Give program administrators real-time data QC feedback.

Automate

Move data processing to an open source platform and eliminate costs while improving performance.

Migrate

Build API integrations between CEDARS and external systems.

Integrate

How can we make energy efficiency data reporting more efficient?

Migrating to PostgreSQL

Page 13: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Comparing RDBMS

Key factors

Database administration overhead Development expense Performance Integration Cost Tools

Migrating to PostgreSQLMigrating to PostgreSQL

Page 14: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

What the CPUC stood to gain

Move SFTP off database server

Security

Eliminate SFTP users, add CPUC ED users, improve public user access

User Access

Data processing and cross-server automations

Automation

Ensure consistency and transparency of

data specifications

Transparency

Data processing that took months is now

done in minutes.

Performance

Provide advanced on-demand data reporting across

multiple data sets.

Reporting

Migrating to PostgreSQL

Page 15: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Migrating to PostgreSQL

Page 16: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Migrating to PostgreSQL

Page 17: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Migrating to PostgreSQL

Page 18: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

TableFieldRuleValue

Migrating to PostgreSQL

ProgramCostPrgYearmatches_year_quarterClaimYearQuarter

Page 19: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Migrating to PostgreSQL

ClaimE3GasSavProfileisnotnullallcoalesce(DeemedMeasure,CustomMeasure)UnitTherm1stBaselinedoesnotequal0ClaimDeliveryTypedoesnotequal'C&S'

TableFieldRule

Where_connectorWhere_table1Where_field1Where_rule1

Where_value1Where_table2Where_field2Where_rule2

Where_value2

Page 20: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Migrating to PostgreSQL

Page 21: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

https://pgloader.io/

https://github.com/dimitri/pgloader

Migrating to PostgreSQL

Page 22: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Agree to build new tools to solve data latency issues and improve data quality.

START

FINISH

Manual processing of the data stream needs to continue while new tools are built.

The new tools take over data processing. Tasks that took months now take minutes.

Migrating to PostgreSQL

Page 23: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

CPUC is consolidating server resources into their new AWS Gov cloud. CEDARS was the first project they brought into AWS Gov. Our three CEDARS database servers cost less than our one MSSS server; all four servers are the same instance type.

We run three PostgreSQL servers on Ubuntu for less cost than our one Windows server.

Server Expense

Migrating to PostgreSQL

Page 24: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

Value lists

DEER

PA claim processing Specification management

Quality control Data access

CEDARS

Calculation engine

CET

Migrating to PostgreSQL

Page 25: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

APIs to external systems enable real-time synchronization. Manual reconciliation was eliminated.

External integrations

Lower server costs, elimination of manual tasks, and elimination of software costs.

Reduced costCEDARS improves communication and collaboration between program administrator and CPUC staff.

Improved relationship

Data processing is fully automated and no manual work is required. Processing happens in minutes.

Low latency Data specifications are version controlled. Updates are made per the change management protocol.

Transparency

Public data access becomes real-time and is expanded. CPUC staff can directly access data.

Better access

Migrating to PostgreSQL

Migrating to PostgreSQL

Increased Automation

Page 26: Migrating to PostgreSQL - SCALE · portfolio. If program administrators hit the savings goals set by the CPUC, they are awarded financial incentives. The CPUC authorizes a $1B per

PostgreSQL for the win

Lighter database administration overhead Lighter development expense Better performance Easier integrations Much lower cost Powerful tools

And the migration to PostgreSQL was painless.

Migrating to PostgreSQL