Database Microservices - dataops.barcelona · • horizontally scale by splitting database per...
Transcript of Database Microservices - dataops.barcelona · • horizontally scale by splitting database per...
Database Microservices
andres suarez
Software engineer ex londoner Senior DBA Working in letgo for over a year
[email protected] https://we.letgo.com/careers
Our Mission:
Disrupt the second hand market.
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
who are we Company
80M Total users16M Messages per day600K Products posted every day
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
who are we Numbers
• AWS based platform• 1500 (over) Servers peak hour• 300 (over) Database Servers • VLDB some databases are over 3TB• Tables over 4B rows
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
who are we Sizes
Database Infra
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
•Open Source: Mariadb.
•DaaS DynamoDB, Aurora.
•NoSql ElasticSearch, Solr.
Database topology
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
• master - multiples slaves.
• not multi master cluster due to the hight concurrency.
• not using database constrains.
Databasemonolithic
trying to put all the eggs in the same bucket
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
• difficult to scale.
• difficult to maintain across teams.
• downtime affect entire platform.
• heterogeneous environment. All teams need to consume data in the same engine, and format.
Databasemonolithic
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
Databasemicroservice
Split problems in smaller problems
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
Databasemicroservice
• security - Every micro-service has its own database. • ownership - Service is responsable only for its own data.• projections - For reading shared data among different
services. • spread load - Reduce overhead on a certain system.• event - Used to populate Projections• fail fast - Scrurm
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
• horizontally scale by splitting database per service.
• different databases engines.
• different configurations like, Indexes or table structure, based on the specific requirements.
• fit in the scrum methodology.
• fallback - missed data in projection can be retrieved from the owner database.
Goodthe
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
Uglythe
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
• database changes. DML.
• data incidents.
Badthe
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
• clean data, in-consistent.
• cost increase.
• Manageability
Schoolold
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
Moveto do the
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
• Use events.
• Use queues, subscribers.
• Training.
using Projections
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
Movedoing the
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
Microhow it works
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
dead-letterusing
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
yes it is eventually in-consistent
Thanks!
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers
Questions
[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers