1/22/2024 0 Comments Postgresql alter table schema![]() ![]() Things like locks are handled very differently from database to database. If the ALTER TABLE statement runs for minutes, that will cause some serious issues upstream. We also have to consider things like an ALTER TABLE will most likely cause an exclusive lock on the whole table, blocking even simple SELECT statements. During a rolling update, multiple versions of the app will be running and serving requests for a short time window This will prove to be quite a headache later for DB updates. This also means that there will be a period - usually, a few minutes, depending on the system - when both the old and new versions of the application are running and serving requests simultaneously. This way we keep the number of running instances at the desired amount at all times. In setups like this, new application version releases are usually executed using rolling update, meaning new instances are started with the new version, and once a new one is running an old one is getting stopped. These instances are consenting to the same database to serve the requests. All nodes are usually stateless and are exactly the same. Distributed environment, multiple instances runningĪ load balancer in front of our app instances will forward the incoming requests to our running nodes. Often implemented with Dockerized services running in Kubernetes. This horizontally scalable, redundant setup is very common. In the scenario I will talk about we will have more than one instance of our application running at all times (the title said production after all). In a large-scale production system, there are a few things we don't want. If you have a single application instance accessing the database, most of these issues won't affect you. The system we work onįirst I have to establish the system we are working with. In this post, I will investigate a few scenarios and explain the hidden traps and points that must be handled with extreme care. Adding entirely new tables doesn't pose serious challenges, however, deleting a no longer needed column can be tricky. ![]() There can be many cases when you have to alter tables in an RDBMS while running in a production environment. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |