best practice in software development

27
Best Practice in software development Dipl. Inform.(FH) Jony Sugianto, M. Comp. Sc. WA:0812-13086659 Email:[email protected]

Upload: sarccom

Post on 12-Apr-2017

116 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Best Practice In Software Development

Best Practice in software development

Dipl. Inform.(FH) Jony Sugianto, M. Comp. Sc.WA:0812-13086659Email:[email protected]

Page 2: Best Practice In Software Development

Agenda

● Programming language features

– Dynamic typed language

– Static typed language

– Strong typing

– Weak typing● Design Database System

– Complexity

- Database model

– Volume

- Sharding

– Traffic read/write

- Replication

Page 3: Best Practice In Software Development

Dynamic Typing

● conceptually simpler and easier to understand than static typing.

● more flexible.

● results in more compact programs.

● faster development

/# python num=5num=”hello” #change type automatic

def predict(input): ret=0 # do something return ret

def bigfunction(predict, input): out=predict(input) return out

Page 4: Best Practice In Software Development

Static Typing

● Explicit declaration (or initialization) of variables before using

● Type checking is performed during compile-time as opposed to run-time

● One can refactor with greater confidence

● Types serve as documentation

● Run time efficiency

// scala var id:Int=1var number=2var alamat=”jakarta”

def predict(input:Int):Double={ var ret=0.0 // do something return ret}

def bigfunc(predict:(Int)=>Double, input:Int)={ var out=predict(input) return out}

Page 5: Best Practice In Software Development

Strong Typing

// scala var foo:String=”x”foo=foo+2 // error at compile time

/* Python code */ # error at runtime>>> foo = "x" >>> foo = foo + 2 Traceback (most recent call last): File "<pyshell#3>", line 1, in ? foo = foo + 2 TypeError: cannot concatenate 'str'and 'int' objects >>>

Page 6: Best Practice In Software Development

Weak Typing

// PHP code $str = 5 + "hello"; // equals 5 because "hello" is implicitly casted to 0 // PHP is weakly typed, thus is a very forgiving language.

Page 7: Best Practice In Software Development

Summary

● Strongly typed - many rules

● Weakly typed - few rules

● Dynamically typed - rules applied at run time

● Statically typed - rules applied at compile time

Page 8: Best Practice In Software Development

Programming Language Features

Page 9: Best Practice In Software Development

Design Database System

● Complexity

- Database model

● Volume

- Sharding

● Traffic read/write

- Replication

Page 10: Best Practice In Software Development

Database Model

● Key-values Stores

● Document Databases

● Relational Databases

● Graph Databases

Page 11: Best Practice In Software Development

Key-Value Example

Page 12: Best Practice In Software Development

Key-Values: Cons

● No complex query filters

● All joins must be done in code

● No foreign key constraints

● Poor for interconnected data

Page 13: Best Practice In Software Development

Document Databases

● Documents are the main concept

● Documents are:

-self-describing

-Hierarchical tree data structures(map. List, scalar-values)

{ name:ade, usia:20, alamat:depok}

{ name:wahyu, usia:30, pekerjaan:dosen}

Page 14: Best Practice In Software Development

Document Databases

Page 15: Best Practice In Software Development

Document Databases:Pros and Cons

● Pros:

- Simple model

- Built in Map-reduce ?

- Scalable

● Cons:

- Poor for interconnected data

Page 16: Best Practice In Software Development

Relational Model

Page 17: Best Practice In Software Development

Relational Database Pros/Cons

● Pros

- simple, well-establish, standard approach

- maps well to data with consistent structure

- has extensive join capabilities

● Cons

- hard to scale

- does not map well to semi-structured data

- knowledge of the database structure is required to create queries

Page 18: Best Practice In Software Development

Graph Database

Page 19: Best Practice In Software Development

Graph Model

Page 20: Best Practice In Software Development

Key Value to Graph

Page 21: Best Practice In Software Development

Document to Graph

Page 22: Best Practice In Software Development

Relational to Graph

Page 23: Best Practice In Software Development

Graph Database Pros/Cons

● Pros

- powerful data model

- easy to query(relation as pointer to object)

- map well to semi-structured data

- can easily evolve schema

● Cons

- hard to scale

- lacks of tool and framework support

- requires new art of problem solving

Page 24: Best Practice In Software Development

Sharding

Database Shard ShardShard

Aggregation

● Sharding is Splitting data across databases

● Splitted Data share nothing

● Important issues sharding key

Page 25: Best Practice In Software Development

Replication● Creating and maintaining multiple copies of the same

databases

Page 26: Best Practice In Software Development

Scalability, Complexity and Database Model

Scalability

Complexity

Key-Values Stores

Document Database

Relational Database

Graph Database

Page 27: Best Practice In Software Development

Questions?