id
stringlengths
5
33
instruction
stringlengths
32
49.4k
output
stringlengths
25
48.6k
system
stringclasses
1 value
technology
stringclasses
9 values
quality_score
float64
5
10
source
stringclasses
2 values
meta
dict
so_16387828
Database design to store and evaluate rules expression I have a scenario where I need to assign some Items to a Guest. Every item is sold to guest based on item's availability as well as attributes of guest i.e. Age Group or Height range etc. eg. An item is available every Monday and Tuesday from 2-4 PM and 6-8 PM for...
As APC writes in the comment, deciding on whether to use a business rules engine is not something you should trust to a bunch of strangers on the internet. However...your scenario is relatively straightforward and constrained. It appears to be a single step, rather than a workflow - "if customer meets criteria x, offer...
sql
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 439 }
so_3691441
What is the preferred way of saving dynamic lists in database? In our application user can create different lists (like sharepoint) for example a user can create a list of cars (name, model, brand) and a list of students (name, dob, address, nationality), e.t.c. Our application should be able to query on different col...
Perhaps a potential solution would be the creating of lists can involve `CREATE TABLE` statements for those entities/lists? It sounds like the db structure or schema can change at runtime, or at the user's command, so perhaps something like this might help? User wants to create a new list of an entity never seen before...
sql
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 519 }
so_49798404
Error : Nest cannot export component / module that is not a part of the currently processed module (DatabaseModule) I'm programming a really simple app allowed make CRUD feature on a PostgreSQL DB using express. When I run my program I get this error : Error: Nest cannot export component / module that is not a part of...
I think you need to put the `modules` in `imports` array, not `modules` array. Please double check. And do `CatsModule` and `CatfoodModule` have their corresponding `controllers` in their class (which they should)? You don't have to put every controllers in `ApplicationModule`. ``` import { NestFactory } from '@nestjs...
javascript
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 640 }
so_37473456
the requested linked library openssl has the wrong version installed I recently ran composer update and this is the error I get: namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it ...
The final conclusion was to UNINSTALL MAMP , and then install apache,mysql and php using brew (it took me less than 5 minutes to set up all three). Then installation of 3rd party packages(including openssl) was a breeze. Overall it took me 10 minutes, and I would say its worth it. ``` which openssl ``` ``` /usr/local...
php
5.11
stackoverflow
{ "tier": "short", "total_tokens": 216 }
so_41956757
"ordered" many-to-many relationships in sql (postgres)? I'm modelling articles and their authors, where each article can have multiple authors and each author can have multiple articles. It is important to keep the order of authors for a given article (being the 1st on the list of authors of a given article is very di...
I would strongly advise you to use the first solution, under almost any circumstances. I should say that with Postgres, this decision is harder than with most other databases. Postgres has strong support for arrays, and you can probably do most of what you want with the second solution. That said, the first solution al...
sql
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 577 }
so_20286394
Incorporate additional requirements into a legacy database design I am struggling with a database design, this is what I have so far. Here are the problems. I need to introduce a new user type (conglomeration manager), and they will have visibility of groups of companies (a conglomeration). A conglomeration manager ca...
Well here is another try. I still think you shouldn't worry too much about that receive_emails field, as explained in my other answer. you don't have to split users into user kinds. What you are worried about in 2 is the dependencies. Dependencies are usually not a problem, but you are very strict in your id based data...
sql
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 972 }
so_14094848
Cannot source autojump script with zsh on archlinux autojump on ArchLinux for some reason is not working in `zsh`. Although If I switch to `bash` it works fine. autojump: does not work on `zsh` autojump: works on `bash` My environment: I use autojump on OS X with `zsh`, so it also doesn't look like a zsh specific issu...
There is no `/usr/etc/profile.d/autojump.zsh` pushed when `autojump` is installed via `pacman`. I don't know why this is the case. However, I performed, manual user installation and added autojump plugin in my zsh configuration that takes care of sourcing the file. ``` $ sudo pacman -S autojump ``` ``` $ source /usr/...
shell_scripting
5.11
stackoverflow
{ "tier": "short", "total_tokens": 239 }
so_5373658
Must Read/ Favorite Papers in Database and related fields Please recommend what you consider to be the most important or just favorite papers in Database Management, Information Systems, Data Mining etc. Here are couple that I think are important milestones: What Goes Around Comes Around - Michael Stonebraker, Joseph ...
Since I'm new on stackoverflow, I can't post more than two hyperlinks!! So the version with links is at http://www.reddit.com/r/compsci/comments/ghc0w/please_recommend_must_read_favorite_papers_in/c1no849 The book that zamanbakshi recommends, Transaction Processing: Concepts and Techniques , by Gray and Reuter, is real...
sql
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 889 }
so_58327314
Get type of a variable in Terraform Is there a way to detect the type of a variable in Terraform? Say, I have a module input variable of type `any`, can I do some kind of switch, depending on the type? What I want to archive is, to be able to pass either a string as shorthand or a complex object with additional keys. ...
terraform v1.0+ introduces a new function type() for this purpose. See https://www.terraform.io/language/functions/type ``` variable "details" { type = any } local { name = var.details.type == map ? var.details["name"] : var.details } ``` ``` module "foo" { details = "my-name" } ``` ``` module "foo" { detai...
devops
5.11
stackoverflow
{ "tier": "short", "total_tokens": 246 }
so_40160073
Disable Zsh history completely I would like to disable Zsh history (arrow up) and zle history search (namely esc+p) completely. How can I achieve this? My current `.zshrc`: Currently I have history buffer of one, but I'd like to have history of zero. 21-10-2016 Update: I've added to get rid of history features that I ...
I don't see anything in the zsh man page that completely disables history. Even setting `HISTSIZE=0` seems to reset the value of `HISTSIZE` to 1. You'll probably have better luck changing the key bindings with `bindkey` so that history features never occur. For example, `bindkey -r "^[[A"` for my up-arrow key (note tha...
shell_scripting
5.11
stackoverflow
{ "tier": "short", "total_tokens": 242 }
so_930246
Are Surrogate Primary Keys needed on a Fact table in a Data Warehouse? When I asked our DB designers why our Fact table do not have a PK, I was told that there is no set of columns in the table that would uniquely identify a record, even if all the columns were selected. Whenb I suggested that we an an identity column...
Database table without primary key seems like a poor design choice and making lots of room for different types of anomalies i.e. how would you delete or update single record in such table?
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 283 }
so_5261462
Pros/Cons of and ways to implement globally unique identifier in relational database? Regarding the first part of my question: I was recently asking myself what are the benefits and trade-offs of having a unique identifier for certain tables in a relational database. Just as an example, the Facebook (FB) Graph API all...
Both of your proposed ways of implementing global identifier involve joins of big tables and effective doubling of the number of records in your database (each objects exists on its own but so does his parent/record with it's global ID). I have a feeling it would be better to enforce global IDs in the application/data ...
sql
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 801 }
so_5608759
Database Design: to EAV or not to EAV? Say I have an entity that will have many attributes, some I know about now and others will be user defined. What's the best way to model this? 1) Do I have a main table and relate it to a secondary name-value pair table? All the attributes go in the secondary EAV table. OR - 2) D...
Typically, lots of empty cells are cheap and not worth normalizing away. The only draw back to #2 is if you have a very large number of rows (millions - where performance problems could arise), a very large number of columns (more than about 20 - where it's just annoying to look at the data), or there are a number of u...
sql
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 353 }
so_3644595
How to maintain an ordered table with Core Data (or SQL) with insertions/deletions? This question is in the context of Core Data, but if I am not mistaken, it applies equally well to a more general SQL case. I want to maintain an ordered table using Core Data, with the possibility for the user to: reorder rows insert ...
Since iOS 5 you can (and should) use NSOrderedSet and its mutable subclass. → Core Data Release Notes for OS X v10.7 and iOS 5.0 See the accepted answer at How can I preserve an ordered list in Core Data .
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 422 }
so_76540270
Uvicorn reload : kill all created sub process when auto reloading I currently have a fastapi deployed with uvicorn that starts a thread on initialisation (among other things) using `threading`. This thread is infinite (it's a routine that updates every x seconds). Before I updated to python 3.10, everything was workin...
Fixed by downgrading uvicorn to an older version (0.19.0 works). ``` my print from my thread WARNING: StatReload detected changes in 'app\api.py'. Reloading... INFO: Shutting down INFO: Waiting for application shutdown. INFO: Application shutdown complete. INFO: Finished server process [3736] my print...
python
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 342 }
so_63592984
Can EKS worker nodes be setup in different regions We are currently designing a micro-services based architecture, by dividing monolith app to microservices. Earlier, the monolith was present in 2 different regions viz. US and Asia. US instances would get request from USA and Asia ones will get request from Asian nati...
As far as I know you are not able simply use worker nodes from different regions in EKS clusters. Also there is still unanswered question How can we achieve Multi Region Worker nodes for EKS cluster? on github. What you can is is to use Kubernetes Cluster Federation . You will need `kubefedctl` tool to join the cluster...
devops
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 336 }
so_63942654
Microservice Clients Circular Dependency In a Microservice architecture, using client packages to communicate between services, we ran into an issue where two client packages depend on each other, creating a circular dependency. We are trying to figure out the best solution for this and I'm wondering if anyone would b...
You shouldn't be sharing any code between services since that defeats the whole purpose of them being 100% independent. In a MS architecture a CarDTO would only have properties related to a car. If you want information about insurance that would be a separate call to the insurance service to get an InsuranceDTO that ha...
php
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 502 }
so_64313485
Multiple gateways possible and how to create gateway with frontend only in JHipster? I am developing 3 Microservices: admin facing web app gateway for user management (admin.com) using mysql public facing web app gateway containing only vuejs frontend (public.com) REST API Microservice containing the core application ...
I can easily generate (1) and (3) but how to generate (2) ? Here, I will suggest if possible, segregating UI INFRA completely from the services infra, this make it easy to evolve UI infra and setup independent of backend. Hence, we can create a webpack or deployable out of VueJS app. This deployable can be deployed or ...
system_design
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 1558 }
so_65540273
Transactional outbox pattern vs ChainedKafkaTransactionManager in Microservices Using Spring-Kafkas ChainedKafkaTransactionManager I cannot see any point in implementing the transactional outbox pattern in a Spring Boot microservices context. Putting message producer (i.e. KafkaTemplate's send method) and DB operation...
I think it doesn't give you the same level of safety. What if something fails between Kafka commit and DB commit. https://medium.com/dev-genius/transactional-integration-kafka-with-database-7eb5fc270bdc ``` public ChainedKafkaTransactionManager chainedTransactionManager( JpaTransactionManager t...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 607 }
so_65596824
How to achieve data consistency in a newly added microservice? For example, we have microservices with event sourcing. To achieve data consistency we use the following approach: A microservice generates an event The event is stored in an event store The event is published to the subscribed microservices This approach ...
Pulling all events from the event store can become costly over time, because the number of events can explode. To speed up the initialization of a new microservice, you should create snapshots of your application state, from time to time (and store it in some fast-access memory / cache). All the events that are stored ...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 356 }
so_44988481
Spring Cloud - how to allow access to endpoint for specific microservice only? I have simple microservice architecture: edge service service registry auth service (I am using JWT and OAuth2) user service frontend and some core services When the user tries to log in, the credentials are passing from edge service to aut...
Looks to me that you split your services too thin; this happens, and with time, you start to realize that the services need to be more coarse-grained because of maintenance and performance issues. The cost of another HTTP call from auth to user service, and the overhead of maintaining inter-service auth is not trivial....
system_design
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 837 }
so_44554638
How do I guarantee that the interface between two microservices is not broken? Imagine we have two microservices: client and server. One of the most fundamental features of microservice architecture is an ability to have a separated pipelines for each microservice meaning that we have to be able to deploy them to prod...
The question is how to prevent cases where communication between two microservices is broken due to a broken contract between them? Design of Contract : While you are designing the contract, the server [also called service provider or producer] can not dictate the contract and just say here is the contract for my offer...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 594 }
so_59568148
Enabling binary media types breaks Option POST call (CORS) in AWS Lambda New to AWS.. We have a .NET Core Microservice running on a serverless aws instance as lambda functions. Our Controller looks like this URL's We have enabled 'Binary Media Types' in AWS package settings to / for the getsomedoc to work otherwise it...
Well we ended up resolving this in a strange way. Added two gateways for the lambda - on one of them have binary enabled - Disabled on the other one. For getsomedoc - Using the one where binary media types are enabled postsomedoc - Using the other one Wish there was a better way!! ``` [Route("api/[controller]")] [...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 454 }
so_39763013
many log files on azure service fabric I have a azure service fabric development cluster running locally with two applications. After a two week holiday I come back and see that my hard drive is completely full, consequently nothing really works anymore. the sfdevcluster\log\traces folder has many *.etl files all larg...
This turned out to be a bug in Service Fabric, upgrade your local cluster to the latest version `6.1.472.9494` which will fix the issue. more details here
system_design
5.11
stackoverflow
{ "tier": "short", "total_tokens": 164 }
so_41762928
How to do client side load balancing for discovered microservices in nodejs We are trying to build a microservice with nodejs in an environment with other microservices written in java/spring boot. The other microservices are using consul.io for service discovery and ribbon for client side load balancing. (that would ...
I think I should just close this for now, it's been a while. Like I said in the comment above, I have built and used logical counterpart for Feign, Ribbon, with extensible support for service discovery frameworks (currently plugin available for consul.in), with different strategies for load balancing, and declarative A...
javascript
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 303 }
so_20727730
Dynamic window title in Urxvt with Zsh? How can I set the window title of Urxvt to the currently running (interactive) command in Zsh shell? For instance, if I am running `journalctl`, I want `journalctl` to be displayed as the window title. Currently the window title is just showing `urxvt`, which is fine if I am run...
Might be an overkilled solution but installing oh-my-zsh and using its default configuration gives me a dynamic window title. See the following screenshot as an example:
shell_scripting
5.11
stackoverflow
{ "tier": "short", "total_tokens": 126 }
so_27891019
How to build a streamlined development environment for micro-services I was thinking about the micro services architecture and wondering if folks have a good best practice for development environments. My working assumption is that each micro service will live in it's own git repository for isolation and ease of deplo...
I decided to go with fig. If a microservice depends on another microservice fig will reference this service using ../ This assumes that all services are checked out as siblings. This can also easily be accomplished using git sub trees. My dev_ops repro contains my Vagrant file for boot2docker, etc.
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 491 }
so_55501971
Multiple microservices in a single dotnet core solution + git repo? I'm looking into options for a new architecture solution for an API layer. We have decided to use dotnet core, and we'd like to have each part of our app's functionality broken into microservices. We use azure devops to handle the build/test/release C...
We are in roughly similar situation, and decided to host our microservices (with shared DB, unfortunately) in single git repo, but each one having it's own solution. Each API has it's own build definition and each build definition has it's own trigger with path filter. I would imagine that this approach works even if t...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 620 }
so_52349494
Kubernetes, spring boot and microservices I'm developing a microservices application with Spring Boot and Postgres. Using Docker, the REST API in one container and Postgres in another container, everything works fine. But when I try to run this with Kubernetes , it always gives an API error. The `Dockerfile` where my ...
I don't know how docker compose sets up its internal network, but I can see you are pointing to the same network for both postgres and your service within your docker-compose definition. As for k8s, you need a way to locate your services as they can be deployed on any node. Either through an internal k8s DNS applicatio...
devops
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 5261 }
so_28614571
Why do I need to rollback a SELECT in mysql (InnoDB)? I ran an ill-advised `SELECT *` on a large InnoDB table in a mysql database. So after 10 minutes or so I realised the error, found the `connectionid` with show processlist, and attempted to kill both the connection and the query with the kill command. Then I ran an...
You are not waiting for a transaction rollback, as others have said. I also have encountered this problem: call it a bug because it is one really though MySQL do not agree. Now I can not give you anything but an educated guess for the reason you get this 'deadlock', but I can give you a solution: UNLOCK TABLES http://d...
sql
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 317 }
so_13058861
What will happen if I kill a huge MySQL InnoDb DELETE Query? I'm currently running a `DELETE` query that is taking a lot longer than expected (already 10hrs!). I would like to kill it through phpmyadmin processes, however am concerned about what might happen. Will the roll-back he automatically does take a lot of time...
It depends on the stage your query is in right now. But generally rollback takes about equal time, sometimes even more than the original operation. As per point 2 of this document , it's not really advisable. Also, be sure to verify your MySQL version as it has a VERY nasty bug with delete/update queries rollback in so...
sql
5.11
stackoverflow
{ "tier": "short", "total_tokens": 200 }
so_9123846
How can I get FFmpeg to locate installed libraries when --sysroot is pointing to another directory? I've been going at this, literally for days. I'm trying to build FFmpeg with libmp3lame for use in an Android application. The build script sets a `--sysroot` flag that points to the Android NDK directory necessary to b...
Instead of changing the include paths, why don't you try copying all the libmp3lame files that were created by 'make install' to the relevant directory where the script will look for them. Insert ECHO statements to find out what exactly the PATH/CFLAGS/LDFLAGS are at the point where you get the error, and copy the file...
shell_scripting
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 983 }
so_262527
How programmatically enable READ COMMITTED SNAPSHOT in SQL Server? I need to programmatically enable READ COMMITTED SNAPSHOT in SQL Server. How can I do that?
``` ALTER DATABASE [dbname] SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK AFTER 20 SECONDS ```
sql
5.11
stackoverflow
{ "tier": "short", "total_tokens": 63 }
so_34954373
Disable Format for some messages I am working with pythons logging library developing a data analysis pipeline. I am logging both custom messages about what steps are being run and also the raw output of invoked programs. I am using `sh.py` to simplify the calling of shell commands. It lets me define a callback functi...
You could look into logging.config https://docs.python.org/2/library/logging.config.html Basically, you would define a dedicated logger that writes to the same file as your root logger but uses a stripped down formatter, like `format=%(message)s`. In call_back you would then fetch that logger explicitly: `logging.getlo...
python
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 357 }
so_3531962
Moving an Asp.net application to a load-balanced environment I have an application which works well on a single server. My customer now wants to move it to a load-balanced environment. Which things are likely to bite me when doing this? Currently I know of Session state, and Machine key. Both of these are described he...
One thing that you might experience is an increased load on your database server . If you implement any serverside caching of data, you will be used to your site hitting the database once for a given dataset, caching the data and then not going to the database again until the cache times out. This is a good strategy fo...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 553 }
so_25648417
Does SignalR (v2+) work with Sticky Sessions without a Backplane? Is using Sticky Sessions a supported scale out scenario? Has anyone deployed SignalR with Sticky Sessions and were there any unexpected issues? We're investigating SignalR for a load-balanced, broadcast based project (similar to a stock ticker) where me...
If you use SignalR without a backplane, any client method invocation will only be able to reach clients connected directly to the server making the invocation. This might be fine if you are only using `Clients.Caller` since the caller should always come back to the same server given sticky sessions. This could become a...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 348 }
so_35247740
Elastic Load balancer listener not working for one port I have an Elastic Beanstalk Docker container running a Sinatra app. Using ebextensions, I have an haproxy instance running on the EC2 box - that forwards traffic from port `9090` to the `docker_ip:application_port`. The setup works fine, since I am able to curl t...
Enable ELB Access Logs and send a request to the AWS generated DNS name of the ELB. Check the logfile that the ELB created in the S3 bucket.
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 344 }
so_475076
Load balancing error with WCF service - NLB UPDATE 3: I created a Visual Studio 2008 test project and tried to create a service reference to shared site WCF service reference and received the following error: There was an error downloading ' http://apps.mydomain/MyService.svc '. The request failed with HTTP status 400...
After some experimenting with different configurations for my WCF service and consuming application. I created a service reference to one of the working service references ( http://apps1.mydomain or http://apps2.mydomain ) in the consuming application. Then I changed the endpoint reference in the client configuration t...
system_design
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 985 }
so_45737730
TYPO3 lists all tables in DB compare because of COLLATE I'm using TYPO3 8.7.4 with PHP 7.0.22 and MariaDB 10.2.7. The DB Compare inside the InstallTool shows me that TYPO3 wants to alter all tables because the current value differs from the expected by the collation of the table:
MariaDB implemented a change to the Information Schema COLUMNS table which is not backwards compatible with the output expected from the 'original' MySQL: https://jira.mariadb.org/browse/MDEV-13132 ``` ALTER TABLE `be_groups` CHANGE `title` `title` VARCHAR(50) DEFAULT '' NOT NULL Current value: title VARCHAR(50) DEFA...
sql
5.11
stackoverflow
{ "tier": "short", "total_tokens": 161 }
so_9749641
ASP.NET cache solution for load-balancing system We are developing an ASP.NET web application on load-balancing system. Now we are facing several problems with current cache system: It is not synchronized between web servers. There are some solutions such as SQL Cache Dependency or implementing a separated Cache Servi...
We use memcached and have had no problems with it. Very reliable and pretty simple to implement. What do you mean you'll have a bottle-neck problem with a third party caching solution? We've been running it for about a year or so now and have had great experience with it. Edit: Our environment is load balanced across 3...
sql
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 300 }
so_21449862
PHP request balancing in LAMP server There are 2000 requests are received at a time in AWS 1.7GB server. The application is trying to handle this but ended with memory exhausted errors. I optimized the PHP script and MySQL database upto whatever I knows and gathered. So here what I decide is I would like to process 20...
First of all, I advise against using system calls, especially when you have that many requests. Running external processes can cause big performance problems and since in your case the no. of processes / memory usage changes rapidly (you were saying 2000 requests at a time), you cannot use a cronjob to cache those valu...
php
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 707 }
so_1343645
How do I delete a stored procedure in Postgresql? How do I delete a stored procedure in Postgresql?
``` DROP FUNCTION name(arguments); ```
sql
5.11
stackoverflow
{ "tier": "short", "total_tokens": 34 }
so_11112940
LEFT OUTER JOIN vs SUBSELECT in MySQL I have a table say `table1` which has 3 columns `column1, column2 and column3`. The `column1` and `column2` are a `FOREIGN KEY` with 2 other tables. However the data in `column3` is from n number of tables. For e.g. Let us consider Facebook. To display the activities it might main...
The second would be faster and the reason is the first one contains what is called correlated subqueries. The subqueries have a correlation with records from the master query. So the subqueries need to be run once for every matching record in the master query. In your case it can't run the subquery until it determines ...
sql
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 540 }
so_6176055
Does Node.js scalability suffer because of garbage collection when under high load? Though Node.js is pretty hot topic, I happens to find that it is reported Node.js might not be appropriate for real-time application due to its Garbage Collection model (http://amix.dk/blog/post/19577). And, some benchmark shows that N...
The cost of garbage collection depends on the number of objects in the heap, particularly the number of long-lived objects. The more you have, the more time will be spent in GC. Yes, V8 currently can take some sizable GC pauses sometimes if the heap is large. It sounds like the V8 team is working on minimizing the cost...
javascript
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 362 }
so_12688429
Large file parse and import PHP MySQL I have a large csv file (around 700MB) that I am trying to parse and insert into a MySQL database. I read the csv (around 4x10^6 rows) line by line and parse the records to insert. I then insert the records into the database in batches of about 10k records per batch. There are a f...
Using `LOAD DATA INFILE` would speed things up considerably. Just load the duration value in a `CHAR` field and let MySQL process it later. That way, you leave the data processing to the database, which will be significantly faster than PHP. Further, 40 minutes sounds not too bad for 700MB and 4 million records. Of cou...
php
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 419 }
so_3819552
Patterns for caching related data I'm currently developing the foundation of a an application, and looking for ways to optimize performance. My setup is based on the CakePHP framework , but I believe my question is relevant to any technology stack, as it relates to data caching. Let's take a typical post-author relati...
It is rather simple, cache entries can be added destroyed You should take care of destroying cache entries when related data change (so in application layer in addition to updating the data you should destroy certain types of cached entries when you update certain tables; you keep track of dependencies by hard-coding i...
php
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 882 }
so_42003404
Multi-host deployment of ASP.NET Core applications I am quite confused as I haven't seen any blogs or instructions on how to host ASP.NET Core/.NET Core applications with HA and multi-host deployments. All examples are either: And both components on same host. In real-life production environments, you have LB maybe se...
I have a setup with one VM using (IIS as LB) + several VMs with (IIS + Kestrel). It's working fine for my usage, but I'm curious to see if other people have different suggestions. Then it depends on what you are doing, if you use encryption, machine key needs to be shared between VMs, you might also needs to share sess...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 412 }
so_6931200
Garbage Collection Modes: If 2 apps exist on a server, does "Server Mode" rob Peter to pay Paul? A 2-parter (if necessary I can seperate questions to award seperate right answers): We're in a situation where running in server mode is likely appropriate: We have 2 enterprise level apps running on the same farm. If I pu...
From MSDN (emphasis added) Workstation is the default GC mode and the only one available on single-processor computers. Workstation GC is hosted in console and Windows Forms applications. It performs full (generation 2) collections concurrently with the running program, thereby minimizing latency. This mode is useful f...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 534 }
so_4959723
Searching Natural Language Sentence Structure What's the best way to store and search a database of natural language sentence structure trees? Using OpenNLP's English Treebank Parser, I can get fairly reliable sentence structure parsings for arbitrary sentences. What I'd like to do is create a tool that can extract al...
Relational databases cannot store knowledge in a natural way, what you actually need is a knowledge base or ontology (though it may be constructed on top of relational database). It holds data in triplets ` `, so your phrase will be stored as ` `. There's a lot of tools and methods to search inside such KBs (for exampl...
sql
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 633 }
so_166349
Experiences using software load balancing vs. a hardware load balancer? The ASP.NET application that I am currently responsible for at my day job has hit its limit in terms of its ability to scale inside a single server. Obviously we are working toward moving session out of process and the test and hopefully deploy da...
I have some experience with load balanced solutions, however it really depends how your network and software are designed as to which is the best solution for you to go for. In terms of solutions I've encountered: Built in load balancing in windows works well for most cases, although you need to ensure your application...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 421 }
so_3568912
Most efficient way of getting the next unused id (related to Finding the lowest unused unique id in a list and Getting unused unique values on a SQL table ) Suppose I have a table containing on id column and some others (they don't make any difference here): The id has numerical increasing value. My goal is to get the...
Like Dennis Haarbrink said; a trigger on delete and another on insert : The trigger on delete would take the deleted id and insert it in a id pool table (only one column `id`) The trigger on before insert would check if an id value is provided, otherwise it just query the id pool table (ex: SELECT MIN(id) FROM id_pool_...
sql
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 581 }
so_33485149
PHP MySQL Query of view returns 0 results when there should be a result I have a site that is running PHP 5.6. The database for the site was recently upgraded from MySQL 5.1 to MariaDB 10.0 (MySQL 5.5 Compatible) and now a query on my site won't work (and it was working without error when connecting to the MySQL 5.1 d...
Looks like after all, there was no issue on my end with the actual coding of the site. The hosting company gave me the following explanation: It appears that the issue with prepared statements working incorrectly with views was related to the table_definition_cache size on the new maria database servers. This is a glob...
php
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 726 }
so_5364307
How is scalability defined for parallel code? I'm interested in finding out whether there is a formal definition as to whether a parallel code is scalable , or whether it is just a trendy word? If I measure the serial wall time as t_S and the parallel wall time as t(P), then I can define the efficiency as E(P) = t_S /...
see Amdahl's law and Gustafson's law for some formal definitions of some scalability metrics.
system_design
5.11
stackoverflow
{ "tier": "short", "total_tokens": 137 }
so_28131205
PostgreSQL - Slow query joining on a VIEW I'm trying to do a simple join between a table (players) and view (player_main_colors): This query is taking ~40 ms. Here I'm using a nested SELECT on the VIEW instead of the JOIN: This query is also taking ~40 ms. When I split the query into its 2 pieces, it becomes fast as I...
So, the reason for this behavior is that the query planner has limitations. In the specific bind param case, the query planner is able to make specific plans based on the query it can see and analyze. However, when things happen via joins and subselects, there's much less visibility into what will happen. It makes the ...
sql
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 1535 }
so_57777245
PDO connection to remote DB using SSL; FastCGI errors when verifying server cert I have a remote server with a MariaDB DB that only accepts SSL connections for a certain user, and have generated some self-signed SSL certificates using the following (taken from https://dev.mysql.com/doc/refman/5.6/en/creating-ssl-files...
is it safe to leave PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT set to false? For the most part, if access to your server is secure it is safe, although not recommended, to do this. The reasons this is failing is that a TLS(SSL) Certificate is granted to a host access address, where the host access address is the IP Address...
php
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 866 }
so_1040545
how to dispatch network requests to the (geographically) closest server I'm a Java coder and not very familiar with how networks work (other than basic UDP/TCP connections) Say I have servers running on machines in the US, Asia, Latin America and Europe. When a user requests a service, I want their request to go to th...
One simple approach would be to look at the first byte (Class A) of the IP address coming into the UDP DNS request and then based off that you could deliver the right geo-located IP.
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 288 }
so_5441985
DB design and optimization considerations for a social application The usual case. I have a simple app that will allow people to upload photos and follow other people. As a result, every user will have something like a "wall" or an "activity feed" where he or she sees the latest photos uploaded from his/her friends (p...
I would probably start with using a normalized schema so that you can write quickly and compactly. Then use non transactional (no locking) reads to pull the information back out making sure to use a cursor so that you can process the results as they're coming back as opposed to waiting for the entire result set. Since ...
sql
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 692 }
so_7332452
It is possible to manage users/identities in a data store that exhibits eventual consistency? Is it possible to create/store user accounts in a data store that exhibits eventual consistency? It seems impossible to manage account creation without a heap of architectural complexity to avoid situations where two account ...
It is possible to do use management in an eventually consistent data store. We do it. It works under the following assumptions: Conflicts shouldn't happen and when they do there's a clear path to conflict resolution. If the account ID is a person's email address, then if two separate people try to register under the sa...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 567 }
so_561188
Scalability and high availability of a Java standalone application We are currently running a Java integration application on a Linux box. First an overview of the application. The Java application is a standalone application (not deployed on any Java EE application server like OracleAS,WebLogic,JBOSS etc). By Stand A...
Does "standalone" == "desktop"? How do users interact with the controller that owns the message-driven beans? My opinions on your questions: You can scale by adding more message listeners to the listener pool, since each one runs in its own thread. You should match the size of the database connection pool to message li...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 632 }
so_12669290
Marker interface or boolean method to identify object capabilities? I am developing a largish hierarchy of Java classes, some of which have a particular property that I am interested in querying at runtime (the property definitely only applies to classes, not specific instances). I could create an abstract boolean met...
Marker interfaces are inherited in class hierarchy, so they have limited capabilities (you cannot "remove" this marker interface for some particular subclass) and I cannot recommend them (Cloneable is a bad example of this). The question is - is your property really bound to object's class, not to instance? If so, anno...
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 426 }
so_6398790
Re-define wait method in a Java interface I would like to use `wait(int)` as the signature of a method in a fluent API (used for http://www.jooq.org ). The goal is to be able to construct SQL queries like this example: The full `FOR UPDATE` clause syntax specification (at least for Oracle) can be seen here: http://dow...
What this requires is a way to disable an `Object` method. And main reason seems to be because it has a nice name that would fit the purposes of a proprietary API. At first, this contradicts the entire idea of inheritance -- once you inherit from a class, all subclasses must expose the same non-private fields & method....
sql
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 1010 }
so_3299558
API design: is "fault tolerance" a good thing? I've consolidated many of the useful answers and came up with my own answer below For example, I am writing a an API `Foo` which needs explicit initialization and termination. (Should be language agnostic but I'm using C++ here) Apparently, our library doesn't care about ...
I would suggest that you should flag an exception if your routine cannot achieve the expected post-condition. If someone calls your init routine twice, and the system state after calling it the second time will be the same would be the same as if it had just been called once, then it is probably not necessary to throw ...
system_design
5.11
stackoverflow
{ "tier": "deep_reasoning", "total_tokens": 803 }
so_14315729
REST API Design regarding DELETE method I'm building a REST API. actually I understand the the common guide and rule. But i have issue with DELETE method, because I need to send the data over the body in the request, which DELETE method will ignore the body. If you asking what data that makes me send it over body in D...
I know it is part of you business logic, but i would recommend you to rethink it or maybe try to use another solution instead of REST. By doing stuff like the ones you mentioned, u will be breaking all the REST concepts and still not doing something good enough on your application. I think the best solution in your cas...
php
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 584 }
so_7076284
Design a Plugin based java application I'm trying to make a plugin-based application which means, besides the basic framework, other functionalities should be added with a plugin style. The majar problem of such system, i think, is how to load new plugins at the runtime. I don't want to recomplie the whole project whe...
You may first look at OSGI and his implementation (Equinox for Eclipse and Apache Felix) but it would be easier if you give us more information of what you are trying to do.
system_design
5.11
stackoverflow
{ "tier": "medium", "total_tokens": 333 }
gh_angular_angular_65657
docs(router): `router.navigate()` method does not explain some usages ### Describe the problem that you experienced The docs on the `commands` array for a `router.nagvigate()` might need some extra info. Usage of `..` Usage of a `/` and `relativeTo` ### Enter the URL of the topic with the problem https://angular....
I’d like to help clarify this in the docs. The confusion around how the command array is interpreted during relative navigation is very understandable, especially for developers expecting multiple segments to be processed independently. I can propose a small documentation addition with an example showing the incorrec...
typescript
5.11
github
{ "tier": "deep_reasoning", "total_tokens": 944 }
gh_facebook_react_35657
Bug: React logComponentRender breaks existing functionalities that utilise proxy (trpc client) ``` client[procedureType] is not a function ``` <img width="1037" height="469" alt="Image" src="https://github.com/user-attachments/assets/28d92c84-2873-46c8-a3b7-c397455fe9f4" /> React version: 19.2.3 ## The current behav...
Thanks On Thu, Jan 29, 2026 at 12:34 PM Michal Hernas ***@***.***> wrote: > *bimusiek* created an issue (facebook/react#35657) > <https://github.com/facebook/react/issues/35657> > > client[procedureType] is not a function > > image.png (view on web) > <https://github.com/user-attachments/assets/28d92c84-2873-46c8-a3b...
javascript
5.11
github
{ "tier": "medium", "total_tokens": 400 }
gh_composer_composer_12829
composer very slow on 2.9.6 and 2.9.7; fast on 2.9.5 Hi, My environment is composer on PHP 8.4 on Docker for Mac. Beginning v2.9.6 and continuing on v2.9.7, composer has become extremely slow. It's fast on 2.9.5. It slows down based on the presence of one or more `scripts` in combination with the presence of `autolo...
I might have reproduced this. With 100 files (each with a single PHP class) in the "modules" directory, I was not able to reproduce. When I created 10,000 files, I started to see ~5 second execution times with the supplied `composer.json` file. Please can you tell us how many "a decent number of php files in `modules`...
php
5.11
github
{ "tier": "deep_reasoning", "total_tokens": 10883 }
gh_symfony_symfony_59702
[Mailer] Memory leak with a reproducer ### Symfony version(s) affected 7.2.3 ### Description I have an app sending emails to all users. The emails sent with messenger asynchronously using the doctrine transport. The mailer calls every message listener before sending the message to the messenger transport. https://...
@1ed Thanks for reporting and investigating this issue. To make it easier for symfony developers it woud be great if you could create a PR.
php
5.11
github
{ "tier": "medium", "total_tokens": 277 }
gh_pypa_pip_13325
Make the frozen dataclasses picklable ### What's the problem this feature will solve? it's probably nice to let people pickle the result of a requirements.txt parsing here is a dependent that broke (indirectly pickling ParsedRequirement): https://github.com/achillesrasquinha/pipupgrade/issues/161 ### Describe the ...
@notatallshaw Could you file a smaller scoped issue for that and track the slots change with that? I'm wary about the risks of conflating the change we want to make for our internals with this request for an unsupported-API usage pattern.
python
5.11
github
{ "tier": "short", "total_tokens": 238 }
gh_pandas-dev_pandas_35656
ENH: Uniformised the boolean results in Pandas Hello everybody, I'm not completely sure this issue has not been submitted earlier, please accept my apologies if so. It is also possible that what I saw results from an incorrect use of the Pandas package. It seems that boolean answers are not always rigourosly the sam...
@ExarKun64 Sorry I misread your original post, you were showing us that this case _does_ work as expected
python
5.11
github
{ "tier": "medium", "total_tokens": 345 }
gh_python_cpython_149254
Update OpenSSL (April 2026) # Feature or enhancement ### Proposal: OpenSSL has updates for 3.6.2, 3.5.6, 3.4.5, 3.3.7, 3.0.20: https://openssl-library.org/post/2026-04-07-release-announcement/ We should update the CI, release artifacts, and so on See [#144551](https://github.com/python/cpython/issues/144551) for ...
It does, using the Azure workflow Steve set up. I can get the source into place and trigger the build, but I'll need someone else to approve its run.
python
5.11
github
{ "tier": "short", "total_tokens": 232 }
so_29754370
Specify different times for Monday-Saturday and Sunday in single CRON statement I need to run a job at this `cron` schedule, but it seems like I can't express this in one statement. Is there a way to get this in one `cron` statement? 8am Mon-Sat 2pm Sun Thanks.
You're right. I'm afraid this is not possible. You'll need to specify two CRON expressions.
shell_scripting
5.1
stackoverflow
{ "tier": "short", "total_tokens": 88 }
so_6946677
Grep with quotation mark I'm trying to scan an error log for lines with 503 errors, so I'm grepping for `" 503` (quote space 503). This seems simple, but it won't work: I get the following error: bash: -c: line 0: unexpected EOF while looking for matching `"' bash: -c: line 1: syntax error: unexpected end of file
The issue was due to some erroneous directives in `.bashrc`. ``` grep '" 503 ' access.log ```
shell_scripting
5.1
stackoverflow
{ "tier": "short", "total_tokens": 102 }
so_7538251
How can I get the CPU and Memory useage I want to know the memory and CPU usage in php, because I'm using cronejobs sometimes the CPU is overloaded so in this case I don't wan to start more process, I just want to skip this cron.
I think better way is get load avarage , because it depends not only on CPU, but on HDD speed also. Here is a doc: http://php.net/manual/en/function.sys-getloadavg.php
php
5.09
stackoverflow
{ "tier": "short", "total_tokens": 99 }
so_64201194
How to run every 10 seconds in GCP Cloud Scheduler What would be a correct syntax for the Cloud Scheduler Frequency field to run it every 10 seconds? I've been using https://crontab.guru/ but it seems to be missing the `seconds` and starts with minutes, hours and etc.
Google Cloud Scheduler does not support seconds. The smallest scheduling interval is one minute.
shell_scripting
5.09
stackoverflow
{ "tier": "short", "total_tokens": 91 }
so_18203116
Can I get expiration time of specified key in django cache? It must be stored somewhere. I can change it with `set()`/`incr()`, but I couldn't find the way to read it.
to get the unix timestamp ``` cache._expire_info.get('foo') ```
python
5.09
stackoverflow
{ "tier": "short", "total_tokens": 58 }
so_610242
Fault tolerant software architecture articles I'm looking for some good articles on fault tolerant software architectures. Could I please have some recommendations.
Handbook of Software Reliability Engineering you can read it in pdf. One of the main principles of software reliability is fault tolerance. Take a look at chapter 14 Fault-Tolerant software .
system_design
5.08
stackoverflow
{ "tier": "short", "total_tokens": 89 }
so_8078363
Cron syntax interpreter? Does anyone know of a tool that will given a cron string for example * * * 1 * * tell you what that string translates to? I know it's not rocket science but I want to be sure that I'm constructing the correct interval for a scheduled task.
Just found this, was exactly what I was looking for and it seems like what you want too: http://cronchecker.net/
shell_scripting
5.07
stackoverflow
{ "tier": "short", "total_tokens": 94 }
so_5642400
Best tool for unit testing in MySQL I've been doing a lot of sproc programming in MySQL lately. And I must say that I like it. A lot. However debugging these babies sucks. Anyone know of any tools that can put some happiness in My MySQL debugging?
http://www.mydebugger.com/ There is a limited free version, but the full version is not too expensive either. Here is screenshot:
sql
5.07
stackoverflow
{ "tier": "short", "total_tokens": 94 }
so_28768976
Grep list files once I'm looking for some pattern in my project, and it's been repeated too much in some files.. How can I tell grep to show only once each file? I'm using:
You could do this, it will make grep only print the first match: ``` grep -m 1 -R "pattern" * ```
shell_scripting
5.05
stackoverflow
{ "tier": "short", "total_tokens": 67 }
so_70965148
FASTAPI: what is`(..)` in the Body(...) while reading from a post request? I am trying to read body from my POST request using FastAPI. However i am not able to understand what `(...)` argument for the Body function Here is my code :
Probably duplicated question. Here is another one: What does the Ellipsis object do? It is part of Python, not FastAPI ``` @app.post('/createPosts') def create_post(payload: dict = Body(...)): print(payload) return {'message': 'succesfully created post'} ```
python
5.05
stackoverflow
{ "tier": "short", "total_tokens": 125 }
so_27233335
export mariadb 10 dump to mysql 5.5 Is there a way to use mysqldump or something similar to create an all-databases dump from a mariadb 10 server that will import into a mysql 5.5 server flawlessly? Currently I run into some problems with the dump because of mariadb-only features. Thank You
Use `mysqldump --compatible=ansi --all-databases` to export in ansi mode.
sql
5.05
stackoverflow
{ "tier": "short", "total_tokens": 91 }
so_1934520
Running AWK in Vim's search How can you run AWK in Vim's selection of the search? My pseudo-code I am trying to delete the given column in the file.
In command mode, press Ctrl - v to go into visual mode, then you can block-select the column using cursor movement keys. You can then yank and put it or delete it or whatever you need using the appropriate vim commands and keystrokes. ``` %s/!awk '{ print $2 }'//d ```
shell_scripting
5.04
stackoverflow
{ "tier": "short", "total_tokens": 104 }
so_12486686
What does -f stand for in "php -f" when running a cron job? What does the `"-f"` in say stand for?
According to the PHP Command-Line options reference: http://php.net/manual/en/features.commandline.options.php the `-f` option indicates which file the PHP engine should execute, in this case `myscript.php`. ``` * * * * * php -f myscript.php ```
php
5.03
stackoverflow
{ "tier": "short", "total_tokens": 86 }
so_1428340
Can a PHP script continue running after ending the HTTP request? How do I write a PHP script that continues running, even after flushing out some text and ending the HTTP request? Is this possible?
To run PHP app forever or until php terminates ``` ignore_user_abort(true); set_time_limit(0); ```
php
5.02
stackoverflow
{ "tier": "short", "total_tokens": 74 }
so_1417098
Cronjob every 25 hours? How do I set up a cronjob that runs every 25th hour?
Just a guess, but you don't Best hack off the top of my head: write a script to track the last time it was run, and conditionally run it if it was more than 25 hours ago. Cron that driver script to run every hour.
shell_scripting
5.02
stackoverflow
{ "tier": "short", "total_tokens": 72 }
so_2742172
To use Wordpress themes in Rails apps? Wordpress themes are beautiful! Is there any guideline to use Wordpress themes in a rails app? Even better, are there rails app templates which can use the Wordpress themes already? Thanks!
Checkout the install_theme gem . I haven't it used it but it's supposed to make it easy to install other themes into a Rails app.
wordpress
5.01
stackoverflow
{ "tier": "short", "total_tokens": 89 }
so_5335973
Codeigniter and $_SERVER What is equalient of $_SERVER in codeigniter ?
For more information, please refer to the User Guide : Input ``` $this->input->server() ```
php
5.01
stackoverflow
{ "tier": "short", "total_tokens": 41 }
so_1771237
Is it OK not to use a Primary Key When I don't Need one If I don't need a primary key should I not add one to the database?
A primary key uniquely identifies a row in your table. The fact it's indexed and/or clustered is a physical implementation issue and unrelated to the logical design. You need one for the table to make sense.
sql
5.01
stackoverflow
{ "tier": "short", "total_tokens": 82 }
so_9577636
how to do a unix find based on size of files, including in subdirectories? Trying to use osx find to find all the files in my directory tree. I googled and SO'd and looked at man but none helped. So far I have: `find -f -c1mb` which is clearly wrong.
The above one should work. ``` find . -size +20000 ```
shell_scripting
5
stackoverflow
{ "tier": "short", "total_tokens": 76 }