Page MenuHomeDevCentral

Design DB schema
Open, NormalPublic

Related Objects

Event Timeline

inidal triaged this task as Normal priority.May 1 2023, 21:29
inidal created this task.
dereckson moved this task from Backlog to Design on the DBA board.

@dereckson hey, we forgot about id addresses, so do you think it would be wise to simply add a new column in the service table?

Can you give an example of what you wish to store as information and how you wish to use it?

Can you give an example of what you wish to store as information and how you wish to use it?

They have a cool datatype for IPs:

sql
Table service {
  id int [pk]
  name varchar
  address inet
  group int [ref: > service_group.id]
  description varchar
  status varchar
}

Here's how it should be to insert data:

sql
INSERT INTO service (id, name, address, "group", description, status)
VALUES (1, 'Service A', '192.168.1.1', 1, 'Description A', 'Active'),
       (2, 'Service B', '192.168.2.2', 2, 'Description B', 'Inactive'),
       (3, 'Service C', '192.168.3.3', 1, 'Description C', 'Active')
RETURNING *;

And by the way, I think we should auto increment the primary keys. as I am planning to use it only as a mean of communication in the backend. If it sounds good, I think I just need to add "SERIAL" on each pk.

Not sure each service has an IP, or only an IP. For those we do, what we do with the IP?

For example:

  • Wikimedia publishes two really simplified services "Read" and "Write" -> no obvious IP or dozens of them
  • We can have for us a service "Private network" to signal our private networks works and link all the servers together -> same + it's the links between (GRE tunnels for example) that will matter more
  • I was discussing the project and during the discussion was components like "Discord" "IRC" "RockyChat" "Matrix bridge" -> not their IPs

So I'm not sure the idea of "one service = one IP" is worthwhile.
And I'm not sure we can do anything with an IP.

If you would like to use IPs for monitoring:

  • imagine we want to automate ping to an IP, the IP doesn't ping because IMCP is disabled (coucou AWS), but then the service still works correctly.
  • What Atlassian StatusPage does is to collect metrics: they've an endpoint, with an HTTP API, you actively send metrics to that endpoint, it graphes them. You don't send anything, it zeroes that part of the schema.
  • At OVH, IPv6 routes can take 5 to 10 seconds to work
  • Finally, it makes sense to host ServPulse outside our network so we can have it running when everything is down at our side. In such case, it can't ping our private network IPs, but we'll have components like "Docker PaaS" or "databases servers".

What if we plan a brainstorming session where we put cards on a wall, one card per feature we'd like to see on the app?

And from there we discuss what we can do for monitoring/IP based on the cards?