5 things developers do that drive me crazy · justify the complaints show you what to do since they...

70
5 things developers do that drive me crazy And what I did to survive POUG 2018, Sopot 1

Upload: others

Post on 08-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

5 things developers do that drive me crazy

And what I did to survive

POUG 2018, Sopot1

Page 2: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

About meØyvind Isene

Consultant, work for Sysco in Oslo

Oracle ACE

@OyvindIsene on Twitter

DBA, but haven't restored a database for some time

Don't miss patching, best reason to love the cloud

POUG 2018, Sopot2

Page 3: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

The last 5 yearsDisplaced among developers as a DBA

Optimization aka tuning

Troubleshooting in general

Looking for trouble, before it goes to production

Trying to explain the mindset of DBAs to developers (unsuccessfully)

POUG 2018, Sopot3

Page 4: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

I actually like developmentAPEX and PL/SQL is great fun

R, Python, Scala ...

Other stuff with focus on the data

Development is not just coding

POUG 2018, Sopot4

Page 5: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Agenda and goal for this presentationComplain about developers

Justify the complaints

Show you what to do since they don't care

POUG 2018, Sopot5

Page 6: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Not that I try to start a flame war... but if they could just try to understand how it is to get the responsibility for some crap

when they are all gone.

POUG 2018, Sopot6

Page 7: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Today's development - tomorrow's legacy

Likely to stay there for a long time (∞ ≅ 20 years)

Out of sight, out of mind

POUG 2018, Sopot7

Page 8: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

ThemCreative

Like shiny things

Impatient - they've already got a new idea

Wonder if ITIL is the work of the Devil

POUG 2018, Sopot8

Page 9: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

A persistent storage?Some developers simply refuse to relate to the database

Rambling around about schema-on-read, persistent storage etc.

Tempting to ask them to swim in a data lake

POUG 2018, Sopot9

Page 10: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

UsDon't like being called 2 a.m - boring is good

Too many systems and users to please

Little time for manual tasks

Worries about security, scalability, and uptime

POUG 2018, Sopot10

Page 11: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Doesn't have to be that wayOperations have something to learn from developers

Focus on one tasks once in a while

Do more coding (shell scripts do count!)

Be more creative - automate!

POUG 2018, Sopot11

Page 12: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Can developers learn something from DBAs?Part of reality is unknown to them

Devs are usually less exposed to the entire architecture

DBAs know more about the nature of databases - what works and what doesn't

DevOps can be a good idea

POUG 2018, Sopot12

Page 13: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

1. No data model

Sit down for a think first

POUG 2018, Sopot13

Page 14: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

What were they thinking?Probably not at all

A data model proves that you have spent time understanding your universe

This is the time to meditate over subjects and connections

Abstract expressions need clarifications

POUG 2018, Sopot14

Page 15: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

A way to communicateUse it to communicate with stakeholders normal people

Especially with those who don't share your daily language

If you can't model it, you might not have understood it

Fail early - discover misconceptions early

An important part of documentation

POUG 2018, Sopot15

Page 16: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Avoid crappy data getting in to the database

Less work on data cleansing later

Make sure they are not using the database as a bitbucket

POUG 2018, Sopot16

Page 17: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

When ORM is not the best optionSometimes an object to relational mapping (ORM) tool is not the best option

If the ORM tools decides the data model what do you get?

"Will it scale?"

"May I write you some PL/SQL?"

POUG 2018, Sopot17

Page 18: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

One persistent mythConstraints lead to bad performance

Not true - the optimizer use extra information to create a better plan

POUG 2018, Sopot18

Page 19: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Templates

Source control

Design rules

POUG 2018, Sopot19

Page 20: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

What can you do?Simply demand a data model before you do system acceptance

Look for the usual stuff

Primary, unique, and foreign keys

Other constraints

Decent normalization

Help them with SQL Developer Data Modeler

POUG 2018, Sopot20

Page 21: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

2. Forget about security

Two things can ruin my day: talking about security and licenses

POUG 2018, Sopot21

Page 22: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

But has been on the agenda for a while

Sounds boring to many people

Security is the new HA

POUG 2018, Sopot22

Page 23: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Security is a featurePerhaps a boring subject, but necessary

Does the application collect sensitive data?

