Database Microservices - dataops.barcelona · • horizontally scale by splitting database per...

23
Database Microservices

Transcript of Database Microservices - dataops.barcelona · • horizontally scale by splitting database per...

Page 1: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Database Microservices

Page 2: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

andres suarez

Software engineer ex londoner Senior DBA Working in letgo for over a year

[email protected] https://we.letgo.com/careers

Page 3: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Our Mission:

Disrupt the second hand market.

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

who are we Company

Page 4: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

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

Page 5: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

• 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

Page 6: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Database Infra

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

•Open Source: Mariadb.

•DaaS DynamoDB, Aurora.

•NoSql ElasticSearch, Solr.

Page 7: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

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.

Page 8: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Databasemonolithic

trying to put all the eggs in the same bucket

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

Page 9: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

• 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

Page 10: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Databasemicroservice

Split problems in smaller problems

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

Page 11: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

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

Page 12: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

• 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

Page 13: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Uglythe

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

• database changes. DML.

• data incidents.

Page 14: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Badthe

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

• clean data, in-consistent.

• cost increase.

• Manageability

Page 15: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Schoolold

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

Page 16: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Moveto do the

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

• Use events.

• Use queues, subscribers.

• Training.

Page 17: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

using Projections

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

Page 18: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Movedoing the

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

Page 19: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Microhow it works

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

Page 20: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

dead-letterusing

Page 21: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

yes it is eventually in-consistent

Page 22: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Thanks!

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers

Page 23: Database Microservices - dataops.barcelona · • horizontally scale by splitting database per service. • different databases engines. • different configurations like, Indexes

Questions

[email protected] https://we.letgo.com/[email protected] https://we.letgo.com/careers