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
No software is guaranteed without bugs.
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
With that kind of log, impossible to know what happened.
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
With this kind of log, we see the error right away.
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
- Continous : forming an unbroken whole; without interruption
- integration : the coodination of processes
- delivery : delivering letters, packages…. babies…
- deployement : bringing resources into effective action
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
- Take a (development) ticket
- Develop using BDD, TDD (and pair programming)
- Push on VCS
- Deploy on a test environment
- Test your software
- Everything is OK, then deploy on production
Eventually calculate metrics like coverage, technical debt…
A software
Delivery process
- Get sources
- Add version
- Build
- Run tests
- Publish components
Environments
DEV, PROD, PRE-PROD, UAT
Create packages
- Get sources
- Add version
- Build
- Run tests
- Create one package for each components
CI/DC Tools
- Shell script!
- Jenkins
- Travis CI
- Bamboo
- Teamcity
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
A service :
- represents a business activity
- is self contained
- is a black box for its consumers
- may consist of other underlying services
Communication
Local : IPC
|File|Shared Memory| |—-|—-| |Local - Bidirectional, one process at time for writing|Local - Bidirectional, one process at time for writing|
Signal | Socket |
---|---|
Local - Unidirectional, not used for data | Local or netowrk - bidirectional, synchrone |
Pipe | Message queue |
---|---|
Local - Unidirectional | Local or network - bidirectional, asynchrone |
Problem..
What if a I send a message and the service is down ? How to send a message which can be handled by multiples service, but only processed by one ? How to handle a client deconnection ? A master ?
Message queueing (aka MQ)
- Like a mailbox
- Increase TCP/IP features:
- Durability - purging : is the message saved ? What is TTL ?
- Delivery policy : should the message be delivered once more ?
- Security : which applications should have the message ?
- Notifications : the publisher can be notified when message is received
Implementations : Apache ActiveMQ, OMQ, RabbitMQ, JMS, …
API
CRUD
REST
- CRUD operations
- Stateless
- On HTTP/S
VERB | Request has body | Response has body | Safe | Indempotent | Cacheable | |
---|---|---|---|---|---|---|
GET | Optional | YES | YES | YES | YES | |
POST | YES | YES | NO | NO | YES | |
PUT | YES | YES | NO | YES | NO | |
DELETE | NO | NO | NO | YES | NO |
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
What did my user? How can I guaranty it? Can I prove it?
So let’s think events!
Events afterall
|Item added| |——| |Item removed| |Payment received| |Order shipped|
- Item added : book
- Item added : DVD
- Item removed : DVD
- Payment received
- 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