This can be identified during data modeling

→ Security must be a proper activity in the project

POUG 2018, Sopot23

Page 24: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

AuthenticationBeing authenticated means the system trust who you are, nothing more

POUG 2018, Sopot24

Page 25: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

AuthorizationNow you are allowed to do something...

At minimum agree on a few roles that give access

POUG 2018, Sopot25

Page 26: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

SSO / one single source for authenticationSign-On / login with a password or similar only once

If you authenticate several times against the same user base (e.g. Active Directory), that

is not SSO.

POUG 2018, Sopot26

Page 27: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Sensitive data and personally identifiable informationGDPR, anyone?

No, you can't have all production data in dev and test

Data masking is easier if you start out with identifying what needs to be masked

→ identify sensitive data before you start

POUG 2018, Sopot27

Page 28: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Audit logsVery useful after data theft

Audit only access to the most critical data

→ another reason to identify sensitive data

POUG 2018, Sopot28

Page 29: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

EncryptionThis is for data at rest or in transit to avoid data being read by unauthorized part.

You can't show encrypted data to users, so you have to decrypt it at some point...

POUG 2018, Sopot29

Page 30: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

SQL injectionJust because they don't want to know about bind variables.

Bonus: If you do this right the database performs better too!

POUG 2018, Sopot30

Page 31: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Sometimes a burdenYou don't make more friends by denying access

Should not be a burden only for the DBA

Possibly a burden for the proxy aka project manager

But the DBA probably worry more about a security break

POUG 2018, Sopot31

Page 32: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Where to implement securityAs close as possible to the data

Doesn't hurt to implement in layers

But an application can get thrown away

→ Don't hide a wide open database behind fire walls only

POUG 2018, Sopot32

Page 33: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

What can you do?Again, ask for a data model

Request an assessment about sensitive data

Repeating review during implementation

Be alert when they ask for elevated privileges

Standard procedure to implement security in different projects

Look into Oracle Database Security Assessment Tool

POUG 2018, Sopot33

Page 34: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

3. Not using the Oracle documentation

RTFM FFS

POUG 2018, Sopot34

Page 35: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

It is OK to google, but...Googling SELECT and ending up in a manual for another database is not cool

Usually easier to lookup the syntax in a bookmarked manual

It is about studying - not always getting a short answer

POUG 2018, Sopot35

Page 36: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Database ConceptsAt least the chapters relevant to design and development (Part I, II, III and VI)

Discover why certain certain patterns do not scale

Understand better critical parts to making the database consistent

POUG 2018, Sopot36

Page 37: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Database Development GuideShould be obvious for developers

Important things in database applications

Correct datatype

Locking

Indexing

PL/SQL

POUG 2018, Sopot37

Page 38: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Database New Features GuideYou can't google what you don't know

Discover new cool stuff that simplifies your application

POUG 2018, Sopot38

Page 39: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

PL/SQL Packages and Types ReferenceShows packages that can replace your code

Gives you ideas for utilizing the database better

POUG 2018, Sopot39

Page 40: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

SQL Language ReferenceMuch faster then googling and finding the wrong version

Discover all the features in Oracle SQL

A few gems have been around for many years, but not used much

→ using advanced SQL can speed up code by orders of magnitude

POUG 2018, Sopot40

Page 41: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

PL/SQL Language ReferenceMaybe you prefer a book?

Useful reference for syntax

POUG 2018, Sopot41

Page 42: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

SQL Tuning GuideWhen you want to figure out performance on your own

Performance as a feature - design for it

There is a chapter Designing and Developing for Performance

POUG 2018, Sopot42

Page 43: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Other specialized guidesData Warehousing Guide

Data Mining Concepts

JSON Developer's Guide

Spatial and Graph Developer's Guide

POUG 2018, Sopot43

Page 44: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Can you trust what Google finds you?Of course not

How can you know if you haven't read the documentation or learned it from a

trustworthy source?

POUG 2018, Sopot44

Page 45: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

What can you do?Have links ready to send out to the team and new members

docs.google.com is a must

Give short introductions to the documentation set

Explain the most important manuals

Recommend good books, blogs and online training material

POUG 2018, Sopot45

Page 46: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

4. Confusing DevOps with operations

Full stack developer?!

POUG 2018, Sopot46

