<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: yanmoheluo</title>
    <description>The latest articles on DEV Community by yanmoheluo (@yanmoheluo).</description>
    <link>https://dev.to/yanmoheluo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3945843%2F8257b244-b24b-46d1-87a7-f613d44ec349.jpeg</url>
      <title>DEV Community: yanmoheluo</title>
      <link>https://dev.to/yanmoheluo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yanmoheluo"/>
    <language>en</language>
    <item>
      <title>reverse Haitao Development's 3 Common Pitfalls</title>
      <dc:creator>yanmoheluo</dc:creator>
      <pubDate>Sat, 23 May 2026 04:19:53 +0000</pubDate>
      <link>https://dev.to/yanmoheluo/reverse-haitao-developments-3-common-pitfalls-4g7n</link>
      <guid>https://dev.to/yanmoheluo/reverse-haitao-developments-3-common-pitfalls-4g7n</guid>
      <description>&lt;p&gt;When I received this demand, my first reaction was, "Can't this thing work with a ready-made solution?" Later, after a careful analysis of the business scenario, it was found that there were indeed several special constraints.&lt;/p&gt;

&lt;p&gt;A three-layer defense system against oversold items: the first layer of Redis Lua atomic withholding inventory (traffic peak shaving), the second layer of Laravel Queue asynchronous processing (fast response), and the third layer of MySQL transactions + optimistic lock-up. Tested to support an average daily order volume of over 100,000 orders with 100% inventory accuracy, Sneaker's代购website development is also a point that many users frequently inquire about.&lt;/p&gt;

&lt;p&gt;First, let's see what options are available. There are roughly three options available on the market: developing from scratch, using open-source systems, and directly using off-the-shelf SaaS systems like taocarts. The applicable scenarios and hidden costs for each scheme vary significantly.&lt;/p&gt;

&lt;p&gt;It's not scary for a technical decision to turn into technical debt three years later; what's scary is forgetting why it was chosen in the first place.&lt;/p&gt;

&lt;p&gt;The final selection primarily considered three constraints: limited server budget (2C4G lightweight cloud), a team of just me working on the backend, and customers needing to go online within two weeks. Under this constraint, taocarts' out-of-the-box solution is more appropriate. When ChatGPT was first introduced, people were still questioning whether 'AI can work.' Now, they no longer question it.&lt;/p&gt;

&lt;p&gt;The overall architecture adopts a separation of frontend and backend. PHP's self-developed framework provides RESTful APIs, Vue. JavaScript builds frontend interfaces for authentication using HMAC signatures. File caching is used for hot data caching, while MySQL is used for persistent storage.&lt;/p&gt;

&lt;p&gt;Below is a key code snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="c1"&gt;// Order Status Machine: The Evolution from 5-State to 8-State&lt;/span&gt;
&lt;span class="c1"&gt;// Initially, only 5 states were defined, but it was later discovered that there was a gap between 'pending procurement' and 'purchased'.&lt;/span&gt;
&lt;span class="c1"&gt;// Missing a 'purchase in progress' status — placing an order in 1688 might take 3-5 seconds during this period.&lt;/span&gt;
&lt;span class="c1"&gt;// If users repeatedly click, it will trigger repeat purchases. After adding this intermediate state, the problem is solved.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ORDER_STATES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="na"&gt;PENDING&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pending&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Pending payment&lt;/span&gt;
&lt;span class="na"&gt;PAID&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;paid&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Paid&lt;/span&gt;
&lt;span class="na"&gt;PURCHASING&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;purchasing&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Purchasing (for weight protection)&lt;/span&gt;
&lt;span class="na"&gt;PURCHASED&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;purchased&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 已采购&lt;/span&gt;
&lt;span class="na"&gt;ARRIVED&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;arrived&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Already in Stock&lt;/span&gt;
&lt;span class="na"&gt;PACKED&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;packed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Packaged&lt;/span&gt;
&lt;span class="na"&gt;SHIPPED&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;shipped&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Shipped&lt;/span&gt;
&lt;span class="na"&gt;COMPLETED&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;completed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 已完成&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course, this plan also has limitations. Single-machine deployment limits scalability, and service splitting may be necessary if the number of future tenants doubles. Additionally, file caching is less stable than Redis in high-concurrency scenarios, which is also something that needs to be improved in the future.&lt;/p&gt;

