Home SOCRA : Cours du 4 juin
Post
Cancel

SOCRA : Cours du 4 juin

Lien de la note Hackmd

IT in company

Software needs

  • Software
  • Apache
  • Monitoring
  • Linux
  • Network

Classic segregation it’s not what you think

| IT-Development | IT-Production | IT-System | |—– | ——- | ——— | | Develop software | Manage software in production | Manage hardware and OS+ | | | Assist users | Handles DPR | | Paid for new features | Paid for uptime | Paid for stability, security |

Assume failures

User error investigation

  • Call support (Niveau 1)
  • Use standard procedures (N1)
  • Check logs (N2)
  • Check configuration (N2)
  • Call development : error in software (N3)

Help them using

  • Error messages
  • Cristal clear logs

Examples : Logs

1
2
Create new wish
Error returned
1
2
3
2020-03-31 09:48:26.1539|INFO|0HLULB1T307F0|WishController|Create : New wish for #433 by #ce4ed122-3cfd-47cd-a8ea-9d0b9d4c55f4 : My Mobility
2020-03-31 09:48:26.1575|WARN|0HLULB1T307F0|WishController|HasOneNotNull - Property not found : LinkedID
2020-03-31 09:48:26.1577|WARN|0HLULB1T307F0|WishController|Error returned form HasOneNotNull : Property not found : LinkedId

Logs

  • Use different levels : Trace, Debug, Info, Warning, Error, Fatal
  • Use and existing framework
  • There is never too much logs

From dev to PROD

CI/CD Quesaco

CI process goal

Validate code at each steps, for each developers Confirm software stability (a minimum) Create a delivery workflow Avoid human interaction

How to go live

A software

Delivery process

  1. Get sources
  2. Add version
  3. Build
  4. Run tests
  5. Publish components

Environments

DEV, PROD, PRE-PROD, UAT

Create packages

  1. Get sources
  2. Add version
  3. Build
  4. Run tests
  5. Create one package for each components

CI/DC Tools

Monolyth

  • AKA Single-tiered
  • Self-contained
  • Independant

Multi-tier

  • Layer separation
  • Flexible

3-tier

| Presentation | |–| | Logic | | Data |

Example

| Console : Get report| |–| | Business Logic : list of all sales and aggregate them | | Data : MySQL : access sales’ store |

SOA : Service Oriented Architecture

Communication

Local : IPC

|File|Shared Memory| |—-|—-| |Local - Bidirectional, one process at time for writing|Local - Bidirectional, one process at time for writing|

SignalSocket
Local - Unidirectional, not used for dataLocal or netowrk - bidirectional, synchrone
PipeMessage queue
Local - UnidirectionalLocal or network - bidirectional, asynchrone

Problem..

Message queueing (aka MQ)

Implementations : Apache ActiveMQ, OMQ, RabbitMQ, JMS, …

API

CRUD

REST

  • CRUD operations
  • Stateless
  • On HTTP/S
VERBRequest has bodyResponse has bodySafeIndempotentCacheable 
 GETOptionalYESYESYESYES
 POSTYESYESNONOYES
 PUTYESYESNOYESNO
 DELETENONONOYESNO
1
/api/users

|GET|POST|PUT|DELETE| |—|—-|—|——| |Retrieve all users|Create a new user|N/A|Delete all users|

1
/api/users/{id}

|GET|POST|PUT|DELETE| |—|—-|—|——| |Retrieve one user|Create a new user|Update|Delete one user|

OpenData - OpenAPI

  • Free to use, reuse and redistribute
  • Lots of companies : GAFAM, RATP, gouvernements…
  • Lots of domains : genetic, chemical, geographic, justice…
  • Swagger oh no it’s 2010 again

An SOA Software

To manage more users :

But there is still a problem..

The current state problem

Events afterall

|Item added| |——| |Item removed| |Payment received| |Order shipped|

  1. Item added : book
  2. Item added : DVD
  3. Item removed : DVD
  4. Payment received
  5. Order shipped

Events sourcing

  • Command : user intention => AddItemToCart
  • Event : happened in the past => ItemAddedToCart
    • Immutable
  • Event store

CQRS

Command and Query Responsibility Segregation

Cloud

How to run ?

  • Software
  • Libraries - dependencies
  • Operating system
  • Hardware

I am a user

I USE SERVICES!!!!

I’m a developer

  • Why should I care about hardware failure ?
    • Infrastructure as a Service
  • Why must I update the operating system ?
    • Platform as a service
  • Is the (right) JVM installed ?
    • Platform as a service
  • I know nothing about SQL Server, I just want a database !
    • Platform as a service / Software as a Service
  • ITO are against me !

IaaS to SaaS

Me or nothing

|Entreprise|Cloud provider| |———-|————–| |On premise|Cloud|

Entreprise & cloud provider : hybrid

Lambda functions

  • One endpoint, one function
  • Focus on objective
  • Access defined resources
  • Call other functions if
This post is licensed under CC BY 4.0 by the author.