Page 47: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

It takes more than building a containerAdministration is stressful (sometimes)

Availability

Network

N-tier architecture

End users

Patching & upgrades

Backup & Restore

POUG 2018, Sopot47

Page 48: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

DevOps is...... a software engineering culture and practice that aims at unifying software development

(Dev) and software operation (Ops). ... to strongly advocate automation and monitoring at

all steps of software construction, from integration, testing, releasing to deployment and

infrastructure management. (Wikipedia)

If this is done right I'm 90% happy.

But I suspect not all talking about DevOps go the extra mile.

POUG 2018, Sopot48

Page 49: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

In production usually meansPeople depend on it - if it's useful

Data being collected - usually has some value, we don't want to lose it

We discover all the bugs we didn't find by testing before release

POUG 2018, Sopot49

Page 50: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Not enough testingLots of tests, but it fails in production because...

POUG 2018, Sopot50

Page 51: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Can they run their own applications?Small hiccups accumulate over time and causes big problems

We only ask for

No manual intervention in production

Meaningful error messages

Tested for real world scenarios

POUG 2018, Sopot51

Page 52: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Attention span reduxA developer can usually forget what is in production

What if he was forced to do a review once a year?

CV-driven development - what is cool this year?

Frameworks

Methods

New buzzwords

Legacy systems usually last for years

POUG 2018, Sopot52

Page 53: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

POUG 2018, Sopot53

Page 54: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

5. Little understanding of basic concepts

Embarrassing simple ideas

POUG 2018, Sopot54

Page 55: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

LatencyIt starts with late

Simple math

If you repeat a small operation many times it will take a lot of time

This explains why an index is not always the solution

POUG 2018, Sopot55

Page 56: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Classic beginner's latency trapBeginner learns to execute SELECT in database, retrieves N rows.

For each row, generate a new SQL and send N UPDATES to the database

At least N + 1 roundtrips

When all can be done with a slightly more complex UPDATE once.

POUG 2018, Sopot56

Page 57: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Speed of lightAbout 300 000 km/s

1000 km between you and your server; how many round trips in 5 seconds?

POUG 2018, Sopot57

Page 58: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Response timeThe user wants an answer in 5 seconds or less

How much work can you do in available time?

Sorting 500 GB?

2000 roundtrips between application and database?

POUG 2018, Sopot58

Page 59: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

No such thing as a best practiceIf one solution served everybody we will automate it

Plenty of bad practices

Some good practices

POUG 2018, Sopot59

Page 60: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

No idea about volumeSorting small data is very fast

Sorting large data spills to disk - slow

Shuffling lots of data between servers take time

POUG 2018, Sopot60

Page 61: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Slightly more advanced concepts

but if you work with databases...

POUG 2018, Sopot61

Page 62: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

TransactionsConsistent answers to queries

Vendors implement this differently

Logical sequence of update that belong together

Brings the database from one state to another

Know when to commit...

POUG 2018, Sopot62

Page 63: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

LockingData are locked on row level

Oracle never locks data to read it

Writers never block readers

A writer is only blocked by another writer, on the same row

POUG 2018, Sopot63

Page 64: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Multi-versioningYour query gets a consistent answer with respect to the time it started

Queries are never blocked by updates

Oracle can serve many sessions that started at different point in time

POUG 2018, Sopot64

Page 65: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Redo and UndoIs it too much to ask for that developers learn about undo and redo?

For large applications they need to know about the role they have

POUG 2018, Sopot65

Page 66: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

What can you do?Measure everything

Prove where time is spent: outside the database

Locking problems mean they probably don't understand transactions

Ask them to read the Oracle Concepts Guide and start a conversation

POUG 2018, Sopot66

Page 67: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

POUG 2018, Sopot67

Page 68: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

If you lose it

Why not start coding?

POUG 2018, Sopot68

Page 69: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

The world of autonomous databasesThe database will heal itself

Surely it will deal with developers too

There is a high demand of people who know

Security

Data science / AI / ML

How to brew beer

POUG 2018, Sopot69

Page 70: 5 things developers do that drive me crazy · Justify the complaints Show you what to do since they don't care POUG2018,Sopot ... Just because they don't want to know about bind variables

Cheers

POUG 2018, Sopot70