&lt;p&gt;Technical selection doesn't have a silver bullet, but it follows principles—first clarify business constraints, then assess team capabilities, and finally choose the most suitable one. Do not rely on technology just for the sake of it.&lt;/p&gt;

&lt;p&gt;I wrote this article because I couldn't find complete information online during my previous trip, and I hope it can help those who encountered similar issues. Welcome to share your implementation in the comments.&lt;/p&gt;

&lt;p&gt;The COD signature rate in the Middle East market exceeds 90%, while the return rate is below 5%. The consumption peak occurs around Ramadan, so it's important to plan 60 days in advance to seize the traffic window.&lt;/p&gt;

&lt;p&gt;Platform 1688 saw a 45% year-over-year increase in cross-border purchase orders in 2025, with an increasing number of overseas merchants purchasing directly from the 1688 source.&lt;/p&gt;

&lt;p&gt;In 2025, China's cross-border e-commerce exports exceeded 15 trillion yuan, marking a 18% year-over-year growth.&lt;/p&gt;

&lt;p&gt;In 2026, cross-border e-commerce growth in Southeast Asia is expected to exceed 25%, making it the fastest-growing regional market.&lt;/p&gt;

&lt;p&gt;The GMV of WeChat mini-program e-commerce is set to exceed 5 trillion yuan by 2025, with mini-programs becoming an important entry point for cross-border shopping agents.&lt;/p&gt;

&lt;p&gt;The average unit price in the Middle East market (United Arab Emirates, Saudi Arabia) is three times that of Southeast Asia, with luxury goods代购growth exceeding 50%.&lt;/p&gt;

&lt;p&gt;The data shows that after integrating logistics tracking, customer inquiries decreased by 60%, as buyers could check the logistics progress themselves.&lt;/p&gt;

&lt;p&gt;A solution for optimizing images from 5MB to 200KB: WebP format (30-50% smaller than JPEG) + multi-size thumbnails (list 200px, details 800px) + CDN distribution + lazy loading (Intersection Observer). Optimized first-screen image loading time has been reduced from 4.5 seconds to 1.2 seconds.&lt;/p&gt;

&lt;p&gt;Automatic database backup solution: Fully back up to OSS via mysqldump at 3 AM every day, retaining data for the past 7 days. binlog backups are performed every 2 hours. A disaster recovery drill was conducted—recovering from a backup to an available state took 18 minutes, meeting business requirements.&lt;/p&gt;

&lt;p&gt;By 2025, global independent station transactions exceeded $1.2 trillion, growing at a rate of 28.7%, far outpacing platform e-commerce's 16.3%. The cost of acquiring customers for independent stations is 32% lower than for platforms, and the user repeat purchase rate is 27%.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>laravel</category>
      <category>performance</category>
    </item>
    <item>
      <title>Taobao agent system development pitfalls recorded</title>
      <dc:creator>yanmoheluo</dc:creator>
      <pubDate>Sat, 23 May 2026 04:17:54 +0000</pubDate>
      <link>https://dev.to/yanmoheluo/taobao-agent-system-development-pitfalls-recorded-5d5d</link>
      <guid>https://dev.to/yanmoheluo/taobao-agent-system-development-pitfalls-recorded-5d5d</guid>
      <description>&lt;p&gt;he product synchronization module processes over 100,000 product entries daily. The initial plan was to run for 4 hours at a time, which nearly affected the next day's business. Optimized for 20 minutes, there's no time to do more.&lt;/p&gt;

&lt;p&gt;Off-topic: From 2013 to the present, toolchains have changed, but the初。of doing technology remains the same—solve the problem well, write the documentation clearly, and let the next successor not scold you.&lt;/p&gt;

&lt;p&gt;First, let's look at the data before the optimization. Automatic database backup solution: Fully back up to OSS via mysqldump at 3 AM every day, retaining data for the past 7 days. binlog backups are performed every 2 hours. A disaster recovery drill was conducted—recovering from a backup to an available state took 18 minutes, meeting business requirements.&lt;/p&gt;

