Share
Embed
RBDMS - Relational Database Management Systems
Sebastian Alejandro Velasco Dimate
December 21, 2021
Transcript
52 slides
-
Lecturer Mercado Libre First Party 2021 Technical Leader - CPRF
Replenishment Mercado Libre Ms.c Computer Science Bs.c Software and Computing Engineering Universidad Nacional de Colombia Passionate on building software applications, researching and playing video games. Sebastian Alejandro Velasco -
Contents Mercado Libre First Party 2021 #2d2d2dff #ffcd00ff 1. RDBMS
2. JPA 3. Fury Database Service 4. Data Source Specs 5. Connection Pool 6. Integration Testing 7. Database Change Control 8. Fury Migration Service -
Relational Database Management System Mercado Libre First Party 2021 #2d2d2dff
#ffcd00ff Relationships between data items are expressed by means of tables (values) Relational SQL Natural Normally includes a Structured Query Language API. Provides a natural and straightforward way to represent data in tables. Commitment and Atomicity Handle business rules and policies at a very granular way. Relational model is the best for maintaining data consistency across applications. Data Consistency -
ACID Mercado Libre First Party 2021 Four crucial properties define
relational database transactions: atomicity, consistency, isolation, and durability—typically referred to as ACID. • Atomicity defines all the elements that make up a complete database transaction. • Consistency defines the rules for maintaining data points in a correct state after a transaction. • Isolation keeps the effect of a transaction invisible to others until it is committed, to avoid confusion. • Durability ensures that data changes become permanent once the transaction is committed. -
CAP Theorem Mercado Libre First Party 2021 “Distributed computing systems
can only satisfy two of the following three attributes: (Consistency), (Avalibility) and (Partition Tolerance)” -
What to look for when selecting a relational database Mercado
Libre First Party 2021 #2d2d2dff #ffcd00ff • What are our data accuracy requirements? Will data storage and accuracy rely on business logic? Does our data have stringent requirements for accuracy (for example, financial data and government reports)? • Do we need scalability? What is the scale of the data to be managed, and what is its anticipated growth? Will the database model need to support mirrored database copies (as separate instances) for scalability? If so, can it maintain data consistency across those instances? • How important is concurrency? Will multiple users and applications need simultaneous data access? Does the database software support concurrency while protecting the data? • What are our performance and reliability needs? Do we need a high-performance, high-reliability product? What are the requirements for query-response performance? What are the vendor’s commitments for service level agreements (SLAs) or unplanned downtime? -
JPA - Java Persistence API Mercado Libre First Party 2021
#2d2d2dff #ffcd00ff Store and retrieve Data in a relational database. The API itself, defined in javax.persistence The Jakarta Persistence Query Language (JPQL) Object/relational mapping Purpose https://github.com/spring-guides/gs-accessing-data-jpa -
ORM - ManyToOne (Bidirectional) Mercado Libre First Party 2021 https://docs.oracle.com/javaee/7/api/j
avax/persistence/ManyToOne.html -
Repositories Mercado Libre First Party 2021 by implementing one of
the Repository interfaces, the Entity will already have some basic CRUD methods (and queries) defined and implemented. -
Lombok Mercado Libre First Party 2021 Lazy loading? DO NOT
use @Data, @EqualsAndHashCode o @ToString. https://plugins.jetbrains.com/plugin/15075-jpa-buddy -
Connection Pool Mercado Libre First Party 2021 Connection pooling is
a well-known data access pattern, whose main purpose is to reduce the overhead involved in performing database connections and read/write database operations. In a nutshell, a connection pool is, at the most basic level, a database connection cache implementation, which can be configured to suit specific requirements. • Opening a connection to the database using the database driver • Opening a TCP socket for reading/writing data • Reading / writing data over the socket • Closing the connection • Closing the socket Database connection lifecycle database connections are fairly expensive operations -
HIKARI Mercado Libre First Party 2021 This is a very
lightweight (at roughly 130Kb) and lightning-fast JDBC connection pooling framework developed by Brett Wooldridge around 2012. https://github.com/brettwool dridge/HikariCP-benchmark -
HIKARI Implementation Mercado Libre First Party 2021 Spring boot <
2.x. Its necessary to explicitly define the bean -
HIKARI - properties Mercado Libre First Party 2021 Spring boot
> 2.x. It’s NOT necessary to explicitly define the bean -
Liquibase - XML change Control Mercado Libre First Party 2021
In-app integration (Only for local environments)