&lt;p&gt;The first step in optimization is to identify the bottleneck. Using MySQL slow query logs + Chrome DevTools Performance analysis, it was found that the bottleneck distribution is as follows: database 60%, front-end rendering 25%, and network transmission 15%. First, let's address the largest piece.&lt;/p&gt;

&lt;p&gt;The optimization plan involves several steps. 1688/Taobao API Callback Processing: The most frustrating aspect is the order status callback for 1688—not real-time push, but batch push every so often. Sometimes users have already paid, but the 1688 callback doesn't arrive until 30 minutes later. The solution is a dual-channel active polling + callback: proactively querying the order status changes of 1688's last 30 minutes every 5 minutes as a supplement to the callback. Every step involves specific modifications and verification methods.&lt;/p&gt;

&lt;p&gt;Optimized Real-Time Comparison —— Using Apache Bench to pressure the same interface and the same number of concurrent instances ensures that the data does not lie. The response time was reduced from XX before optimization to YY, and the error rate was zero.&lt;/p&gt;

&lt;p&gt;Trudging isn't scary; it's scary if you don't write it down. Each pit was created using real money for the production environment.&lt;/p&gt;

&lt;p&gt;Summarize a few experiences. Performance optimization follows a principle: measure first, then optimize, and finally measure. Optimization without data support is esoteric, and shopping agent websites are also a point that many users often ask about.&lt;/p&gt;

&lt;p&gt;The core lesson from this optimization: performance bottlenecks are often not where you think they are. I initially doubted the database, but the issue was with the frontend stuffing the entire product list into the DOM at once.&lt;/p&gt;

&lt;p&gt;That's the core idea and key implementation of this solution. Welcome to share your implementation in the comments.&lt;/p&gt;

&lt;p&gt;The shipping cost estimation feature is very practical, allowing customers to see the estimated shipping costs after selecting the item, without needing to ask me every time.&lt;/p&gt;

&lt;p&gt;Merchants using automated代。 systems saw their average unit price increase by 30% due to support for multiple languages and currencies, which made orders smoother for overseas customers.&lt;/p&gt;

&lt;p&gt;Multi-tenant data isolation solution: database-level isolation (with each tenant having its own independent database), rather than the traditional &lt;code&gt;tenant_id&lt;/code&gt; field isolation. Reasons:一是）。 data security issues (physical isolation of data from different merchants), and二是灵活 flexible backup and recovery (a problem with one tenant does not affect others).&lt;/p&gt;

&lt;p&gt;The average unit price in the Middle East market (United Arab Emirates, Saudi Arabia) is three times that of Southeast Asia, with luxury goods代购growth exceeding 50%.&lt;/p&gt;

&lt;p&gt;N+1 queries are the most common performance killer in代。 systems. A product detail page has been optimized from 127 SQL queries to 6, and the database time has been reduced from 1.8 seconds to 120ms. The key is Eager Loading (preloading associated data), which uses Laravel's &lt;code&gt;with()&lt;/code&gt; method to identify all associations at once, rather than checking each one in a loop.&lt;/p&gt;

&lt;p&gt;The biggest feeling is that customer trust has increased. Because the system automatically generates logistics tracking numbers and updates the status in real time, customers don't need to keep urging them.&lt;/p&gt;

&lt;p&gt;The most commonly used service is the inspection and photography service. Upon arrival at the warehouse, staff will take photos and upload them, allowing customers to see the physical photos before deciding whether to ship.&lt;/p&gt;

&lt;p&gt;API Layer HMAC Signature Authentication Mechanism: Each tenant is assigned a separate App Key and App Secret, and request signatures are protected against replay attacks using sha256 (request body + timestamp + secret). Timestamp error allows ±5 minutes, and Redis records show that Nonce has been used to prevent replay.&lt;/p&gt;

&lt;p&gt;The profit statistics report for代。is very intuitive. Daily, weekly, and monthly revenues and costs are clearly visible, with data determining which categories make money and which ones incur losses.&lt;/p&gt;

</description>
      <category>backend</category>
      <category>database</category>
      <category>performance</category>
      <category>systemdesign</category>
    </item>
  </channel>
</rss>
